httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zac Stevens <>
Subject Re: [users@httpd] VirtualDirectory
Date Thu, 30 Jan 2003 02:27:29 GMT
On Thu, Jan 30, 2003 at 12:56:11AM +0100, Subzero wrote:
> I can't run the script from the cgi-bin dir itself.. itäs a ikonboard forum
> that i am trying to make the VirtualDrectory for.. instead of
> i want
> So, i need to have the file in the cgi-bin/ikonboard/ dir..
> but the wierd thing is, that when i use it
> works perfect and when i use it doesn't process the file..

This thread seems to be a little bit confused, but I'll throw my 2 cents in
and hope I don't muddy the waters further :)

First, a quick note - there is no such thing as a "VirtualDirectory" in
Apache.  I understand this to be an IIS term roughly equivalent to Apache's
'Alias', but that doesn't really make sense in the context you're using it.

Now, there's two ways of solving the problem at hand.  The first is using
VirtualHosts, while the second uses mod_rewrite.  I don't use mod_rewrite
much, so I tend to use VHosts in this situation.

Generally speaking, I would not create a VHost whose DocumentRoot was
located underneath another VHost's DocumentRoot.  It is conceptually
simpler to be able to see a VirtualHost as an entirely separate entity in
its own right.  eg,

# main server
C:\Program Files\Apache Group\Apache\htdocs
C:\Program Files\Apache Group\Apache\cgi-bin
# forums
C:\Program Files\Apache Group\Apache\forum\htdocs
C:\Program Files\Apache Group\Apache\forum\cgi-bin

...and so on.  In your case, where you need a VirtualHost to run a single
CGI (more or less), a separate cgi-bin is not required.  I think something
along the lines of the following would probably work:

<VirtualHost *>

   DocumentRoot "C:/Program Files/Apache Group/Apache/forum/"

   ErrorLog logs/
   CustomLog logs/ common

   <Directory "C:/Program Files/Apache Group/Apache/forum/">
	Options -Indexes +ExecCGI
	AddHandler cgi-script .pl

You would then put the ikonboard files into the path specified as the
DocumentRoot above.

That's the VirtualHosting option.

As for mod_rewrite, you would keep a single VirtualHost and add a 
ServerAlias for ''.  Then you would need a couple of rules to
proxy requests for to - the documentation for
mod_rewrite includes a number of good examples, so if you're interested in
going down this path you can probably find something there.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message