1.下载1.18.0版本
http://nginx.org/en/download.html
2.配置环境(进入linux)
<1>yum –y install gcc-c++
<2>yum install -y pcre pcre-devel
<3>yum install -y zlib zlib-devel
<4>yum install -y openssl openssl-devel
3.将tar包放入linux的家目录下
4.解压到/use/local/nginx
tar -zxvf nginx-1.18.0.tar.gz -C /use/local/
5.进入nginx目录下
cd /use/local/nginx-1.18.0
6.加载 configure 文件
./configure
7.退出目录
cd .. 到 local 目录当中
8.执行语句
make && make install
9.进入 sbin 目录下
cd /usr/local/ngnix/sbin
10.在 sbin 目录下输入以下
/usr/local/nginx/sbin/nginx
显示如下成功
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
11.配置安全组
12.开启端口号
firewall-cmd –permanent –add-port=80/tcp
13.开启端口号
firewall-cmd –reload