Tuesday, 2 September 2014

JBoss Configuration in Linux Server to Listen to a particular port

JBoss Configuration in Linux Server to Listen to a particular port

We have to do a minimal configuration in Linux to make the JBoss application to listen to a particular port.

The changes are as listed below:

1. Configure the firewall by including the port number in /etc/sysconfig/iptables


a. The content of the IP tables is as below ( we have highlighted port # 8880 entry)

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8880 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

b. restart the iptables file by running the following command:
    /etc/init.d/iptables restart

 
2. We have to start the run.sh with additional parameter for IP(localhost) by explicitly mentioning 0.0.0.0 as the localhost. Because if you don't specify explicity then run.sh will consider 127.0.0.1 as default IP for localhost. We need to do this changes because when we access the JBoss server from client machines(windows) remote servers will be recognized only when it is configured through IP address 0.0.0.0 (Linux server localhost)

To make the JBoss server to start with IP address 0.0.0.0 instead of 127.0.0.1, we need to run the following command:

nohup ./run.sh -b 0.0.0.0 &

highlighted one (0.0.0.0) is the remote server IP address for localhost.

3. To test the JBoss server is running or not in client machine (Windows) you can run the following :
    a. From command line type, telnet 10.103.145.183 8880
    b. Also, you can test from your browser: http://10.103.145.183:8880/

No comments:

Post a Comment