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

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
    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>
    
    点赞 评论

相关推荐