Monday 23 December 2013

Nginx-1 Installation and startup

Nginx is a very powerful and fast HTTP server, it is overtaking Apache in the web server area.

this blog is a brief introduction about installing and starting Nginx on CentOS.

Pre-steps:

Make sure the following components are installed in your computer:
1)      gcc: the compiler
2)      PCRE/PCRE-devel: the Perl Compatible Regular Expression
3)      zlib/zlib-devel: zip Algorithm
4)      openssl/openssl-devel: open ssl related lib

if not, please use yum to install/update them.

1.       download the source file and unzip the file

wget http://nginx.org/download/nginx-1.5.8.tar.gz
tar -xzvf nginx-1.5.8.tar.gz

  







2. configure and compile the source files

commands
./configure
./make
./make install
Note: this is only for demonstration, in production environment, there will be lots of options such as --prefix. etc.


3.       run the nginx

by default, the nginx is installed in /usr/local/nginx
you need to go to nginx home directory and test the configuration files
./nginx -t #test the configuration
./nginx #start the nginx
Then you can check nginx processes and use http://[ip] to test



In next blog, we are going to talk about how to configure nginx.

No comments:

Post a Comment