I have read many posts on the subject but none refers to exactly the same environment I have (macOS Monterey). So what I have done so far...
I have successfully installed the latest versions of Docker & LaraDock with Apache2. I have phpMyAdmin working fine at localhost:8081. Then I followed the docs and some tutorial to set up LaraDock for multiproject.
I successfuly created a laravel9 project (ProjectA) inside the workspace container. I can view the website in the browser at
I want to create a virtual host for ProjectA to be able to type projectA.test in the browser and point to
So again, I followed the instructions on LaraDock and edited the
<VirtualHost *:80> ServerName laradock.test DocumentRoot /var/www/ Options Indexes FollowSymLinks <Directory "/Users/Sites"> AllowOverride All <IfVersion < 2.4> Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion> </Directory> ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined </VirtualHost>
and created a
<VirtualHost *:80> ServerName projectA.test DocumentRoot /var/www/projectA/public Options Indexes FollowSymLinks <Directory "/var/www/projectA/public"> AllowOverride All <IfVersion < 2.4> Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion> </Directory> </VirtualHost>
Even after restarting Apache2 in Docker, projectA.test does not display the correct website but point to the root.
In the folder apache2 there is a file called vhost.conf with
Include /etc/apache2/sites-available/*.conf. When I copied the 2 conf files above into that folder (which was not there before), I get a
Forbidden error : You don't have permission to access this resource. Apache/2.4.29 (Ubuntu) Server at utopia.test Port 80.
After reading an article on Apache error 403, I change the permission on the public folder to be:
sudo chmod -R 775 public sudo chown -R _www:_www public drwxrwxr-x@ 15 _www _www 480 Mar 19 18:11 public
I would really appreciate if someone could help please.