donglisi8644 2017-01-22 22:45
浏览 170

使用apache虚拟主机使Laravel与多个其他LAMP项目共存

I'm trying to make Laravel coexist with other projects on a local installation under /var/www, the current solution I have is to use an alias for the Laravel directory and several other aliases for the other projects.

For instance:

<VirtualHost *:80>
        Alias /laravel /var/www/laravel/public
        Alias /other_project /var/www/other_project
        <Directory /var/www/other>
                Order allow,deny
                 allow from all
        </Directory>

        DocumentRoot /var/www/laravel/public
        <Directory /var/www/laravel/public>
                AllowOverride All
        </Directory>
</VirtualHost>

the solution above however makes http://localhost and http://localhost/laravel both redirect to Laravel, if I put say an index.php on the root directory of /var/www this is ignored and the Laravel installation is shown instead.

The directory other_project instead works correctly being completely separated from Laravel and showing its contents.

How can I make http://localhost/ show a standard index.php, http://localhost/laravel show a Laravel installation and http://localhost/other_project show another php project??

  • 写回答

1条回答 默认 最新

  • dsiv4041 2017-01-23 04:17
    关注

    Change

    DocumentRoot /var/www/laravel/public
    

    To

    DocumentRoot /var/www
    

    That is if you want to display anything form /var/www

    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制