依赖包安装:
安装gcc gcc-c++:
yum -y install gcc gcc-c++ autoconf automake
安装pcre:
yum -y install pcre pcre-devel
安装zlib:
yum -y install zlib zlib-devel
下载安装:
官网下载地址:http://nginx.org/en/download.html 下载并上传到服务器或者
直接在服务器上执行以下命令下载:
cd /usr/local/src
wget -chttp://nginx.org/download/nginx-1.14.1.tar.gz
解压:
tar zxvf nginx-1.14.1.tar.gz
进入安装包目录:
cd nginx-1.14.1
安装:
./configure
make
make install
启动与访问:
启动:
/usr/local/nginx/sbin/nginx
关闭防火墙:
service iptables stop
访问:
localhost
Nginx 常用的几个命令:
/usr/local/nginx/sbin/nginx-s reload# 重新载入配置文件
/usr/local/nginx/sbin/nginx-s reopen# 重启 Nginx
/usr/local/nginx/sbin/nginx-s stop# 停止 Nginx
https://www.yiibai.com/nginx/nginx-install.html
http://www.runoob.com/linux/nginx-install-setup.html
参考视频:
https://www.jikexueyuan.com/course/1470.html