Apache22, User dirs and Jails.

Hey all, Im not too sure if this can be done but hope someone can point me in the right direction. I have apache22 installed on the host system (FreeBSD 8.1) with a jail on a seperate hdd located at /jails/myjailhere. Is it at all possible to get apache to read the public www dirs located in the users home on the jail (/jails/myjailhere/home/someuser/www)?

Sorry if this has been asked before but couldn't find much info on the subject.
 
You can certainly have apache read the directories from the host system to the jails, however, the apache directive you'd have to use wouldn't be user dirs, but vhosts. Unless the users exist on the host system the same as the jails, and the home folder on the home system is within the jail, you aren't using the 'user dirs' switch. You would then need to specify a vhost in extra/httpd-vhosts.conf with the path for each user you wanted to have public.

Hope that makes sense.

[edit] or just install apache in the jail, this is how I do it.[/edit]
 
Cheers for the fast reply, It makes perfect sense :)

I don't think its an option to have a copy of all the users on the host. I have had a little play with vhosts and have that working although every user on the jail has public access and adding a line for each one could get a little tedious. :\ Might be able to sort a little script so that every new user added gets a vhost added in the configs.

[edit] or just install apache in the jail, this is how I do it.[/edit]

This would be the preferred option but with only one IP and the pain of moving all web data from the host to the jail I was looking for something a bit tidier. lol, And I'm lazy.

I was thinking that I might be able to have a little play with some port redirection or something along those lines so that xx1.mydomain.com point towards apache on the host running on port 80 and xx2.mydomain.com points to the jail on port 82.

Thanks for the info and pointing me in the right direction, I should manage to work something out from here. But if anyone has other options or ideas all input is welcome :)
 
Back
Top