Mobile app version of vmapp.org
Login or Join
Murray432

: 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

@Murray432

Posted in: #Apache2

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>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme