【发布时间】:2015-03-28 11:23:57
【问题描述】:
这是我第一次尝试这个,经过一天的尝试,我被卡住了。我对 Ubuntu 没有太多经验,所以也许我错过了一些明显的东西。
我正在尝试将 WP(最新)和 Laravel 5 安装到 Virtual Box 中的 Ubuntu 14.04 安装中。我希望两者并肩工作,因为 WP 将负责网站方面的工作,而网络应用程序将基于 Laravel 5。
结果是 Wordpress 工作正常,但是当我转到 http://domain.com/app 时,我得到一个空白页和臭名昭著的 500 错误:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
我错过了什么。谢谢!
目录结构:
/etc/var/www/public_site - Public web site (WordPress is installed here)
/etc/var/www/ (Laravel 5 installed here)
/etc/var/www/public_site/wp-admin,
wp-content,
wp-includes
app (as Laravel public folder)
在阅读了多个论坛帖子后,这是我所做的:
/public_site/ 中的.htaccess 包含:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/app [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
/public_site/app 中的.htaccess 包含:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /app/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
/etc/apache2/sites-enabled/000-default.conf(同样适用于可用站点)
<VirtualHost *:80>
ServerName 10.0.0.204
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public_site
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
【问题讨论】:
标签: php wordpress apache .htaccess