1
votes

So, I've tried running a domain, a sub domain and another domain on one machine. I've set up a conf file for every site:

<VirtualHost *:80>
        ServerName websitea.com
        ServerAlias www.websitea.com
        DocumentRoot /var/www/html/weba
</VirtualHost>

<Directory /var/www/html/weba>
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

The same folder config can be found in apache2.conf as well (I tried experimenting with it) and it's the same config across all sites.

The issue is that after putting this DocumentRoot and disabling 000-default.conf I get 403 forbidden.

What I've tried doing so far:

  • Changing owner to www-data:www-data
  • Changing perms to 755/777
  • Putting the directory configurations in
  • apache2.conf or the website's conf putting all sites in 1 file
  • all kinds of directory settings (Options Indexes FollowSymLinks, AllowOverride none/all, Require all granted, Allow from all, Order Allow,Deny)

but none would work...

EDIT: I found out that the website goes to /www/var/html/ even though the domain is set to get to /www/var/html/weba, DocumentRoot pretty much does nothing in the configurations.

1

1 Answers

0
votes

It seems you created a new virtual host configuration file on this path /etc/apache2/sites-available/

you need to enable the website virtual host conf file, for example, id website virtual host conf file name is 'websitea.conf' then you need run below command

sudo a2ensite websitea.conf