drfqfuhej48511519 2015-08-05 07:13
浏览 96

如何在Web根目录中托管多个Laravel站点/应用程序

I have 2 Laravel 4 applications.
I want one of them to be served from within a folder that is inside the other's root folder.

For example, let's say Application A is deployed to /var/www/ folder, and I want Application B to be deployed to /var/www/B/.

When just naively putting it there, I get an error NotFoundHttpException from Application A's RouteCollection.php.

Any idea how this can be achieved? Thanks in advance!

  • 写回答

1条回答 默认 最新

  • douye5949 2015-08-05 07:39
    关注

    I supose you're using apache2. There is a file in /etc his name is hosts, you can configure a virtual domain to access diferent directories like:

    127.0.0.1 project1.com 127.0.0.1 project2.com The you have to configure the virtualhost. You have to go to /etc/apache2/sites-avaible and copy the default config file 000-default.conf

    cd /etc/apache2/sites-available sudo cp 000-default.conf 001-laravel1.conf sudo nano 001-laravel1.conf Inside of the edit of the document you only have to change two things:

    • ServerName (you have to put your virtual domain) -> project1.com
    • DocumentRoot (you have to put your directory of your proyect) -> /var/www/A

    And the last thing is create a symbolic link to this archive in the directory /etc/apache2/sites-enabled

    cd /etc/apache2/sites-enabled ln -s 001-laravel1.conf ../sites-available/001-laravel1.conf

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题