$ sudo yum install pcre pcre-devel openssl-devel perl gcc make -y
$ wget http://nginx.org/download/nginx-1.6.2.tar.gz
$ tar xzvf nginx-1.6.2.tar.gz
# chown -R youaijj:youaijj /home/youaijj
$ mkdir /home/youaijj/etc
$ mkdir /home/youaijj/usr
$ mkdir /home/youaijj/var
$ cd nginx-1.6.2
$ ./configure --prefix=/home/youaijj/etc/nginx --sbin-path=/home/youaijj/usr/sbin/nginx --conf-path=/home/youaijj/etc/nginx/nginx.conf --error-log-path=/home/youaijj/var/log/nginx/error.log --http-log-path=/home/youaijj/var/log/nginx/access.log --pid-path=/home/youaijj/var/run/nginx.pid --lock-path=/home/youaijj/var/run/nginx.lock --http-client-body-temp-path=/home/youaijj/var/cache/nginx/client_temp --http-proxy-temp-path=/home/youaijj/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/home/youaijj/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/home/youaijj/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/home/youaijj/var/cache/nginx/scgi_temp --user=youaijj --group=youaijj--with-http_ssl_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
$ ./configure \ --prefix=/home/youaijj/etc/nginx \ --sbin-path=/home/youaijj/usr/sbin/nginx \ --conf-path=/home/youaijj/etc/nginx/nginx.conf \ --error-log-path=/home/youaijj/var/log/nginx/error.log --http-log-path=/home/youaijj/var/log/nginx/access.log \ ... ...
$ make && make install
... # another virtual host using mix of IP-, name-, and port-based configuration # server { listen 8031; server_name cjj.test.dev; access_log /home/youaijj/var/log/nginx/access.test.log; location / { root html; index index.html index.htm; } } ...
$ cd /home/youaijj/usr/sbin
$ ./nginx
[youaijj@youai ~]$ curl localhost:8031 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html> [youaijj@youai ~]$