nginx部署

在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/

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

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    nginx部署

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/348085

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月2日 上午4:52
下一篇 2023年3月2日 上午4:53

相关推荐