HTTP/Apache2 Gurus: I need your help

Status
Not open for further replies.

fade

Staff member
I'm trying to do something that seems like it should be simple, but I can't figure it out.

I want to set a different documentroot for a given directory specified in the url.

In other words, I want www.example.com to go to the regular documentroot, but I want www.example.com/stuff to go to /usr/shared/pub/stuff.

I tried specifying a DocumentRoot inside a Location directive:
Code:
<Location /stuff>
   DocumentRoot /usr/shared/pub/stuff
   AuthType Basic
   AuthName \"Stuff is here\"
   AuthUserFile /etc/apache2/stuff-auth-file
   Require valid-user
</Location>
But that overwrites the DocumentRoot for the whole site. How can I do this? I don't want to use virtual hosts because I want this available to the public.

Thanks in advance.
 
what if you made a symbolic link to /usr/shared/pub ?

I'm not horribly familiar to Apache, but I think it would work.
 

fade

Staff member
I actually figured it out, but now I have a different problem. The answer to the original is embarrassingly simple: use Apache's Alias directive.

Now, I can't seem to get Apache's rewrite rules to work right. I could swear I have it right. I'm really familiar with regexps, so I know mine is right...

What I want to do is use http://egg.louisiana.edu/git to access http://egg.louisiana.edu/cgi-bin/gitweb/gitweb.cgi , but I can't seem to get the rewrite to work. I either get weird permissions errors, or it tries to actually go to /git, which is nonexistent.
 
K

Kitty Sinatra

I actually figured it out, but now I have a different problem. The answer to the original is embarrassingly simple: use Apache's Alias directive.
I would've suggested exactly that but while the reference I was reading mentioned Alias, it didn't list that as one of the directives and so I just didn't know how to suggest using Alias :\
 
Status
Not open for further replies.
Top