This is my solution for apache2 on Ubuntu 20.4
I assume you already did the Steps from phwt & Taras. These are still necessary.
You need to change:
ServerName to your IP Address or Domain
DocumentRoot to the Path to your public Laravel directory
RewriteCond %{SERVER_NAME} = to your IP Address or Domain
File: /etc/apache2/sites-available/laravel.conf
<VirtualHost *:80>
ServerName www.mylaravelproject.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/laravel/public/
<Directory /var/www/laravel/public/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mylaravelproject.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
After Saving this run:
sudo a2ensite laravel.conf
sudo systemctl restart apache2
(Optional, but recommended) If you want to use an SSL Cert do:
sudo certbot
and follow the instructions
storage/logsto figure out the error message which could help finding the solution and/or help us help you.