阿帕奇000默认的虚拟主机 [英] apache 000-default virtual host

查看:177
本文介绍了阿帕奇000默认的虚拟主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有000默认虚拟主机和我离开它。我创建了一个新的文件和链接mysite.com和它的作品,但不知道如何我想它。我想知道,或者没有人知道我是否需要删除,如果我不应该删除000默认的VH?

出于某种原因,如果去 http://mysite.com 它带我到000默认网站,但如果我去 http://www.mysite.com 它带我到正确的位置。为什么有区别吗?

这是mysite.com VH文件:

  #NameVirtualHost *
<虚拟主机*:80>
        的ServerAdmin nick@mysite.com
        服务器名mysite.com
        ServerAlias​​ www.mysite.com * .mysite.com
        DocumentRoot的/home/nick/www/mysite.com        错误日志/var/log/apache2/mysite.com/error.log        #可能的值包括:调试,信息,通知,警告,错误,暴击,
        #警报,EMERG。
        LogLevel的信息        的CustomLog /var/log/apache2/mysite.com/access.log常见
        ServerSignature在< /虚拟主机>


解决方案

配置那样,没有必要为默认VH。
现在,为什么mysite.com带您到默认?这是一个很好的问题,如果你的配置是完全一样的复制完,在重新启动服务器,那么它不应该。

I see that there's the 000-default virtual host and I left it. I created a new file and link for mysite.com and it works, but not how I want it to. I'm wondering, does anyone know if I need to delete or if I shouldn't delete the 000-default vh?

For some reason if to go to http://mysite.com it takes me to the 000-default site, but if I go to http://www.mysite.com it takes me to the correct place. Why is there a difference?

This is mysite.com vh file:

#NameVirtualHost *
<VirtualHost *:80>
        ServerAdmin nick@mysite.com
        ServerName mysite.com
        ServerAlias www.mysite.com *.mysite.com
        DocumentRoot /home/nick/www/mysite.com

        ErrorLog /var/log/apache2/mysite.com/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel info

        CustomLog /var/log/apache2/mysite.com/access.log common
        ServerSignature On

</VirtualHost>

解决方案

Configured like that, there is no need for default VH. Now, why mysite.com takes you to default? That's a good question, if your configuration is exactly as you've copied, you have restarted the server, then it shouldn't.

这篇关于阿帕奇000默认的虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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