美文网首页
Linux下源码安装Nginx

Linux下源码安装Nginx

作者: hbh404 | 来源:发表于2016-12-04 18:03 被阅读0次

1.yum下载安装gcc、zip、openssl、openssl--devel、pcre

yum install -y gcc zip openssl openssl--devel pcre

2.下载安装nginx

下载地址:http://nginx.org/download/

./configure --sbin-path=/usr/local/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--with-http_ssl_module\ #开启ssl模块
--with-http_stub_status_module \#启用监控nginx的当前状态
--user=nginx

make && make install

启动服务

/usr/local/nginx/nginx -c /usr/local/nginx/nginx.conf

停止服务

kill -9 pid

打开nginx.conf
修改

server {
    server_name xxxx;#域名
}

重启命令

/usr/local/nginx/nginx -s reload

2016/12/4 18:12:07

相关文章

网友评论

      本文标题:Linux下源码安装Nginx

      本文链接:https://www.haomeiwen.com/subject/wqihmttx.html