在同一台服务器Laravel 5和Word preSS 4.1.1 [英] Laravel 5 and Wordpress 4.1.1 in the same server

查看:101
本文介绍了在同一台服务器Laravel 5和Word preSS 4.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次尝试这一点,尝试了一天后,我坚持。我没有很多Ubuntu的经验,所以也许我错过了一些东西明显。

我试图安装WP(最新的),并Laravel 5到一个Ubuntu 14.04安装在虚拟盒。我想既要携手并肩,因为WP会照顾事情的网站端和Web应用程序将基于Laravel 5.

结果字preSS工程确定,但是当我去 http://domain.com/app <​​/ code>我得到了一个空白页面和臭名昭著的500错误

 无法加载资源:与500(内部服务器错误)状态的服务器响应
 

有什么我错过了。谢谢!

的目录结构:

 的/ etc /无功/网络/ public_site  - 公共网站(字preSS此处安装)

在/ etc /无功/网络/(Laravel 5安装在这里)

在/ etc /无功/网络/ public_site /可湿性粉剂管理员,
                         可湿性粉剂内容,
                         WP-包括
                         应用程序(如Laravel公用文件夹)
 

读取多个论坛的帖子后,这是我做了什么:

的.htaccess中/ public_site /载:

 #BEGIN字preSS
&LT; IfModule mod_rewrite.c&GT;
RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{REQUEST_URI}!^ /应用程序[NC]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
&LT; / IfModule&GT;
#结束字preSS
 

的.htaccess中/ public_site /应用程序包含:

 &LT; IfModule mod_rewrite.c&GT;
RewriteEngine叙述上
的RewriteBase / APP /
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$的index.php / $ 1 [L]
&LT; / IfModule&GT;
 

/etc/apache2/sites-enabled/000-default.conf(和相同的站点可用)

 &LT;虚拟主机*:80&GT;
        服务器名10.0.0.204
        的ServerAdmin网站管理员@本地
        的DocumentRoot的/ var / WWW / public_site

        &LT;目录/ var / WWW /&GT;
                选择了FollowSymLinks指标多视图
                设置AllowOverride所有
                订购允许,拒绝
                允许所有
        &LT; /目录&GT;

        错误日志$ {APACHE_LOG_DIR} /error.log
        的CustomLog $ {APACHE_LOG_DIR} /access.log组合
&LT; /虚拟主机&GT;
 

解决方案

我认为最好的解决办法是安装他们在一个单独的文件夹。

例如:

  /等的/ var /字preSS
 

  /等的/ var / laravel
 

然后,主域名将指向 /等的/ var /字preSS 你可以创建一个子域名都将指向laravel,例如:

  domain.com  - &GT;在/ etc /无功/字preSS
app.domain.com  - &GT;在/ etc /无功/ laravel
 

我觉得你不应该在同一个文件夹中安装它们,这将使mainteinance噩梦

this is the first time I try this and after a day of trying I am stuck. I do not have a lot of experience with Ubuntu so perhaps I missed something obvious.

I am trying to install WP (latest) and Laravel 5 on to an Ubuntu 14.04 installation in Virtual Box. I want both to work side by side since WP will take care of the web site side of things and the web app will be based on Laravel 5.

The result is Wordpress works OK but when I go to http://domain.com/app I get a blank page and the infamous 500 error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

What have I missed. Thanks!

The directory structure:

/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)

After reading multiple forum posts, this is what I have done:

.htaccess in /public_site/ contains:

# 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

.htaccess in /public_site/app contains:

<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 (and same for sites-available)

<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>

解决方案

I think the best solution is to install them in a separate folder.

E.g.:

/etc/var/wordpress

and

/etc/var/laravel

Then, the main domain will point to /etc/var/wordpress and you can create a subdomain that will point to laravel, e.g.:

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

I think you should not install them in the same folder, that will make the mainteinance a nightmare

这篇关于在同一台服务器Laravel 5和Word preSS 4.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆