centos 安装nginx

centos 安装nginx

安装依赖

更换源
yum install http://mirrors.163.com/centos/6.8/extras/x86_64/Packages/epel-release-6-8.noarch.rpm -y
装依赖
yum install -y gd gd-devel libmcrypt libmcrypt-devel libtool-ltdl libtool-ltdl-devel libxml2 libxml2-devel curl curl-devel t1lib t1lib-devel openssl openssl-devel pcre pcre-devel

下载安装

wget http://og4a7z6nl.bkt.clouddn.com/nginx-1.11.5.tar.gz
tar -xf nginx-1.11.5.tar.gz
cd nginx-1.11.5
./configure --prefix=/home/nick/nginx --conf-path=/home/nick/nginx/conf/nginx.conf --pid-path=/home/$boss/nginx/logs/nginx.pid --with-http_ssl_module --with-http_stub_status_module --user=nick--group=nick
make && make install

启动

直接启动
/home/nick/nginx/sbin/nginx -c /home/nick/nginx/conf/nginx.conf
使用supervisor启动
[program:nginx]
command=/home/nick/nginx/sbin/nginx -c /home/nick/nginx/conf/nginx.conf
diretory=/home/nick/nginx
user=root

完成之后

/home/nick/superctl update

centos 安装nginx

上一篇:封装一个方法获取url上面的参数


下一篇:CentOS安装Nginx Pre-Built