Laravel 5和Wordpress 4.1.1在同一服务器中


Laravel 5 and Wordpress 4.1.1 in the same server

这是我第一次尝试,经过一天的尝试,我被卡住了。我对Ubuntu没有太多的经验,所以也许我错过了一些显而易见的东西。

我正在尝试将WP(最新)和Laravel 5安装到虚拟盒子中的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/contents:中的.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>

我认为最好的解决方案是将它们安装在一个单独的文件夹中。

例如:

/etc/var/wordpress

/etc/var/laravel

然后,主域将指向/etc/var/wordpress你可以创建一个指向laravel的子域,例如:

domain.com      --> /etc/var/wordpress
app.domain.com  --> /etc/var/laravel

我认为您不应该将它们安装在同一个文件夹中,这将使维护成为的噩梦