美文网首页
Linux下centos安装nginx及配置

Linux下centos安装nginx及配置

作者: 蛋狗2018 | 来源:发表于2021-07-28 16:40 被阅读0次

1、linux下centos安装nginx:

yum安装Nginx基本操作

安装:yum install nginx

启动:service nginx start

停止:service nginx stop

重载:service nginx reload

2、配置文件地址:/etc/nginx/nginx.conf

从配置文件中看到nginx默认加载/etc/nginx/conf.d/下面的模块文件。如果我们需要配置域名的话,就在这个目下添加配置文件就好了。

3、配置域名

在步骤2下面的目录里新建baidu.test.conf:vim /etc/nginx/conf.d/baidu.test.conf

图里配置了2个域名,并且根目录是/data/www

4、技术交流可联系我qq1549777642

相关文章

网友评论

      本文标题:Linux下centos安装nginx及配置

      本文链接:https://www.haomeiwen.com/subject/wvczmltx.html