1)
Download the nginx-1.0.0.tar.gz installation package andUnzip the installation package and move it to the/usr/local/nginx directory:
tar xvf nginx-1.0.0.tar.gzmv nginx-1.0.0.tar.gz nginx
2) Compile and install:
./configure --user=apache --group=apache --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_gzip_static_module --http-client-body-temp-path=/var/cache/nginx/client_body_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --without-http_scgi_module --without-http_uwsgi_module --with-http_ssl_module --with-md5=/usr/lib/openssl/ --with-sha1=/usr/lib/openssl/ --without-http_fastcgi_modulemakemake install
3) create a cache folder and nginx STARTUP script, and set nginx startup:
Mkdir/var/cache/nginxwget http://files.cnblogs.com/showblog/nginx.zip (STARTUP script, download unzip to generate nginx file) cp nginx/etc/init. d/nginxchmod + x/etc/init. d/nginxchkconfig -- add nginxchkconfig -- level 2345 nginx on