jeudi 24 septembre 2020

Virtual hist with port number not working

I'm using ec2 linux Instance for hosting a laravel app. I'm using apache 2.4.i'm trying to setup 2 app with different domain on the same instance. I have tried almost everyting but it doesn't seem to be working

I created hosts.conf file under /etc/httpd/conf.d/

If I use this as content :

DocumentRoot "/var/www/html/site1/public/"
<Directory "/var/www/html/site1/public">
        AllowOverride All
        Require all granted
</Directory>

It works perfectly

but if I change it to

<VirtualHost *:80>
    ServerName site1.com
    ServerAlias www.site1.com *.site1.com
    DocumentRoot "/var/www/html/site1/public"
    DirectoryIndex index.php
        <Directory "/var/www/html/site1/public">
            AllowOverride All
            Require all granted
        </Directory>
</VirtualHost>

It starts to display the folderenter image description here view of the /var/www/html/ directory



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire