dongtong2021 2016-06-02 14:13 采纳率: 0%
浏览 94
已采纳

CentOS 7 + Laravel中的虚拟主机

I have problems with my VirtualHosts

The Directory of the website is /var/www/html/laravel The httpd.conf file is

enter image description here

When open the website show me this error: enter image description here

Somebody can help me? Thanks

  • 写回答

1条回答 默认 最新

  • dongzhi4470 2016-06-02 17:03
    关注

    I found a Solution!

    I have many sites in /var/www/html folder. www.example.com/site1 www.example.com/site2 ...

    The solution is create one alias for each site in httpd.conf. example:

    Alias /site1 /var/www/html/site1
    <VirtualHost *:80>
        DocumentRoot "/var/www/html/site1"
    </VirtualHost>
    
    Alias /laravel /var/www/html/laravel/public
    <VirtualHost *:80>
           DocumentRoot /var/www/html/laravel/public
    
           <Directory /var/www/html/laravel>
                  AllowOverride All
           </Directory>
    </VirtualHost>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!