首页 > 代码库 > centos7 安装 nginx

centos7 安装 nginx

参考:

https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

1.配置源,我这里是centos7,不同的系统版本请自行更改

[root@guo elk]# touch /etc/yum.repos.d/nginx.repo
[root@guo elk]# cat >>/etc/yum.repos.d/nginx.repo <<!
> [nginx]
> name=nginx repo
> baseurl=http://nginx.org/packages/centos/7/x86_64
> gpgcheck=0
> enabled=1
> !

 

2.安装,我这里一起安装了  nginx httpd-tools

yum install nginx httpd-tools -y

3.启动

systemctl start nginx.service

技术分享

4.配置

vi /etc/nginx/nginx.conf 

 

centos7 安装 nginx