首页 > 其他 > 详细

nginx的源码安装部署

时间:2019-04-30 11:45:31      阅读:138      评论:0      收藏:0      [点我收藏+]
Nginx安装:源码安装

  1. 添加普通用户账号来运行nginx:
    useradd nginx -M -r -s /sbin/nologin

  2. 安装依赖包
    yum install -y gcc pcre-devel openssl-devel

  3. 解压并安装Nginx:
    wget http://nginx.org/download/nginx-1.10.3.tar.gz
    tar xvf nginx-1.10.3.tar.gz
    cd nginx-1.10.3
    ./configure --user=nginx \
    --group=nginx \
    --prefix=/usr/local/nginx \
    --with-http_stub_status_module \
    --with-http_ssl_module \
    --with-http_gzip_static_module

make && make install

4.创建软链接文件
ln -s /usr/local/nginx/sbin/nginx /sbin/nginx

5.启动:
检测配置文件语法 nginx -t
启动nginx服务 nginx

6.查看启动状态:
ps aux | grep nginx
root 8416 0.0 0.1 5760 660 ? Ss 23:29 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nginx 8417 0.0 0.1 5904 992 ? S 23:29 0:00 nginx: worker process

netstat -ntlp | grep 80
tcp        0      0 0.0.0.0:80    0.0.0.0:*         listen      8416/nginx.conf

这样我们的nginx源码安装就完成了

nginx的源码安装部署

原文:https://blog.51cto.com/14268436/2386838

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!