Installation environment:
Centos6.5 nginx1.7.0 1. create user groups and users (nginx/nginx) # Su-# groupadd nginx # useradd-G nginx-D/home/nginx-P nginx II. Create and install nginx and WWW directory # Su-1. installation directory: /APP/nginx # cd/APP # mkdir nginx # chown-RF nginx: nginx. /nginx 2. WWW directory:/data/wwwroot # CD Data # mkdir wwwroot # chown-RF nginx: nginx. /wwwroot 3. Download the installation media: browse and select the relevant version http://nginx.org/download/ # wget http://nginx.org/download/nginx-1.7.0.tar.gz # tar-zxvf nginx-1.7.0.tar.gz 4. Check the installation prerequisites Su-whether to install OpenSSL, PCRE, zlib # rpm-Qa | grep OpenSSL-devel # rpm -Qa | grep PCRE-devel # rpm-Qa | when grep zlib is connected to the Internet, run the following command to install # Yum-y install PCRE-devel # Yum-y install OpenSSL-devel Server for more information, see
Http://inotgaoshou.iteye.com/blog/962946
5. Compile and install
Su-nginx
1. compile related parameters
#./Configure
--prefix=/app/nginx --
user=nginx
--group=nginx
--with-http_stub_status_module
--with-http_ssl_module
--without-http_fastcgi_module
# Make # make install 6. Configure startup (non-root user starts port 80) # Su-# chmod 777/etc/sudoers # vi/etc/sudoersnginx all = nopasswd: /APP/nginx/sbin/nginx # chmod 640/etc/sudoers 7. Start and restart # sudo/APP/nginx/sbin/nginx # sudo/APP/nginx/sbin/ nginx-s reload 8. view the process PS-Ef | grep nginx 9. Modify the root directory root/data/wwwroot; 10. Enable shtmlssi on;
Ssi_silent_errors on;
Ssi_types text/shtml; Reference URL http://www.sunbloger.com/article/228.html
99. Related errors
./Configure: Error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
Into the system, or build the OpenSSL library statically from the source
With nginx by using -- With-OpenSSL = <path> option.
OpenSSL module is not installed. Install OpenSSL # Yum-y install OpenSSL-devel first.
Nginx installation manual