1.先解决nginx的依赖关系:
yum install -y pcre-devel openssl-devel
2.安装wget:sudo yum -y install wget
3.下载nginx的安装包:wget http://nginx.org/download/nginx-1.10.3.tar.gz
4.解压nginx文件包:tar xf nginx-1.10.3.tar.gz
5.创建一个管理账号(zheng):useradd -M -s /sbin/nologin zheng
6.编译安装nginx(三步骤):
./configure \\
--prefix=/usr/local/nginx \\
--user=zheng\\
--group=zheng \\
--with-http_ssl_module \\
--with-http_stub_status_module
make make install
7.创建一条软链接:ln -s /root/nginx-1.10.3 /usr/local/nginx
8.精简化nginx.conf主配置文件内容,缩写Nginx配置文件:egrep -v "#|^$" nginx.conf.default >nginx.conf
9.启动Nginx: /usr/local/nginx/sbin/nginx
10.查看进程,看看Nginx是否启动了: ps aux |grep nginx