【发布时间】:2014-07-20 13:49:52
【问题描述】:
尝试了几天来配置 Apache 以在全新的 Ubuntu 安装上运行 wordpress。 设置如下: - 我有一个包含两个子域的域 1-silex.mydomain.com 2- wp.mydomain.com - 在 apache 中,我必须让虚拟主机都使用端口 80,但使用 ServerName 来区分站点。 - silex.mydomain.com 适用于基于 silex php 的网站。 - wp.mydomain.com 总是给出 403 You don't have permission to access / on this server.
这里两个站点的配置文件几乎相同,只是服务器名、文档根目录等不同。其他一切都是一样的。这是silex.conf文件 顺便说一下,重写模式是打开的,为了测试,我给了整个 wordpress 目录的“myuser:www-data”所有权770权限,默认情况下没有.htaccess,我没有添加任何。
<VirtualHost *:80>
ServerAdmin webmaster@mydomain.com
DocumentRoot /opt/test/wordpress
ServerName wp.mydomain.com
<Directory /opt/test/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
FallbackResource /index.php
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
【问题讨论】:
-
AllowOverride 我也试过了,但没有帮助。
标签: wordpress apache .htaccess mod-rewrite ubuntu-13.10