OS:
[[email protected] yuelinglong]$ cat /etc/redhat-release
CentOS release 6.5 (Final)
[[email protected] yuelinglong]$ uname -r
2.6.32-431.23.3.el6.x86_64
[[email protected] yuelinglong]$ uname -m
x86_64
[[email protected] yuelinglong]$

第一步:安装 pcre pcre-devel openssl-devel Development Tools

[[email protected] ~]$ sudo yum install -y pcre pcre-devel openssl-devel
[[email protected] ~]$ rpm -qa pcre pcre-devel
pcre-7.8-7.el6.x86_64
pcre-devel-7.8-7.el6.x86_64
[[email protected] ~]$ sudo yum groupinstall 'Development Tools'

第二步:安装Nginx

[[email protected] ~]$ sudo useradd nginx -s /sbin/nologin -M
[[email protected] ~]$ id nginx
uid=502(nginx) gid=502(nginx) groups=502(nginx)
[[email protected] ~]$
[[email protected] tools]$ pwd
/yuelinglong/tools
[[email protected] tools]$ ls
get-pip.py  mysql-5.6.27  nginx-1.6.3.tar.gz  tomcat-7.0
[[email protected] tools]$ sudo tar -zxf nginx-1.6.3.tar.gz 
[[email protected] tools]$
[[email protected] tools]$ ls
get-pip.py  mysql-5.6.27  nginx-1.6.3  nginx-1.6.3.tar.gz  tomcat-7.0
[[email protected] tools]$ cd nginx-1.6.3
[[email protected] nginx-1.6.3]$ pwd
/yuelinglong/tools/nginx-1.6.3
[[email protected] nginx-1.6.3]$ 
[[email protected] nginx-1.6.3]$sudo ./configure --prefix=/yuelinglong/app/nginx-1.6.3/ --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
[[email protected] nginx-1.6.3]$sudo make
[[email protected] nginx-1.6.3]$sudo make install
[[email protected] nginx-1.6.3]$echo $?
[[email protected] nginx-1.6.3]$0
[[email protected] nginx-1.6.3]$ sudo ln -s /yuelinglong/app/nginx-1.6.3/ /nginx
[[email protected] ~]$ /nginx/sbin/nginx -V
nginx version: nginx/1.6.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
TLS SNI support enabled
configure arguments: --prefix=/yuelinglong/app/nginx-1.6.3/ --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
[[email protected] ~]$

第三步:启动Nginx服务,

[[email protected] /]$ sudo /nginx/sbin/nginx 
[[email protected] /]$ ps -ef | grep 80
root       807     1  0 Jan07 ?        00:00:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
yueling   7979  1301  0 00:24 pts/2    00:00:00 grep 80
[[email protected] /]$

第四步:浏览器访问测试页面.

我与nginx的初次见面