CHange defulat DocumentRoot Help

10 posts / 0 new
Last post
#1 Sat, 06/09/2007 - 16:16
DavidHughes

CHange defulat DocumentRoot Help

I've searched the forums and haven't found the answer... so hopefully someone can help.

How do I change the default DocumentRoot location when creating a new Virtual Domain. It defaults of course to /

home/*/public_html

And I would like to change this to something like /home/*/public_html/cms or some similar change.

I have changed over to Ubuntu which is a Debian foundation, and it is somewhat different that the RedHat/Apache structure I am more familiar with...

Help anyone?

drhiii

Sat, 06/09/2007 - 17:00
DavidHughes

OPs, would help if I could spell default properly...

Sun, 06/07/2009 - 07:03
Joe
Joe's picture

Hey David,

Edit the Server Template(s) that you use...browse to the Apache Website section, and the very first option is called "Directives and settings for new websites". This is a free text field, which contains all of the directives used to spin up a new VirtualHost in Apache. Change this line:

DocumentRoot ${HOME}/public_html

To:

DocumentRoot ${HOME}/public_html/cms

To alter your existing domains, you can either use the Webmin Apache module, or you can edit the files directly. On Debian-based systems, they live in individual files in /etc/apache2/sites-available. (This is the default, though it can be changed. For anyone reading who might want to do this on Red Hat based systems, the VirtualHost sections are setup in the base httpd.conf.)

You may also want to consider using redirect rules with proxying to achieve the effect you're after. Changing the DocumentRoot can have other effects on other configurations and options.

--

Check out the forum guidelines!

Sat, 06/09/2007 - 21:32
DavidHughes

Thank you for an extremely fast response. Zow.

I will do exactly as you have indicated. Would have eventually stumbled onto this am sure, but after plowing around docs and searches, felt I should ask after not finding the answer, at least one that I understood.

And, I am very grateful to receive a response from THE Joe Cooper of everything-MIN fame. These are terrific applications, all of them. Am digging deeper into their uses which means I will need to purchase some of the materials that help this learning curve along, instead of asking basic questions like I just did. So, thank you Joe Cooper for your response. Much appreciated...

drhiii

Sat, 06/09/2007 - 23:20 (Reply to #4)
Joe
Joe's picture

Hey David,

<i>And, I am very grateful to receive a response from THE Joe Cooper of everything-MIN fame.</i>

I'm flattered, but technically Jamie is more everything-min than I. I'm the &quot;if Jamie gets hit by a bus tomorrow, who will continue Webmin development?&quot; guy. Luckily, Jamie's the other half of Virtualmin, Inc., so you'll see him around here, too. ;-)

<i>Am digging deeper into their uses which means I will need to purchase some of the materials that help this learning curve along, instead of asking basic questions like I just did.</i>

Jamie and I have recently wikified both of our Webmin books and have begun updating them. You can find them here:

http://doxfer.com/Webmin

We expect other Webmin/Usermin geeks will step in and help us out with the updates and enhancements going forward. And, we also have a new documentation wiki coming online here at Virtualmin.com with the new CMS. I'm trying to get the last little quirks worked out, and hopefully it'll be launched before the weekend is out. So, docs will be getting better fast once we have the tools to make updates easy.

--

Check out the forum guidelines!

Sat, 06/09/2007 - 21:36
DavidHughes

Duh, I get it now. After going to the specific Server Template screens, a lot of things fell into place. Make sense in other words. Onward with this new found knowledge ----&gt;

Sun, 06/10/2007 - 04:06
DavidHughes

Well, I do need to say that I've never seen any worthy application or endeavor exist without top notch collaboration. Methinks something this detailed cannot be wrought by any one person. So no busses for either one of you gents, please.

As an FYI, after more study after your assistance, things make a *lot* more sense.

drhiii

Sat, 01/09/2016 - 16:22
fixmyserver

I want to do this as well, but as you can see the above information is quite dated.
Just installed version 5 of Virtualmin and would like a setup where the default DocumentRoot for new servers is:

home/user/public_html/domainname.tld

Also, I have an additional question (that might not be necessary if I can get the 1st question, but nevertheless I would like to know anyway): where do you change the DocumentRoot? I tried navigating to: "Services > Configure Website > Document Options" and changing the User WWW directory, but it didn't work. I also tried going to: "Webmin > Apache Webserver > myVirtualServer > Document Options," and changing the User WWW Directory there but it didn't work either.

If I change the Automatic Virtual Hosts to the desired path, it does seem to work or override the pre-selected options, but I feel like this is not the correct way and/or the previous edits should have worked. Anyone have any ideas for this?

Tue, 02/13/2018 - 03:37
m

I would like to know anyway): where do you change the DocumentRoot? I tried navigating to: "Services > Configure Website > Document Options" and changing the >>User WWW directory, but it didn't work. I also tried going to: "Webmin > Apache Webserver > myVirtualServer > Document Options," and changing the User WWW >>Directory there but it didn't work either.

Start with updating both menus,
Virtualmin / Services/Confgure Site/Edit configurations/Edit Directives -> update the terminal

as well as

Virtualmin / Services/Confgure Site/Configure website for ssl/Edit Directives -> update the terminal

If both menus' front page paths were not updated, update them manually.

ReBoot the server or start the httpd and ssl services from Webmin/System/Bootup and Shutdown I reboot. Check that you can go to the site with a browser (htppd and htpps). If it does not work check the var/log/virtualmim/ site error file to see the path it is trying to go to.

If it still trying the old path try updating this file. (the file name number will be different)

/etc/webmin/virtual-server/domains/151841758632130 Change My changes look like this public_html_dir=public_html to public_html_dir=example.com/data/www/example public_html_path=/home/views/public_html to public_html_path=/home/example/example.com/data/www/example

The reason you need to update Edit Directives in both menus is because httpd goes to one port (80) and htpps goes to another (400 something). In theory we may be able to set two roots, one for htppd and the other to htpps, but I did not try.

MikeVR

Wed, 02/14/2018 - 05:43
Jfro

Not sure if this is what you need / want.

Virtualmin > Systemsettings > Virtualmin Configuration > Default for new domains > Home directory Base

??? ;)

Topic locked