A Brief Introduction to how to install nginx in centos
Tools/Raw Materials
- If the system does not install the GCC development tool, you must first install it. Use the following command:
Yum-y groupinstall "development tools"
STEP/Method
- Download the latest nginx URL http://nginx.org/en/download.html
Wget http://nginx.org/download/nginx-0.8.53.tar.gz
- Decompress and download the source code package.
Tar zxvf nginx-0.8.53.tar.gz
- Go to the decompressed source code folder
CD nginx-0.8.53
- Configure nginx
./Configure -- prefix =/opt/nginx -- with-http_stub_status_module
Explanation: -- prefix indicates the installation path and -- With-indicates the module to be installed. You can run./configure -- help to view the valid module.
- Compile and install nginx
Make & make install
- Start nginx
/Opt/nginx/sbin/nginx
- Stop nginx
/Opt/nginx/sbin/nginx-s stop
- Heavy Load nginx
/Opt/nginx/sbin/nginx-s reload
References
Official documentation