Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can I limit Apache2 Userdir to one vhost? [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DeathFire
n00b
n00b


Joined: 01 Jul 2004
Posts: 51
Location: Canada

PostPosted: Tue Mar 07, 2006 5:53 pm    Post subject: Can I limit Apache2 Userdir to one vhost? [Solved] Reply with quote

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
View user's profile Send private message
sebv
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2005
Posts: 78
Location: Savoie (France)

PostPosted: Tue Mar 07, 2006 8:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
DeathFire
n00b
n00b


Joined: 01 Jul 2004
Posts: 51
Location: Canada

PostPosted: Tue Mar 07, 2006 8:23 pm    Post subject: Reply with quote

Thanks,

I just gave that a try and it still loads for all hosts on that machine. Any other ideas?
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Tue Mar 07, 2006 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
DeathFire
n00b
n00b


Joined: 01 Jul 2004
Posts: 51
Location: Canada

PostPosted: Tue Mar 07, 2006 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum