Download the stable version from the official website of nginx, the version number downloaded here is nginx-1.0.2. By default, the compiled and installed Nginx contains most of the available modules. You can set the usage of each module through the "./configure --help" option. For example, for the unneeded http_ssi module, you can use the "--without- http_ssi_module" parameter turns off this module; if the "http_perl" module is required, it can be installed via the "--with-http_perl_module" parameter. Do the following to install
1.[root@localhost home]# tar zxvf nginx-1.0.2.tar.gz
2.[root@localhost home]#cd nginx-1.0.2
3.[[email protected] ]#./configure --with- > http_stub_status_module --prefix=/usr/local/nginx
4.[root@localhost nginx-1.0.2]#make
5.[root@localhost nginx-1.0.2]#make install
After the installation is complete, perform the following operations to verify that the installation is successful:
cd /usr/local/nginx/sbin
./nginx -t
The result shows:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
At this point, the installation of nginx has been successfully completed.
Start nginx
cd /usr/local/nginx/sbin
./nginx //Start nginx
Enter in the browser: http://localhost to verify whether nginx starts successfully
Installation method of nginx in centos (tar.gz format)
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326642674&siteId=291194637
Ranking