[Gloucs] Virtual hosts on apache - any gurus around?

Iain Calder gloucs at mailman.lug.org.uk
Wed Nov 20 23:11:01 2002


Steve Searle wrote:

>I am trying to set up virtual hosts in apache, and have a problem which
>I am looking for some help.  The virtual host works with a plain HTML
>page, but Perl ssi's don't display anything.  The pages/scripts work fine
>when displayed form the non-virtual (main?) part of apache - the entire
>site was copied from the working area to the virtual host. When the page
>that includes the ssi's is requested, no error logs are written.
>
>Does anyone have any ideas where I could look for an answer?
>
>Cheers
>
>Steve
>
>  
>
Steve,

Do you mean SSIs or CGIs?  Can you post an example of (part of) a page 
that does not work?

Typically, SSIs would be enabled in the main server config, using 
something like:

<Directory />
Options Includes
</Directory>
AddHandler server-parsed .shtml
AddType text/html .shtml

This would propagate to any virtual hosts.

CGIs are commonly enabled for /cgi-bin with a ScriptAlias directive in 
the main server, e.g.:

ScriptAlias /cgi-bin/ /var/www/cgi-bin

To turn on CGIs in a Virtual host you will probably need to redefine 
ScriptAlias in the virtual host container,
e.g.
ScriptAlias /cgi-bin/ /home/virtualhost/cgi-bin

Iain