nginx 缺少站点可用目录 [英] nginx missing sites-available directory

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

问题描述

我在 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.

推荐答案

嗯,我认为 nginx 本身并没有在它的设置中包含这些,因为 Ubuntu 维护的软件包将它作为模仿 Debian 的 apache 设置的惯例.如果您想模拟相同的设置,您可以自己创建它.

Well, I think nginx by itself doesn't have that in its setup, because the Ubuntu-maintained package does it as a convention to imitate Debian's apache setup. You could create it yourself if you wanted to emulate the same setup.

创建 /etc/nginx/sites-available/etc/nginx/sites-enabled 然后编辑 http 里面的 块code>/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 you'd create a symlink for them inside sites-enabled for those you want enabled.

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

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