How to enable CGI-BIN (for perl) for a virtualhost [SOLVED]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to enable CGI-BIN (for perl) for a virtualhost [SOLVED]

Postby zipper » 01. July 2011 05:53

I have had a XAMPP installation running successfully under Win 2k3 for about six months and really love it. It has definitely made many things much easier than IIS.

The only problem I'm now having is that two of the virtualhost domains (out of about 30 total sites) need to run perl scripts. After searching the forums I haven't been able to find out how to configure a cgi-bin folder and give it the correct permission to allow each site to have its own cgi-bin and set of scripts.

Thanks in advance if you can point me in the right direction.
zipper
 
Posts: 2
Joined: 01. July 2011 05:46

Re: How to enable CGI-BIN (for perl) for a virtualhost

Postby Sharley » 01. July 2011 10:24

In each web site you want to run cgi scripts add a cgi-bin folder.

Next add this line after the Directory directive in each of the vhosts that require a cgi-bin, like so
Code: Select all
</Directory>
ScriptAlias /cgi-bin/ "C:/xampp/yourwebsite/cgi-bin/"
Change the cgi-bin path to suit each vhosts location folder that requires a cgi-bin.

Save the file and restart Apache, then test your scripts.
http://localhost/yourwebside/cgi-bin/test.pl for example.

You could also add these 2 lines immediately after the Directory directive so it looks like this
Code: Select all
<Directory "C:/xampp/yourwebsite" >
Options MultiViews Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
The ExecCGI may allow you to run a cgi script in that folder without the need for a ScriptAlias cgi-bin.
http://httpd.apache.org/docs/2.2/howto/cgi.html
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to enable CGI-BIN (for perl) for a virtualhost

Postby zipper » 01. July 2011 18:16

Thanks so much. I'll give it a try and report back. This is exactly what I needed and haven't been able to find.

Cheers!
zipper
 
Posts: 2
Joined: 01. July 2011 05:46


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 137 guests