【发布时间】:2014-06-24 16:16:38
【问题描述】:
我确实有以下问题。我已经将一些具有相同层次结构和网站结构的网站移到了带有 Apache 2.4.7 的新服务器上。旧的有 2.2.22。 我已将默认 DocumentRoot 更改为 /var/www
为了进行测试,我在那里创建了一个 index.html 文件,其中包含一个点作为内容。现在我在 /sites-enabled/ 中确实有一个包含以下内容的文件:
<VirtualHost *:80>
ServerAdmin webmaster@test-w2.de
DocumentRoot /var/www/w2/shop2/website/magento
ServerName test-w2.de
ErrorLog /var/www/_logs/w2-error.log
<Directory /var/www/w2/shop2/website/magento>
php_admin_flag safe_mode Off
php_admin_value memory_limit 512M
php_admin_value max_execution_time 600
php_admin_value upload_max_filesize 128M
php_admin_value open_basedir /var/www/w2/shop2/website/magento:/usr/:/tmp
Options -Indexes +FollowSymLinks +Includes
AllowOverride All
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
这是我的旧 2.2.22 Apache 上的工作配置。现在,当我尝试访问域时,它会抛出带有点的 html 文件!如果我尝试 test-w2.de/w2/shop2/website/magento 它会转到正确的目录,但显然效果不佳;)
所以它完全忽略了 DocumentRoot。这里有什么问题? error.log 什么也没说,access.log 显然说它服务于 /var/www 的 index.html。并且没有像我重新启动apache时那样的配置错误。
我还删除了 sites-enabled/000-default.conf。内容被移到 apache2.conf 中,上面写着:
...
<Directory /var/www/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Require all granted
</Directory>
当然是在加载站点启用/* 的内容之前。
【问题讨论】:
标签: ubuntu directory apache2 virtualhost document-root