tyme Posted March 7, 2008 Report Share Posted March 7, 2008 (edited) I want to be able to point virtual hosts to directories inside a users public_html folder in their home directory while not having the site available via http://domain/~username/blah - is this simply a matter of removing the UserDir param in http's config? For some reason I have this feeling that doing that would make apache incapable of recognizing/using the public_html folder to serve up the sites, or am I wrong about that? Basically I want users to be able to go to: http://userssite.tld/ and get the site, but not at: http://servers.tld/~username/usersite.tld/ This is a server with multiple domains, and various users. I want them all to be able to administrate their own stuff from within their user directory, so far as I allow them. I'm currently doing a whole bunch of moving and setting up of various services (my first time setting up a server from scratch for LAMP + Mail + whatever else I want to mess with), so I may have more questions forthcoming. Edited March 7, 2008 by tyme Link to comment Share on other sites More sharing options...
ianw1974 Posted March 8, 2008 Report Share Posted March 8, 2008 If you don't have the userdir parameter in Apache, then it won't allow you do to the http://server/~username bit. However, what I would then do, is set an apache config file in /etc/apache2/conf.d/vhosts or wherever they are located, and then set the url you want to access, and point it to the DocumentRoot of the home directory of the user /home/user/public_html. For example, you could set: ServerName username.domain.com and then ensure that you set the Document path's correctly, and you should be up and running. I'll check my apache config and update what I did for one of my domains as I have multiple domains on one single ip all in different vhosts. Link to comment Share on other sites More sharing options...
ianw1974 Posted March 11, 2008 Report Share Posted March 11, 2008 This was from my vhost file: <IfDefine DEFAULT_VHOST> <VirtualHost *:80> ServerName www.lsltd.org ServerAlias lsltd.org DocumentRoot "/var/www/localhost/htdocs/joomla" <Directory "/var/www/localhost/htdocs/joomla"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> Include /etc/apache2/vhosts.d/99_joomla_default_vhost.include <IfModule mpm_peruser_module> ServerEnvironment apache apache </IfModule> </VirtualHost> </IfDefine> and from the default.include file (you can merge this into the one file if you like, it was just something I left as is because of how apache was working on Gentoo): ServerAdmin root@localhost <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/" </IfModule> <Directory "/var/www/localhost/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> this is on a gentoo system, therefore the vhost conf file was in /etc/apache2/vhosts.d. This was to get my domain - www.lsltd.org working on a system that had multiple vhosts and only one single static IP address assigned. Hope it helps a bit. Effectively, all you need to be doing is creating a vhost for each user, and then pointing each vhost to their home directory. I don't know if there will be a permissions problem, but it's worth testing anyway, and this is how I would do it if I didn't want the userdir parameter enabled and used. Link to comment Share on other sites More sharing options...
tyme Posted March 11, 2008 Author Report Share Posted March 11, 2008 i got it working. i just turned off userdirs and pointed the virtual hosts to the right directory - it was easier than i expected. Link to comment Share on other sites More sharing options...
ianw1974 Posted March 11, 2008 Report Share Posted March 11, 2008 Ah cool Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now