美文网首页
Nginx安装

Nginx安装

作者: F7bonacci | 来源:发表于2018-10-31 11:06 被阅读0次

环境:CentOS Linux release 7.5.1804 (Core)
安装步骤
1.安装编译环境和依赖库

yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel

2.下载nginx安装包

wget http://nginx.org/download/nginx-1.14.0.tar.gz

3.编译安装,默认安装路径(/usr/local/nginx)

tar zxvf nginx-1.14.0.tar.gz
./configure
cd nginx-1.14.0
./configure
make
sudo make install

基本命令

./nginx    #启动nginx
./nginx -v   #查看版本
./nginx -s reload  #重新加载配置文件
./nginx -t   #检查配置文件
./nginx -s stop  #停止

防火墙开启http(centos7默认防火墙禁用http)

[root@localhost sbin]# firewall-cmd --zone=public --permanent --add-service=http
success
[root@localhost sbin]# firewall-cmd --reload
success

相关文章

网友评论

      本文标题:Nginx安装

      本文链接:https://www.haomeiwen.com/subject/mqgotqtx.html