nginx安装
2020-09-29 本文已影响0人
菠了个萝
参考文档:https://www.cnblogs.com/cl-rr/p/11447231.html
一、获取安装包:
wget https://nginx.org/download/nginx-1.14.2.tar.gz
二、解压缩
tar -zxvf nginx-1.14.2.tar.gz
三、配置安装地址
cd nginx-1.14.2
./configure --prefix=/usr/local/nginx-1.14.2
四、编译
make
五、安装
make install
六、启动
cd /usr/local/nginx-1.14.2/sbin
./nginx
启动完查看nginx情况:ps aux|grep nginx
最后,可以在服务器上命令 curl 服务器地址+nginx端口号

或者,浏览器上输入你的 服务器地址 + nginx端口

备注:
1、默认是80端口,可修改配置调整端口 vim /usr/local/nginx-1.14.2/conf/nginx.conf

2、如果用的是阿里云服务器,没有配置安全组添加对外的端口设置的需要添加安全组规则
