CentOS 7下安装Nginx

栏目: 服务器 · Nginx · 发布时间: 5年前

内容简介:要添加CentOS 7 EPEL仓库,请打开终端并使用以下命令:现在Nginx存储库已经安装在您的服务器上,使用以下yum命令安装Nginx :Nginx不会自行启动。要运行Nginx,请输入:

第一步 - 添加Nginx存储库

要添加CentOS 7 EPEL仓库,请打开终端并使用以下命令:

sudo yum install epel-release

第二步 - 安装Nginx

现在Nginx存储库已经安装在您的服务器上,使用以下yum命令安装Nginx :

sudo yum install nginx

第三步 - 启动Nginx

Nginx不会自行启动。要运行Nginx,请输入:

sudo systemctl start nginx

如果您正在运行防火墙,请运行以下命令以允许HTTP和HTTPS通信:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

您将会看到默认的CentOS 7 Nginx网页,这是为了提供信息和测试目的。它应该看起来像这样:

如果看到这个页面,那么你的Web服务器现在已经正确安装了。

如果想在系统启动时启用Nginx。请输入以下命令:

sudo systemctl enable nginx

恭喜!Nginx现在已经安装并运行了!


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

An Introduction to Genetic Algorithms

An Introduction to Genetic Algorithms

Melanie Mitchell / MIT Press / 1998-2-6 / USD 45.00

Genetic algorithms have been used in science and engineering as adaptive algorithms for solving practical problems and as computational models of natural evolutionary systems. This brief, accessible i......一起来看看 《An Introduction to Genetic Algorithms》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

html转js在线工具
html转js在线工具

html转js在线工具