All domains return default Apache Page

Hi all, I’ve been a somewhat longtime user of Webmin + Virtualmin, but i’ve always used it with NGINX (LEMP). This time i decided to give Apache a try. Installed Fresh Virtualmin w Apache (LAMP) on Ubuntu 18.04. Checked to make sure that Apache works. Went to Virtualmin and added a virtual server.

Problem: When viewed from a browser the newly created virtual server for some reason returns the default Apache page from /var/www/html and is not reading required directory /home/dev/public_html

I’ve read plenty of topics all day but i can’t figure this out. Any help is greatly appreciated. Thanks.

1 Like

What do the virtualhost directives look like? Click into one, go to Edit Directives if you can’t be botherered with an SSH session.

(They’ll probably all be in httpd.conf unless you change it in the Apache settings to store one .conf per server. Webmin > Servers > Apache > Module Config > “File or directory to add virtual servers to”, provide a path to a folder)

Most common thing would be that they’re missing ServerName and ServerAlias variables so they’re hitting the default document root.

< VirtualHost IP.IP.IP.IP:80 >
SuexecUserGroup “#1001” “#1001
ServerName dev.mydomain.com
ServerAlias www.dev.mydomain.com
ServerAlias mail.dev.mydomain.com
ServerAlias webmail.dev.mydomain.com
ServerAlias admin.dev.mydomain.com
DocumentRoot /home/dev/public_html
ErrorLog /var/log/virtualmin/dev.mydomain.com_error_log
CustomLog /var/log/virtualmin/dev.mydomain.com_access_log combined
ScriptAlias /cgi-bin/ /home/dev/cgi-bin/
ScriptAlias /awstats/ /home/dev/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
< Directory /home/dev/public_html >
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.2
FCGIWrapper /home/dev/fcgi-bin/php7.2.fcgi .php
FCGIWrapper /home/dev/fcgi-bin/php7.2.fcgi .php7.2
< /Directory >
< Directory /home/dev/cgi-bin >
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
< /Directory >
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.dev.mydomain.com
RewriteRule ^(.) https://dev.mydomain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.dev.mydomain.com
RewriteRule ^(.
) https://dev.mydomain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.2
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
< Files awstats.pl >
AuthName “dev.mydomain.com statistics”
AuthType Basic
AuthUserFile /home/dev/.awstats-htpasswd
require valid-user
< /Files >
Alias /dav /home/dev/public_html
< Location /dav >
DAV on
AuthType Basic
AuthName “dev.mydomain.com
AuthUserFile /home/dev/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php7.2
RewriteEngine off
< /Location >
< /VirtualHost >
< VirtualHost IP.IP.IP.IP:443 >
SuexecUserGroup “#1001” “#1001
ServerName dev.mydomain.com
ServerAlias www.dev.mydomain.com
ServerAlias mail.dev.mydomain.com
ServerAlias webmail.dev.mydomain.com
ServerAlias admin.dev.mydomain.com
DocumentRoot /home/dev/public_html
ErrorLog /var/log/virtualmin/dev.mydomain.com_error_log
CustomLog /var/log/virtualmin/dev.mydomain.com_access_log combined
ScriptAlias /cgi-bin/ /home/dev/cgi-bin/
ScriptAlias /awstats/ /home/dev/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
< Directory /home/dev/public_html >
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.2
FCGIWrapper /home/dev/fcgi-bin/php7.2.fcgi .php
FCGIWrapper /home/dev/fcgi-bin/php7.2.fcgi .php7.2
< /Directory >
< Directory /home/dev/cgi-bin >
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
< /Directory >
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.dev.mydomain.com
RewriteRule ^(.) https://dev.mydomain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.dev.mydomain.com
RewriteRule ^(.
) https://dev.mydomain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.2
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/dev/ssl.cert
SSLCertificateKeyFile /home/dev/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
< Files awstats.pl >
AuthName “dev.mydomain.com statistics”
AuthType Basic
AuthUserFile /home/dev/.awstats-htpasswd
require valid-user
< /Files >
Alias /dav /home/dev/public_html
< Location /dav >
DAV on
AuthType Basic
AuthName “dev.mydomain.com
AuthUserFile /home/dev/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php7.2
RewriteEngine off
< /Location >
< /VirtualHost >

I did check that 000-default.conf is disabled.

That should be fine. Whats the exact problem right now? If you are referring to the “forbidden page” when you access the domain without uploading your own files, then it is normal because its intended to do so.

I get the default Apache page for all domains.

Last night i created another domain, domain2.com.conf file appears to be correct, but it also is being sent to the default Apache2 page. In each domains public_html i have their own corresponding .html file to see what is being loaded.

I revised the domain1.com.conf and domain2.com.conf from to <VirtualHost *:80> this seems to have solved the issue. Each domain is now loading from the appropriate folder.

Any idea what I’ve mis-configured and why it doesn’t work with default settings but works like that?

Worth mentioning that inside /etc/apache2/sites-enabled i only have 2 .conf files domain1.com.conf and domain2.com.conf. 000-default.conf is not in there and had been disabled.

Doesnt have to be there, just so you know.^^ :slight_smile:

Anyways, glad it solved the issue but if I recall it correctly, its not meant to be the default way like you are currently doing so.
Can you provide log files from the time the issue was there?

I’ll provide logs a little later, i need to first clean them of IP addresses and names (I’ll do that after work).

Currently it doesn’t work exactly as it should. It defaults to one of the websites when i just type in my IP address. Which shouldn’t happen, but at least the websites themselves work. I’ll keep on playing with this further and provide update.

Mine defaults to one domain web using the ip. That is the same domain as in the hosts file… i dont see that as an error

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.