centOS7.6安装Nginx

# centOS7.6下安装nginx
cd /

yum install gcc gcc-c++ # 安装依赖
wget http://nginx.org/download/nginx-1.17.1.tar.gz # 下载nginx源码

tar -zxvf nginx-1.17.1.tar.gz # 解压
cd nginx
-1.17.1 # 进入解压后的文件夹

./configure --prefix=/usr/local/nginx # 配置nginx安装路径
make make install

ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx # 创建nginx软链接,若已被占用,则在 /usr/bin 下 rm-rf nginx

nginx # 启动ngixn
nginx -s stop # 停止nginx服务

 

posted @ 2019-11-08 10:51  cooper_wang  阅读(4150)  评论(0编辑  收藏  举报