【Centos】Centos 7.6 安装 Nginx 1.24.0

1  前言

前端包一般都是打包好后,放置在Nginx里,这节我们就来安装下。

http://nginx.org/en/download.html

2  安装步骤

2.1  下载压缩包

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

2.2  解压

tar -zxvf nginx-1.24.0.tar.gz

2.3  安装

先配置,然后使用make和make install进行安装

# 先安装依赖
yum install gcc gcc-c++
# 配置路径
./configure --prefix=/usr/local/nginx
# 安装
make
make install

2.4  配置环境变量

vi /etc/profile
export PATH=$PATH:/usr/local/nginx/sbin/nginx
source /etc/profile

2.5  启动测试

# 启动
nginx
# 启动并指定配置
nginx -c /usr/loval/nginx/conf/nginx.conf
# 停止
nginx -s stop
# 加载配置
nginx -s reload

3  小结

ok,完事。

posted @ 2024-01-01 16:40  酷酷-  阅读(136)  评论(0编辑  收藏  举报