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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错
  • ¥15 webapi 发布到iis后无法访问