Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About cgi-bin and httpd

Status
Not open for further replies.

sarm

Programmer
Aug 13, 2001
77
US
Hello,
I have one domainone currently using cgi-scripts fine.
I would like mynewdomain to have it's own cgi-bin. As shown below I have ScriptAlias defined globally in the httpd file.
I also have the directory listing. My question is in order for each newdomain to have its own cgi-bin do I comment out the global ScriptAlias and define each cgi-bin within the vhost container? By doing so is the <directory> container needed for each domain using a cgi-bin? Should the directory container be within the vhost section? This seems redundant if the path is defined in the ServerAlias line.
Thanks


ScriptAlias /cgi-bin/ /home/domainone/cgi-bin/

<Directory &quot;/home/domainone/cgi-bin&quot;>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# Named Virtual hosts
# Vhost domainone.com
<VirtualHost x.x.x.x>
DocumentRoot /home/domainone/www/
ServerAdmin me@domainone.com
ServerName ServerAlias /cgi-bin/ /home/domainone/cgi-bin/
</VirtualHost>

# Vhost mynewdomain.com
<VirtualHost x.x.x.x>
DocumentRoot /home/mynewdomain/www/
ServerAdmin me@mynewdomain.com
ServerName </VirtualHost>
 
Hi,

In short - yes. You would define a <Directory>block within each virtual host container (similar to your global cgi-bin) and have a ScriptAlias directive in the vhost block itself. Something like this :

<VirtualHost x.x.x.x>
DocumentRoot /home/mynewdomain/www/
ServerAdmin me@mynewdomain.com
ServerName ScriptAlias /cgi-bin/ /home/newdomain/cgi-bin/
<Directory &quot;/home/newdomain/cgi-bin&quot;>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>  
</VirtualHost>

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top