【问题标题】:Apache2 Virtualhost going to default DocRootApache2 Virtualhost 将使用默认 DocRoot
【发布时间】:2014-04-14 13:00:19
【问题描述】:

我在我的 ubuntu 服务器 12 apache2 上设置虚拟主机时遇到问题。当我尝试访问stemitest.com 时,apache 会指向000-default.conf (/var/www/) 中的DocumentRoot。我做错了什么?

cat /etc/apache2/sites-available/000-default.conf 

ServerAdmin webmaster@localhost
DocumentRoot /var/www/

cat /etc/apache2/sites-available/stemitest.com.conf 


<virtualhost *:80>

  ServerAdmin donotreply@epbfi.com
  ServerName  www.stemitest.com
  ServerAlias stemitest.com


  DirectoryIndex index.html
  DocumentRoot /var/www/stemitest.com


  LogLevel warn
  ErrorLog  /var/apachelogs/error.log
  CustomLog /var/apachelogs/access.log combined

</virtualhost>

cat /etc/apache2/apache2.conf
    ...
    Include /etc/apache2/sites-enabled/
    NameVirtualHost *:80
    <ifmodule mod_ssl.c>
        NameVirtualHost *:443
    </ifmodule>

【问题讨论】:

    标签: html redirect apache2 virtualhost


    【解决方案1】:

    我想我解决了这个问题,有点。 Apache 没有遵循启用站点的 simlink。将我的 stemtest.com.conf 复制到启用站点后,一切正常。不过,这似乎是一个黑客行为。任何人都知道为什么 apache 有这种行为?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-21
      • 2015-06-04
      • 2015-11-26
      • 2021-05-06
      • 2014-08-18
      • 2013-07-29
      相关资源
      最近更新 更多