2

I have an ubuntu 22.04 webserver on which i have configured php, mariadb, apache2 stack. I then deployed a laravel project, which works fine, under the path. /var/www/html/site1.it

So now I created a project under the path /var/www/html/site2.it and re-executed the same steps done for site1. So I created the site2.conf, entered the configuration and restarted apache2. On my mac in the hosts file I then set the IP <-> site pair to reach the site via domain. However, when I type the url http://site2.it on the browser, I call site1.it

Do you have any suggestions or advice?

EDIT: Steps to configure Apache2 site

I've followed this tutorial: Deploy Laravel on Apache server

  • apache site1.conf file:
<VirtualHost *:80>
    ServerAdmin site1@localhost
    ServerName site1
    ServerAlias site1.it
    DocumentRoot /var/www/html/site1.it/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =site1.it [OR]
    RewriteCond %{SERVER_NAME} =site1
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
#<VirtualHost *:443>
 #    DocumentRoot /var/www/html/site1.it/public
 #    ServerName site1
 #    ServerAlias www.site1.it
 #    SSLEngine on
 #    SSLCertificateFile /home/
 #    SSLCertificateKeyFile /home
 #
 #    <Directory /var/www/html/site1.it/public>
 #        Order allow,deny
 #        AllowOverride All
 #        Allow from all
 #    </Directory>
#</VirtualHost>
64Bit1990
  • 302
  • 2
  • 16

0 Answers0