Can not start JBoss on port 80

Asked By 100 points N/A Posted on -
qa-featured

We have a requirement to use JBoss as the application server for a web application. The web application is fully tested and ready. We have a Linux box as the production server. We require to run the web application on the production box under Jboss. Our development environment was windows.

We were able to configure JBoss to use the default port 80 by editing the server.xml. The same changes on the Linux box does not work. The JBoss application server refuses to start. Is there anything more that requires changing to make the application server start on port 80?
SHARE
Best Answer by MathGirl
Answered By 0 points N/A #91248

Can not start JBoss on port 80

qa-featured

Ports under 1024 are known as well defined ports for common applications, for Web services such as Web Servers, Email servers and FTP services. In Linux, all ports under 1024 are very special and require super user privileges to access them. This means you need to boot up your JBoss application server as a super user.

If not you cannot use ports below 1024 for your application. Please login to the production box and start the service as a super user.
Best Answer
Best Answer
Answered By 0 points N/A #91249

Can not start JBoss on port 80

qa-featured

You need to SSH to the production box, use the "sudo" command to shell into a super user account and then start the application server. You need to know that once this is done, all files created by the application sever will only be accessible to a super user account. WhizBoy is correct regarding the ports under 1024 being privileged.

 

Answered By 100 points N/A #91251

Can not start JBoss on port 80

qa-featured

Starting JBoss as a super user worked! Thank you MathGirl and Thank You WhizBoy! Now comes the biggest problem. IT admin says "no" for using a super user account for the application server. This is because the Java virtual machine gets the same privileges. This makes the server vulnerable for rouge code. Is there a method to use a normal shell account and still use port 80?

 

Answered By 0 points N/A #91252

Can not start JBoss on port 80

qa-featured

A normal user account will only allow applications to use port numbers above 1024. I would suggest you do a firewall level mapping to overcome this issue. This requires implementing firewall rule to redirect traffic coming to port 80 to port number 8080.

You start your JBoss application server on port 8080 using a normal user account. And then allow the Firewall do the need full. For this to work, all users need to be "outside" the network of the production box. i. e. the production box cannot be on the same LAN as the users.

Answered By 100 points N/A #91253

Can not start JBoss on port 80

qa-featured

Thank you MathGirl. We have a small problem in configuring the firewall rule. The service provider only supports direct port mapping. They do not provide port redirection. They say we have to handle it internally.

Answered By 0 points N/A #91254

Can not start JBoss on port 80

qa-featured

In that case you need to use the internal Linux port mapping. This is done by modification of the Internet Protocol Tables, using the "iptables" utility. Adding the following code to the boot script would do the needful. You can basically redirect connections to port 80 and 443 to port 8080 and 8443 of JBoss. The 8443 is the SSL port of the default JBoss instance.

/sbin/iptables -t nat -A PREROUTING -p tcp –dport 443 -d <ipaddress> -j DNAT –to <ipaddress>:8443
/sbin/iptables -t nat -A PREROUTING -p tcp –dport 80 -d <ipaddress> -j DNAT –to <ipaddress>:8080
 
You need to replace the <ipaddress> with the internal/external IP address that you are using.
Answered By 100 points N/A #91255

Can not start JBoss on port 80

qa-featured

WhizBoy your solution worked! Thank you MathGirl and WhizBoy! Now I am able to use the application server without any trouble! Thank you both!

 

Answered By 0 points N/A #91256

Can not start JBoss on port 80

qa-featured

That is a neat piece of code. WhizBoy! Very good! I did not know about iptables!

 

Related Questions