Virtual Hosts in CentOS 7 + Laravel

雨燕双飞 提交于 2019-12-12 00:46:27

问题


I have problems with my VirtualHosts

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

When open the website show me this error:

Somebody can help me? Thanks


回答1:


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>


来源:https://stackoverflow.com/questions/37594407/virtual-hosts-in-centos-7-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!