Runing server on Windows without deal with the Firewall - server

Why is the firewall constantly asking for http permission for any programms where you need run something in localhost?
When running this example, permission will be asked each time (P.s. Using "go build -o a.exe && a.exe" (Using Go as an example) or something similar may sometimes not help)
Example 1
package main;
import (
"net/http"
"fmt"
)
func requestHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, world")
}
func main(){
http.HandleFunc("/", requestHandler)
http.ListenAndServe(":6060", nil)
}

In any program where you work with a specific port, where a new executable file is created each time during implementation, the firewall will consider it as a new file and will ask for permission, the solution is the following:
Go to Windows Defender Firewall, in Left side menu you saw Inbound Rules click there
Then Right Side menu you will see New Rule... click.
Choose Port opened from window -> Next Select TCP, then define which ports you want I choose 6060 click Next again, Choose Allow the connection Next, Check All Next, Give any Name Goland or anything you want and press Finish. Thats it

Related

Show maintenance page during Wildfly startup

I have a WildFly installation which takes some time during startup due to the count and size of the deployments. So I would like to show a maintenance page until the full application is ready.
In one of the previous WildFly versions I used default-web-module as configuration option and registered a small WAR file, which was visible right away and was replaced as soon as the big application was available.
Unfortunately this is no longer possible with WildFly 22, instead an exception is thrown as soon as the real root application is deployed:
org.jboss.msc.service.DuplicateServiceException: Service jboss.undertow.deployment.default-server.default-host./.UndertowDeploymentInfoService is already registered
I know that I could put a small web server (nginx or similar) in front of WildFly to return my maintenance webpage as long as WildFly returns a 503 error. The only thing which prevents that is the fact, that the maintenance page still contains some logic which I would need to emulate on nginx.
Is there any other option which ensures that my maintenance page is delivered immediately while the other apps are still starting?
If I do understand your question correctly, what you want is to show error page of status 503 when server is down or 404 when server is replacing deployments.
But for your environment which don't have a web server in front of application server, we just need to consider 404 situation.
503 is for web server when the application server is down, therefore, 503 service unavailable.
First: Console -> Configuration tab
Head over to management console of Wildfly. And depends on what mode(domain or standalone) you are using ,there will be a little different inside configuration tab.
Second: Configuration -> Web -> Filters
If using domain mode, choose the profile you are using it.
And head over to Subsystem -> Web(Undertow) -> filters -> click 'View'.
I used profile 'full' in my local machine with domain mode, therefore, this is what my console looks like.
Path_to_Filters
Third: Choose Error page tab inside Filters
Set code and path like this, where code is what status code you hope the static page to show. And path is the file location of your static page.
setPathAndCode
You can see Wildfly doc for error-page settings.
Fourth: Configuration tab -> Web(Undertow) -> Server -> default-server(or what you used)
HeadToServer
Fifth: Choose Hosts tab inside servers
Choose 'Hosts' tab, and click add filter button.
Select the filter we just set in step three, and set predicate to true.
I'm not sure what will be effected if didn't set as true or left empty, cause it's not required fields.
Last: Restart the server in order to let your configuration works.
Now you should able to see your static page showed when you undeploy or re-deploy your application.
Sorry for not answering in too good answer format because I didn't answer any questions before.
** You can also set your standalone.xml or domain.xml like this to get the same result.
setXmlFile

Using Lucee Server with Command Box problems accessing Server Administration page

I recently downloaded CommandBox to try to set up a Lucee Server. I have a folder called LuceeSever with an Index.cfm page. When I type the command "box server start" it opens a window at this address: http://127.0.0.1:54613 displaying my index.cfm page. Cool.
But I would like to connect a datasource and I would like to do this thorough the server admin panel that everyone else says to use. So when I try to access http://127.0.0.1:54613/lucee/admin/server.cfm I get this screen:
So I created a password.txt file that contains 1 line of plaintext that is the password I wanted to use. So my directory looks like this:
LuceeServer>
index.cfm
password.txt
In which index.cfm and password.txt are at the same level. When I click import file the screen reloads and nothing happens.
I assume I have things set up incorrectly. I've never used commandbox before and I dont really know what I'm doing.
You can bypass this entirely by using CFConfig. You can either specify the adminPassword in your .cfconfig.json file
{
"adminPassword":"myPass"
}
or you can install commandbox-dotenv and set a global .env file that has a cfconfig_adminPassword key.
~/.box.env
# Add environment variables to be loaded into CommandBox when it starts
# Variables are in the form of foo=bar, one per line
cfconfig_adminPassword=myPass
Disclaimer: I am the lead developer of CommandBox and the CFConfig module.
When you run your server with CommandBox, click on its tray icon in the right corner of your desktop, click open and then the server home folder like shown on the image below:
Then navigate to /WEB-INF/lucee-server/context/ and place your password.txt file there. Then go back to lucees server admin page in your browser and click the "import file" button to import the password.txt file.
Your password.txt needs to go in the "root Lucee server directory", which isn't the same as your site's web root (which wouldn't be a very secure place to put it). In CommandBox the location is a bit obscure, but you can find it with the following command:
server info property=serverHomeDirectory

Activation pending in CQ5

I have created a test page in the Geometrixx site in CQ5. I can see the page very well on 4502 port (author environment). But when I activate the page to see it on the 4503 port (Publish environment) , I always see the yellow colored icon in front of the page on console which on hover says 'Activation pending. #1 in Queue'
Is there some workflow attached to it ? If so, how can I check it out and probably kill it (for now) ? Or is there some other reason ?
The default replication queue settings points to localhost:4503. If your publish instance is not located on the same machine as the author instance (which is common), you will need to change the settings to point to a valid publish instance. Once a valid publish instance is configured the items queued for activation should get processed and the icons will change from yellow to green.
If the queue is blocked, you can clear it by:
going to /etc/replication/agents.author.html
Clicking on the default replication agent.
Then clicking on 'clear' above the queue. This will clear the entire
queue.
If you want to clear one or more specific items in the queue, you can select
them then click clear.
This page has a few steps on troubleshooting replication agents:
http://helpx.adobe.com/cq/kb/replication-stuck.html
This page has some general information about replication agents:
http://dev.day.com/docs/en/cq/current/deploying/configuring_cq.html#Replicating from Author to Publish
You can inspect the replication queues at
http://localhost:4502/etc/replication.html
The default agent is
http://localhost:4502/etc/replication/agents.author/publish.html
From here you can test the connection, view the log, and see what's in the queue. You can also clear the queue or force retry.
there is a way to see a "final View" of your test page without to publish: wcmmode=disabled
http:// localhost: 4502/cf#/content/geometrixx/folder/test.html
Just delete /cf# and add ?wcmmode=disabled after the extension.
http:// localhost: 4502/content/geometrixx/folder/test.html?wcmmode=disabled
One thing not explicitly mentioned so far: You need TWO instances of AEM running. Ports 4502 and 4503 don't point to different modes of the same instance, as AEM only listens to the one port (in general). So you will need to copy your Author jar to a new directory and name it something like cq5-publish-4503.jar
In addition, you may need to update your maven pom files for code deploys. You CAN set installed bundles on author to auto replicate/publish however.

configure AP dd-wrt using telnet or ssh

i want to configure access point using telnet , for example change SSIDi have tried the command:
iwlconfig ath0 ESSID newssid
and it work i can see the newssid when search for networks and also if i write:
iwlconfig
i can see that the interface ath0 have the new ssid, but if i go to GUI i still see the old SSID , and if i reboot the AP , no changes will be saved, it will go back to old configurations
1-so how to save changes?
2-and i need more commands
Try this command:
nrvam commit
It should work.

How can I redirect ports in Cherokee?

I've installed cherokee and am very happy with it. But now I'm wondering how I can redirect ports. I'd like to redirect port 80 to other ports based on the hostname, as follows:
Request for http://a.mysite.com to http://mysite.com:8000
Request for http://b.mysite.com to http://mysite.com:9000
All help is appreciated.
Thanks a lot!
Good! Found out myself! :)
To redirect http://a.mysite.com to http://mysite.com:8000 follow these steps in the cherokee admin web environment:
First create a virtual server with name a.mysite.com and give it a document root, e.g. /var/www/a.
Then link to the sources tab and create a new information source by clicking the 'plus' icon. Enter a.mysite.com as nick and mysite:8000 as connection.
Go back to the vServers tab. After making sure that the a.mysite.com server is selected check that the host match method is set to 'match nickname'.
In the behaviour tab select the 'default' directory and in the handler tab select 'HTTP Reverse Proxy' from the handler dropdown list. Then select 'Round Robin' as balancer in the Back-end Server section.
In the section Assign Information Sources section select a.mysite.com as application server.
Then save and restart Cherokee.
You can preform the same process for b.mysite.com.
Or, when your site becomes more popular, you can add more application servers to a.mysite.com .