My setup:
ubuntu 22.04
Apache/2.4.52 (Ubuntu) Server
I created /etc/apache2/sites-available/test.mysite.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName test.xxxxxxxx.com
DocumentRoot /home/test/deploy/current
<Directory /home/test/deploy/current>
AllowOverride all
Options -MultiViews
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/test/error.log
CustomLog ${APACHE_LOG_DIR}/test/access.log combined
</VirtualHost>
I disabled the built-in 000-default.conf as follows:
sudo a2dissite 000-default.conf
And verified that it was no longer in /etc/apache2/sites-enabled
And enabled the virtual host:
sudo a2ensite test.mysite.conf
And verified that it was now in /etc/apache2/sites-enabled
I verified that the configuration is fine:
sudo apache2ctl configtest
And restarted the apache server:
sudo systemctl restart apache2
Here is a list of the permissions
drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-x--- test test test
drwxr-xr-x test test deploy
drwxrwxr-x test test current
-rw-rw-r-- test test index.html
This is hosted on AWS, so I also went to AWS, and verified that the security group's inbound rules, allowing connecting from my home IP address (I have a fixed IP address). I also don't have the firewall enabled on the server.
But when I do http://test.xxxxxxxx.com
I get the following message in my browser:
Forbidden
You don't have permission to access this resource.
Apache/2.4.52 (Ubuntu) Server at test.xxxxxxxx.com Port 80
Any ideas?