Nginx is installed in linux and nginxlinux
Yum install pcre *
Yum install openssl *
Yum install zlib
Yum install zlib-devel
Yum install wget
Check whether rpm-qa | grep "View content" has been installed"
2. Start nginx Installation
Wget http://nginx.org/download/nginx-1.8.0.tar.gz
3. Extract
If you want to copy the installation package elsewhere, you can cp nginx-1.8.0.tar.gz path (for example/usr/local)
Tar-zxvf nginx-1.8.0.tar.gz
4. Unzip the package and start installation.
Cd nginx-1.8.0
./Configure -- prefix =/opt/nginx -- with-http_stub_status_module // -- prefix =/opt/nginx this is the specified installation path
5. Start nginx. Here I installed it in opt/nginx
Cd/opt/nginx
./Nginx // If the port is occupied when this step is executed:
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] still cocould not bind ()
I am using port 80 to check which ports are occupying port 80.
Fuser-n tcp 80
The returned message is 80/tcp: 12965 12966.
Then delete the process through kill-9
Kill-9 12965
Kill-9 12966
Then start nginx
./Nginx
This article is a comprehensive http://happyqing.iteye.com/blog/1806561 http://jingyan.baidu.com/article/1974b2898f5eadf4b1f774de.html http://www.laozuo.org/3510.html practice summed up if there is any error contact author