a2ensite 的站点不存在错误 [英] Site does not exist error for a2ensite

查看:21
本文介绍了a2ensite 的站点不存在错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 /etc/apache2/sites-available 下有 cmsplus.dev 和以下代码,

I have cmsplus.dev under /etc/apache2/sites-available with the following code,

<VirtualHost *:80>
    ServerAdmin master@server.com
    ServerName www.cmsplus.dev
    ServerAlias cmsplus.dev

    DocumentRoot /var/www/cmsplus.dev/public

    LogLevel warn
    ErrorLog /var/www/cmsplus.dev/log/error.log
    CustomLog /var/www/cmsplus.dev/log/access.log combined
</VirtualHost>

现在当我使用 sudo/usr/sbin/a2ensite cmsplus.dev 时,出现错误,

Now when I use sudo /usr/sbin/a2ensite cmsplus.dev, I am getting the error,

ERROR: Site cmsplus.dev does not exist!

我的网络服务器 Apache/2.4.6 (Ubuntu)

如何解决这个问题?

推荐答案

通过在站点配置文件中添加 .conf 扩展名解决了该问题.

Solved the issue by adding .conf extension to site configuration files.

Apache a2ensite 结果:

Apache a2ensite results in:

错误!网站不存在

问题;如果您在尝试启用网站时发现错误:

Problem; If you found the error while trying to enable a site using:

sudo a2ensite example.com

但它返回:

错误:example.com 不存在

Error: example.com does not exist

a2ensite 只是一个 Perl 脚本,仅适用于以 .conf 结尾的文件名

a2ensite is simply a Perl script that only works with filenames ending .conf

因此,我必须将 example.com 的设置文件重命名为 example.com.conf,如下所示:

Therefore, I have to rename my setting file for example.com to example.com.conf as might be achieved as follows:

mv /etc/apache2/sites-available/example.com /etc/apache2/sites-available/example.com.conf

成功

这篇关于a2ensite 的站点不存在错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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