Web Site for main host not working after creating virtual host

6 posts / 0 new
Last post
#1 Mon, 04/23/2018 - 13:47
delitrium

Web Site for main host not working after creating virtual host

Hello!

A few days ago, after installing Virtualmin, I noticed that the main website of my host was not working. (i.e. host.mydomain.com). I was getting 403 Forbidden errors. After hours of troubleshooting, I started over, verifying how long it took before it stopped working and the 403 errors continued.

I have a fresh install of Ubuntu 16.04. I installed Virtualmin. I configured Virtualmin. During this time, I was able to get to http://host.mydomain.com

As soon as I created my first virtual host (which Virtualmin did successfully), I was unable to get to http://host.mydomain.com. I am getting 403 errors again.

It does not look like any of the files in /var/www or /var/www/html had changed in file size or permissions.

When I delete that virtual host, I am able to access the main site at http://host.mydomain.com again.

Note that I have installed this same configuration dozens of times, though not in the last 3-4 months and never had this problem.

Any ideas? Thanks in advance!

Mon, 04/23/2018 - 15:31
delitrium

Interesting development ...

I created my first virtual host (i.e. http://virtualhost.mydomain.com) knowing that http://host.mydomain.com would become unavailable.

After putting an index.php file into the home directory of the new virtual host, not only did http://virtualhost.mydomain.com come up (as expected), but http://host.mydomain.com redirects there.

Also, as I create 'sub-servers', the main host web site (http://host.mydomain.com) redirects there ...

I have been using Virtualmin for 5-6 years and this is mind-boggling. Any help is appreciated.

Tue, 04/24/2018 - 09:24
scotwnw

The default apache folder of /var/www is no longer the default after virtualmin is installed. Actually shouldnt be used at all after virtualmin is installed.

Tue, 04/24/2018 - 10:21
delitrium

Hi, scotwnw - A couple of things ... In all my years of using Virtualmin, this the /var/www/html has always remained the directory for the host Virtualmin is installed in. That has never changed and has always worked by default. Why is this happening now?

Second, why is the web directory for the main host (that used to be in /var/www/html) changing to whatever the latest virtual host is created? This, again, is behavior I've never seen.

Thanks.

Tue, 04/24/2018 - 18:11
Blueforce

Hi guys,

I also have to confirm that the var/www/html is still used as the default directory for Virtualmin host. We have been using Virtualmin Pro since its early adoption period, I think it is more than 13 years ago, and even on our latest dedicated server installed in December last year the var/www/html is the default directory for the host.

Regards, Leffe

Fri, 04/27/2018 - 23:59
delitrium

I solved this on my own after HOURS of troubleshooting ... After creating my first virtual host, I had to run a2ensite 000-default.conf in /etc/apache2/sites-available to re-activate the main site.

So what this boils down to, at least on Ubuntu 16.04, is that when a virtual host is created, the primary host's website at http://host.domain.com is deactivated and the only website that works is that of the virtual host that was created last. Hopefully someone will fix it.

Topic locked