Monday, July 14, 2014

nginx Web Server

Install nginx in centOS 6

Create a file in yum repository for nginx with its repo.
vi /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

Once you saved the file
yum install nginx
service nginx start
service nginx status
By default nginx will be started and available in port :80.

  On the same server, protect the Java server from external access 

If you are running Nginx on the same server of the Java, the best practice is to deny access to port 8080 so only Nginx can access it. On Linux do:

/sbin/iptables -A INPUT -p tcp -i eth0 --dport 8080 -j REJECT --reject-with tcp-reset
 
Reference : http://wiki.nginx.org/JavaServers
// Below script tag for SyntaxHighLighter