首页 > 其他 > 详细

nginx部署

时间:2020-05-12 21:40:42      阅读:58      评论:0      收藏:0      [点我收藏+]

在linux下安装需要安装一下组件

gcc && g++

yum install gcc-c++

pcre

yum install -y pcre pcre-devel

zlib

yum install -y zlib zlib-devel

openssl

yum install -y openssl openssl-devel

安装

解压nginx文件

cd data/sa/public
tar -zxvf nginx-1.16.1.tar.gz

安装

  • 创建一个nginx安装目录
    mkdir nginx
    cd nginx-1.16.1
  • 指定文件安装路径
    ./configure --prefix=/data/sa/public/nginx
    make
    make install
  • 安装完成后内容会安装到指定的路径 /data/sa/public/nginx下,否则会在默认目录/usr/local/nginx

启动nginx

  • 修改配置文件
    cd /data/sa/public/nginx/conf

替换已经修改好的

进入到启动目录

cd /data/sa/public/nginx/sbin

检查配置文件是否有问题

./nginx -t

没有问题的结果如下所示:

$ ./nginx -t
nginx: the configuration file xxxx/nginx.conf syntax is ok
nginx: configuration file xxxx/nginx.conf test is successful

查询配置参数

./nginx -V

对于已安装的nginx需要修改配置参数

./configure --prefix=/data/sa/public/nginx ...配置参数
make
make install
然后重新启动nginx即可

启动

./nginx

停止

./nginx -s stop

重启

./nginx -s reload

输入网址验证是否启动成功

http://ip:port/

nginx部署

原文:https://www.cnblogs.com/bluekang/p/12878347.html

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