Forward Incoming port 80 to 8080
Forward Incoming port 80 to 8080:-
We can set port forwarding by using iptables. Means we can set the rules in iptables.
If iptables rpm is not installed in server, so please insatll it.
[root@localhost ~]# yum install iptables
Start iptables service.
[root@localhost ~]# service iptables start
Make sure iptables starts up by default after a server restart
[root@locahost ~]# chkconfig iptables on
Then set the iptables rule.
[root@localhost ~]# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
Save this rule.
[root@localhost ~]# service iptables save
You can test it from server IP Address. Open the browser and type the server IP Address.
http://server_ip_address/
Thats it...
We can set port forwarding by using iptables. Means we can set the rules in iptables.
If iptables rpm is not installed in server, so please insatll it.
[root@localhost ~]# yum install iptables
Start iptables service.
[root@localhost ~]# service iptables start
Make sure iptables starts up by default after a server restart
[root@locahost ~]# chkconfig iptables on
Then set the iptables rule.
[root@localhost ~]# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
Save this rule.
[root@localhost ~]# service iptables save
You can test it from server IP Address. Open the browser and type the server IP Address.
http://server_ip_address/
Thats it...
Install tomcat 6 in Linux server.
Install tomcat 6 in Linux server.
Install the tomcat6 using yum..
[root@localhost ~]# yum install tomcat6
Start the tomcat6 service.
[root@localhost ~]# service tomcat6 start
Install the tomcat6 using yum..
[root@localhost ~]# yum install tomcat6
Start the tomcat6 service.
[root@localhost ~]# service tomcat6 start
Change default port of tomcat to 80 or any port.
Change default port of tomcat to 80 or any desire port:-
Most of user want to change this default port to 80. Port 80 is by default using for web site.
Kindly go through below step and change the port.
STEP 1:- Stop the tomcat service.
[root@localhost ~]# service tomcat6 stop
STEP 2:- Find the tomcat path, Defalut tomcat6 path is /etc/tomcat6/. There is configuration file by name server.xml.
STEP 3:- Run the below commands one by one.
[root@localhost ~]# sudo sed -i 's/port="80"/port="8080"/' /etc/tomcat6/server.xml
[root@localhost ~]# sudo sed -i 's/port="443"/port="8443"/' /etc/tomcat6/server.xml
Where,
Http default port is 8080 and Https default port is 8443. You have change it to 80 and 443 respectively.
You can also change this to any desire port. e.g. for http is 123 and https is 456. Then you run the below command as.
[root@localhost ~]# sudo sed -i 's/port="123"/port="8080"/' /etc/tomcat6/server.xml
[root@localhost ~]# sudo sed -i 's/port="456"/port="8443"/' /etc/tomcat6/server.xml
STEP 4:- Start the tomcat service as below.
[root@localhost ~]# service tomcat6 start.
STEP 5:- Check port 80 is listening or not using below command.
[root@localhost ~]# netstat -ano | grep :80
Also before changing tomcat port you make sure that on port 80 or desire port is not in use...
Most of user want to change this default port to 80. Port 80 is by default using for web site.
Kindly go through below step and change the port.
STEP 1:- Stop the tomcat service.
[root@localhost ~]# service tomcat6 stop
STEP 2:- Find the tomcat path, Defalut tomcat6 path is /etc/tomcat6/. There is configuration file by name server.xml.
STEP 3:- Run the below commands one by one.
[root@localhost ~]# sudo sed -i 's/port="80"/port="8080"/' /etc/tomcat6/server.xml
[root@localhost ~]# sudo sed -i 's/port="443"/port="8443"/' /etc/tomcat6/server.xml
Where,
Http default port is 8080 and Https default port is 8443. You have change it to 80 and 443 respectively.
You can also change this to any desire port. e.g. for http is 123 and https is 456. Then you run the below command as.
[root@localhost ~]# sudo sed -i 's/port="123"/port="8080"/' /etc/tomcat6/server.xml
[root@localhost ~]# sudo sed -i 's/port="456"/port="8443"/' /etc/tomcat6/server.xml
STEP 4:- Start the tomcat service as below.
[root@localhost ~]# service tomcat6 start.
STEP 5:- Check port 80 is listening or not using below command.
[root@localhost ~]# netstat -ano | grep :80
Also before changing tomcat port you make sure that on port 80 or desire port is not in use...
Configure NTP client server in linux
NTP client server configuration:-
STEP 1. Install the ntp rpm (Packages).
[root@localhost ~]# yum install ntp
STEP 2. Start NTP service.
[root@localhost~]# /etc/init.d/ntpd start
STEP 3. Check the NTP service status.
[root@localhost ~]# /etc/init.d/ntpd status
STEP 4. Open the NTP port 123 from server to out (Out Bound) in your hardware firewall (If you are using). This is UDP port.
STEP 5. Check the date and time, it is proper or not:-
[root@localhost ~]# date
STEP 6. Stop the NTP service.
[root@localhost ~]# /etc/init.d/ntpd stop
STEP 7. Syncing date and time from NTP servers, Run the below command.
[root@localhost ~]# ntpdate pool.ntp.org
STEP 1. Install the ntp rpm (Packages).
[root@localhost ~]# yum install ntp
STEP 2. Start NTP service.
[root@localhost~]# /etc/init.d/ntpd start
STEP 3. Check the NTP service status.
[root@localhost ~]# /etc/init.d/ntpd status
STEP 4. Open the NTP port 123 from server to out (Out Bound) in your hardware firewall (If you are using). This is UDP port.
STEP 5. Check the date and time, it is proper or not:-
[root@localhost ~]# date
STEP 6. Stop the NTP service.
[root@localhost ~]# /etc/init.d/ntpd stop
STEP 7. Syncing date and time from NTP servers, Run the below command.
[root@localhost ~]# ntpdate pool.ntp.org
STEP 8. Then start the NTP service.
[root@localhost~]# /etc/init.d/ntpd start
[root@localhost~]# /etc/init.d/ntpd start
Subscribe to:
Posts (Atom)