安装Nginx
- 将nginx-1.16.1.tar.gz资源上传至服务器/usr/loca目录下
- 解压nginx资源,执行命令
sudo tar -zxvf nginx-1.16.1.tar.gz
- 进入nginx目录
cd nginx-1.16.1/
- 配置
sudo ./configure --prefix=/usr/local/nginx
- 编译
sudo make install
- 检测是否按转成功
cd /usr/local/nginx/sbin/
sudo ./nginx -t
# 输出如下表示安装成功
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
- 启动nginx
sudo ./nginx
访问本地ip的80端口,出现Welcome to nginx!字样表示安装成功。