Change WWW root folder

5 posts / 0 new
Last post
#1 Sun, 09/17/2017 - 23:02
Crimsonblaed

Change WWW root folder

Hi,

I have a VPS instance running Ubuntu 16.04, which I have Virtualmin installed. Originally, not knowing how Virtualmin actually worked, I used the Webmin component and installed and had web services running on the main server using /var/www/html as the web root. After having an enlightened (and somewhat facepalm) moment while playing around with Virtualmin, I worked out what it was all about and ended up creating a virtual server.

So, this is where my question lies…. I decided to make the virtual server a web server and move the web root for the domain to /home/user/public_html. Although, I can’t make the new web root the new landing zone, each time I attempt reach the new location, it keeps landing on the old web root (/var/www/html).

Not sure what information you would need, so please let me know if you need additional info.

Thanks in advance

Mon, 09/18/2017 - 17:21
Crimsonblaed

Thoughts? Theories? Suggestions?

Thanks Crimsonblaed

Mon, 09/18/2017 - 19:25
Joe
Joe's picture

You've got a default server configured. You need to disable it. Installing Virtualmin should have done it, but maybe if the system was configured with changes it might not have actually worked.

This should do it:

# a2dissite 000-default
# service apache2 restart

--

Check out the forum guidelines!

Mon, 09/18/2017 - 23:11 (Reply to #3)
Crimsonblaed

Thanks Joe,
I have already removed the default site from the sites-enabled directory, so only the site I want is listed. Regardless, I also used the commands you suggested just now and it returned with "ERROR: Site 000-default does not exist"

Again thanks for you suggestion, would you be able to hint further?

Thanks Crimsonblaed

Tue, 09/19/2017 - 02:04 (Reply to #4)
Joe
Joe's picture

Oh, it might be called 00-default, rather than 000-default. Try that. (You can be sure by looking at the configuration for apache in /etc/apache2/sites-available and sites-enabled.)

I guess you need to go spelunking in the config files to find where that old configuration is and get rid of it. There's also an SSL default site (again, it gets disabled by the Virtualmin installer), which could be the culprit if you're hitting it on port 443.

Do you remember how to configured the initial site that was in /var/www? The standard way to do it is with the 00-default. But, if you created your own configuration manually, it's not going to be under control of the a2dissite command.

--

Check out the forum guidelines!

Topic locked