Linux nginx installation step details, linuxnginx details
1. Run rpm-qa | grep gcc to check whether gcc is installed. If not, install gcc first.
Yum install gcc-c ++
2. Install nginx dependent modules
Yum-y install zlib-devel openssl -- devel pcre-devel
3. Go to the installation directory and download the nginx installation package from the network.
Cd/opt
Wget https://nginx.org/download/nginx-1.8.0.tar.gz
4. decompress the nginx installation package and modify it to the folder.
Tar-xzvf nginx-1.8.0.tar.gz
Cd nginx-1.8.0
5. Check the dependency environment and configuration, set the installation directory parameters, and set the dependency mode.
./Configure -- prefix =/srv/nginx -- with-http_stub_status_module -- with-http_ssl_module -- with-http_realip_module
Note: "/srv/nginx" is the installation path, and "-- with" is the dependent module.
6. Compile
Make
7. Installation
Make install
8. Start
Cd/srv/nginx/sbin
./Nginx
9. query the process
Ps-ef | grep nginx
10. view the port
Netstat-ntlp
11. Verify the configuration file and reload it
./Nginx-t
./Nginx-s stop (quit, reload)
12. Kill processes
Kill-9 process id