Changing /home

7 posts / 0 new
Last post
#1 Mon, 09/05/2005 - 15:22
MichaelAlucard

Changing /home

I looked through alot of posts, maybe i missed if this was covered.

I use apache on an old system running RH9 and have several virtual web servers and webalizer. I have built another system running FC4 and Webmin/Virtualmin I set up a second hdd with /var becuase thats were all the servers are for apache on RH9 (/var/www/html)

my dilema is that Virtualmin wants everything under /home which is not a very big space on new system. i have tried changing the Virtualmin templates to create everything under /var/www/html then /public_html but it keeps puting them under /home

is it not possible to run Virtualmin, webalizer, quotas under
/var/www/html ?

thanks in advance for any suggestions

Mon, 09/05/2005 - 20:39
Joe
Joe's picture

Hey Michael,

Yes, changing from /home to /var/www is supported. However, the switch is not recommended, and I'll take a moment to explain why before I get on to the how:

In Fedora Core 4, user websites are expected to be in /home, while the &quot;default&quot; website is expected to be in /var/www. Virtualmin doesn't deal with the &quot;default&quot; website at all...it only deals with user-owned domain websites. SELinux policy in Fedora Core 4 anticipates this and actually comes pretty close to being useable with a Virtualmin installation (though there are enough gotchas that we aren't yet recommending SELinux be enabled on a Virtualmin system). So, the recommendation is to put things on /home. The only change required to make everything Just Work is to recompile Apache to support SuExec for the /home directory. I will be posting better documentation on this step for the GPL version shortly, and of course the Virtualmin Professional package includes a properly built Apache package. On the other hand, to get everything working for /var/www, you have to change a <i>lot</i> of configuration options...which brings us to the how.

First step, of course, is to tell the various components (mail server, system, pop/imap server, etc.) all about your decision.

In Users and Groups (in Webmin:System) set the default home directory to your choice. This actually takes care of a lot of the picture, now that I think of it...as when you setup Maildir delivery the right thing just happens with regard to quotas. It also deals with the pop/imap for most servers, as most of them base the location from the home directory. So that should cover most of the trouble.

Hmmm...OK, now I'm thinking I exaggerated the trouble, but it's been a while since I've setup Virtualmin to live in another location. Try this step (assuming all of the templates and stuff reference $HOME rather than absolute paths containing &quot;/home&quot;) and see if it gets you closer to your goal. Holler if it doesn't. I've only got Virtualmin Professional installations available at the moment, and so it might be easier here than on the GPL version (I don't think this aspect has changed, however, since we're using almost exactly the same directory layout as a Virtualmin GPL installation).

--

Check out the forum guidelines!

Sun, 12/16/2007 - 21:51 (Reply to #2)
mefirstnamemela...

I also would like to change the default '/home' dir.
It seems to be hard coded into the perl code. Possibly in create-user.pl.
I ran into the suxec problem where it uses /var/www as the doc root.
However I want to continue using the apt-get packages instead of recompiling apache and suexec.
So I moved the home directories under /var/www and suxec started working as advertised. I changed the home directory path in the webmin user module too and in the apache host files. So most things are working. The webalizer still needs some work.
Now it would be great if their was a way to change the default '/home/' to '/var/www/ at the start before the user and virtual server is created. I could not find where that default is set.

Sun, 12/16/2007 - 23:07 (Reply to #3)
Joe
Joe's picture

It's not hard-coded.

I recommend you rebuild Apache with suexec docroot set to /home. Really. ;-)

Unless you've changed the configuration from the default in the Module Configuration &quot;Home directory base&quot; setting, setting it in the Users and Groups module should be all that is needed.

We'd need to see some kind of specific error to know what's going wrong.

--

Check out the forum guidelines!

Sun, 12/16/2007 - 23:43 (Reply to #4)
mefirstnamemela...

I tried recompiling Apache on Ubuntu. But the compilation does not setup the new debian directory system and config files with the /etc/apache2/sites-available and /etc/apache2/mods-available system. The apt-get mods like mod_python have to be recompiled for that version of Apache too. I think recompiling Apache make it incompatible with the debian/ubuntu directory structure.

That's why I think it's simpler to just change the default home directory.

The webmin Users and Groups module only has settings for users that have already been created. Virtualmin creates the users with the '/home/ path first. And it won't create a server for an existing user.
Where is the setting for the default &quot;Home directory base&quot; setting?

Sun, 12/16/2007 - 23:48 (Reply to #5)
Joe
Joe's picture

<div class='quote'>I tried recompiling Apache on Ubuntu. But the compilation does not setup the new debian directory system and config files with the /etc/apache2/sites-available and /etc/apache2/mods-available system. The apt-get mods like mod_python have to be recompiled for that version of Apache too. I think recompiling Apache make it incompatible with the debian/ubuntu directory structure.</div>

Oh! No, I mean compile the deb package from a source package. Rebuilding from tarball is madness.

apt-get source apache2

Edit the rules file to change the docroot to /home.

cd back up to the top-level of the source directory, and run debuild.

You need a few packages installed in order to build from source, but you'll want to do some reading on that topic in the Ubuntu docs.

As for changing settings, the Users and Groups module also has a Module Configuration page, which is where configuration changes are made.

--

Check out the forum guidelines!

Mon, 12/17/2007 - 06:33
mefirstnamemela...

Well I tried using debian sources and debuild.
But I must be missing something because I keep getting debuild fatal errors.
So I'm just going to settle for my solution of changing the home base dir.
I did find the setting for changing the home dir in the Users and Groups module and also the 'Home directory base' in the Virtualmin Virtual Servers (GPL) module config.&lt;br&gt;&lt;br&gt;Post edited by: mefirstnamemelastname, at: 2007/12/17 06:36