Apache2 Ubuntu: sudo a2ensite

  apache2, laravel

I’m new to VPS, I’ve set up an Apache2 on a ubuntu-focal-20-x86_64 and trying to host a site based on Laravel.

Everything seems to be set, but when accessing the IP I get an error.

I created a new Virtual host, followed these commands:

sudo mv example /var/www/html/
sudo chgrp -R www-data /var/www/html/example/
sudo chmod -R 775 /var/www/html/example/storage
cd /etc/apache2/sites-available
sudo nano example.conf

I also restarted the server.

Virtual host, [IP] = my servers ip without HTTP:// Example: 127.0.0.1

   <VirtualHost *:80>
   ServerName [IP]
   ServerAdmin [email protected][IP]
   DocumentRoot /var/www/html/example/public

   <Directory /var/www/html/example>
       AllowOverride All
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

When not using the Virtual host I connect to the Apache landingpage, PHP works.

What am I missing?

Source: Laravel

Leave a Reply