Nginx安装

环境: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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容