The following are some of the features of Nginx:
* It serves static and index files
* Reverse proxy with caching
* Supports SSL
* Simple load balancing with fault tolerance
* Both name-based and ip-based virtual server can be configured
* HTTP basic authentication
* Supports rewrite module
* Supports gzip, XSLT, SSI and image resizing filters
* All the main mail proxy server features are supported
* and lot more..
During ./configure, you might get the “./configure: error: the HTTP rewrite module requires the PCRE library.” error message about missing PCRE library that is required by nginx http rewrite module.
To solve the problem, either install “pcre” and “pcre-devel” packages on your Linux, or disable the rewrite module by doing “./configure –without-http_rewrite_module”
Prerequsite – #sudo apt-get install libpcre3 libpcre3-dev
Follow Instructions on for reference
#apt-get install nginx
For Source Installation:
Download – http://wiki.nginx.org/Install
#tar xvzf nginx-1.2.3.tar.gz
Building Nginx from Source : go to the unzipped Nginx dir –
Nginx will be installed under /usr/local/nginx as shown by the ./configure output.
Compile time options
#sudo make install
Change the Default Nginx Listen Port
Nginx is configured to listen by default on port 80. If you are installing this on a machine for testing purpose, that already has an apache server running, you should change the nginx listen port.
Similar to apache’s httpd.conf file, nginx has nginx.conf file located under /usr/local/nginx/conf.
In the server section of nginx.conf, change the port 80 to 8081
change 80 to 80123
Start Nginx Server
#sudo /etc/init.d/nginx start
To stop the nginx server, do the following.
./nginx -s stop
#sudo /etc/init.d/nginx stop
To view the current version of nginx, do the following:
# ./nginx -v
nginx: nginx version: nginx/1.0.5
To debug issues, view the error.log and access.log files located under /usr/local/nginx/logs
# ls /usr/local/nginx/logs/
More on Nginx —
DocumentRoot equivalent of Apache in Nginx is /usr/local/nginx/html