View previous topic :: View next topic |
Author |
Message |
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Tue Mar 07, 2006 5:53 pm Post subject: Can I limit Apache2 Userdir to one vhost? [Solved] |
|
|
Is there a way to limit userdir in Apache2 to one vhost? I don't want ~username showing up on every host, just on one specific one.
I have been searching high and low and have not come up with any info regarding this. Is it possible?
Thanks!
Last edited by DeathFire on Tue Mar 07, 2006 8:59 pm; edited 1 time in total |
|
Back to top |
|
|
sebv Tux's lil' helper
Joined: 14 Jan 2005 Posts: 78 Location: Savoie (France)
|
Posted: Tue Mar 07, 2006 8:00 pm Post subject: |
|
|
Yes I think you can do this simply.
I asume that you already have a good vhost config on your apache config.
So just define a new vhost and find the user part on the main config file of apache2. (search <IfModule mod_userdir.c>)
and move all this part on your new vhost (comment or remove from the main config file)
Add a DocumentRoot folder, an empty folder or a little page. (I don't know if we need it or not, but maybe yes, I never try to not define it)
I think it will suffice to apply homedir only on this vhost.
If not maybe you can try to also move the "loadmodule" part to your vhost, so it will load it on the vhost server only (i think). _________________ -La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi.
-Définissez-moi d'abord ce que vous entendez par Dieu et je vous dirai si j'y crois.
[Einstein] |
|
Back to top |
|
|
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Tue Mar 07, 2006 8:23 pm Post subject: |
|
|
Thanks,
I just gave that a try and it still loads for all hosts on that machine. Any other ideas? |
|
Back to top |
|
|
Monkeh Veteran
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Tue Mar 07, 2006 8:41 pm Post subject: |
|
|
Comment out this section in httpd.conf: Code: | <IfModule mod_userdir.c>
UserDir public_html
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
# Enable this additional section if you would like to make use of a
# suexec-enabled cgi-bin directory on a per-user basis.
#
#<Directory /home/*/public_html/cgi-bin>
# Options ExecCGI
# SetHandler cgi-script
#</Directory>
</IfModule>
|
And then add it to your vhost's block. That should work. |
|
Back to top |
|
|
DeathFire n00b
Joined: 01 Jul 2004 Posts: 51 Location: Canada
|
Posted: Tue Mar 07, 2006 8:59 pm Post subject: |
|
|
There we go! That worked, just a little different than what was suggested above (or maybe I just interpreted it differently). Thanks! |
|
Back to top |
|
|
|