1、安装依赖:
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2、创建一个文件夹,上传本地提供的nginx包
tar -zxvf nginx-1.13.7.tar.gz
3、//执行命令
./configure
make
make install
4、默认安装路径:
/usr/local/nginx
5、访问配置
cd /usr/local/nginx/sbin
./nginx
6、防火墙开放端口
7、设置永久关闭防火墙:
systemctl stop firewalld 先关闭本次的防火墙
systemctl disable firewalld 再设置每次启动时自动关闭防火墙
systemctl status firewalld 查看防火墙的状态
systemctl stop firewalld 关闭防火墙
systemctl restart firewalld重启防火墙
systemctl start firewalld 启动防火墙
本文详细介绍了如何通过命令行在Linux环境下安装Nginx。包括安装必要的依赖软件、上传并解压Nginx源文件、配置及编译安装Nginx、设置防火墙等步骤。
491

被折叠的 条评论
为什么被折叠?



