nginx缺少sites-available目录 [英] nginx missing sites-available directory

查看:5256
本文介绍了nginx缺少sites-available目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Centos 6上安装了Nginx,我正在尝试设置虚拟主机。我遇到的问题是,我似乎找不到 / etc / nginx / sites-available 目录。

I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory.

为了创建它,我需要做些什么?我知道Nginx正在运行,因为我可以浏览到它。

Is there something I need to do in order to create it? I know Nginx is up and running because I can browse to it.

推荐答案

在它的设置,但Ubuntu维护包做它作为一个约定模仿apache设置,你可以创建它你自己,如果你想要的。

Well I think nginx by it self doesn't have that in it's setup, but the Ubuntu maintained package does it as a convention to imitate apache setup, you can create it your self if you want.

创建 / etc / nginx / sites-enabled ,然后编辑 http 阻止在 /etc/nginx/nginx.conf 内并添加此行

Create /etc/nginx/sites-available and /etc/nginx/sites-enabled and then edit the http block inside /etc/nginx/nginx.conf and add this line

include /etc/nginx/sites-enabled/*;

当然所有文件都位于 sites-available ,然后在 sites-enabled

of course all the files will be inside sites-available and then you create a symlink for them inside sites-enabled

这篇关于nginx缺少sites-available目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆