: Domain not accessing correct files in apache2 virtual hosts I have 3 domains hosted on my Ubuntu server running apache2 as DNS I am using cloudflare.com abc.com and xyz.com are accessing correct
I have 3 domains hosted on my Ubuntu server running apache2 as DNS I am using cloudflare.com abc.com and xyz.com are accessing correct files that are inside abc.com/public_html and xyz.com/public_html folder but the third domain is accessing files from the root folder. Following is the content of my domain.com file which is found under /etc/apache2/sites-available/domain.com
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
ServerName domain.com
ServerAlias domain.com
DocumentRoot /var/www/domain.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
More posts by @Murray432
1 Comments
Sorted by latest first Latest Oldest Best
Try this:
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
ServerName domain.com
ServerAlias domain.com
DocumentRoot /var/www/domain.com/public_html
<Directory /var/www/domain.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
You had 2 Directory directives and either one pointed to your DocumentRoot.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.