银河麒麟离线安装nginx
作者:佚名
来源:网络
点击数: 次
发布时间:2022年02月09日
1、下载安装包
下载地址:http://nginx.org/download/
2、使用xftp工具将安装包上传到服务器
3、解压安装包到指定目录
tar -zxvf nginx-1.19.10.tar.gz -C /usr/local/src/nginx
4、编译至指定路径
./configure --prefix=/usr/local/nginx
5、安装
make && make install
6、启动服务,查看服务状态
systemctl start nginx
systemctl status nginx
常用命令:
启动 Nginx systemctl start nginx
停止 Nginx systemctl stop nginx
重启 Nginx systemctl restart nginx
修改 Nginx 配置后,重新加载 systemctl reload nginx
设置开机启动Nginx systemctl enable nginx
关闭开机启动Nginx systemctl disable nginx
通过运行以下命令,来检查 Nginx 的运行状态:
systemctl status nginx
7、防火墙开通80端口
firewall-cmd --permanent --add-port=80/tcp