Vinetop
 
{ Guest } - Login Browse 
:: Browse Topic Focus
Journal
General
How-To & DIY
Tips & Tricks
Reviews
 

How to configure Apache server to run CGI scripts outside of cgi-bin on Windows - Atom8 - Jan 22, 2008 8:19pm
How-To & DIY @ Internet / Webserver / Apache - Views (4147) - Ratings(4): ( 3.75 )
This instructions assume default installation of the Apache webserver on your Windows machine and your CGI scripts are running with ActivePerl.

- Open the config file "httpd.conf" at:
C:\Program Files\Apache Software Foundation\Apache2.2\conf

- Find the line that looks like below:
Options Indexes FollowSymLinks

- Change it to (append 'ExecCGI' directive):
Options Indexes FollowSymLinks ExecCGI

- Now look for another line like below:
#AddHandler cgi-script .cgi

**This line is commented out by default (the '#' sign starting the line)
- Remove that pound '#' sign and add .pl at the end of the line like this
AddHandler cgi-script .cgi .pl

- Next, look for the line like:
DirectoryIndex index.html

- Add 'index.cgi' like below:
DirectoryIndex index.html index.cgi

Save this config file and restart the Apache service as follows:

- Right-click on the Apache icon in the system tray and select "Open Apache Monitor"


- Click "Restart" button to restart the Apache webserver.


Now any CGI scripts ending in .cgi or .pl placed anywhere in the htdocs area and folders will be executed when it is browsed by a any browser to this server.

Try a simple index.cgi written in Perl and replace the index.html in the htdocs folder for example (like the code below).


The webserver will display the CGI script like this:


Of course, remember to exercise cautions as this could open a lot of risks if you don't manage your webserver well...scripts can do a lot of things.

Last Edit: Jan 22, 2008 8:34pm - by Atom8        Comments | Report




Comments and Ratings:( Post Your Comments )

( VineTop ) - Apr 14, 2008 3:42am - Rating: None

yadiya

How-To & DIY

Recent Posts
How to embed Picasa Slideshow in your posts
:: VineTop - Jul 13, 2008 2:19pm

How to insert embedded Google Maps in your posts
:: VineTop - Jul 13, 2008 2:14pm

Sony PS3 250GB Upgrade on a 40GB System
:: Atom8 - Mar 03, 2008 12:58am

How to export & import table using mysqldump and mysql commands
:: Atom8 - Jan 23, 2008 4:45am

How to configure Apache server to run CGI scripts outside of cgi...
:: Atom8 - Jan 22, 2008 8:19pm

How to install Apache web server (v2.2.x) on Windows XP
:: Atom8 - Jan 22, 2008 6:58pm

How to install ActiveState Perl 5.10 on Windows XP
:: Atom8 - Jan 22, 2008 5:26pm

How to install MySQL 5.0 Server on Windows XP
:: Atom8 - Jan 22, 2008 3:32pm

ActiveState Perl 5.10 Connecting to MySQL 5.0 with Net::MySQL mo...
:: Atom8 - Jan 21, 2008 9:47pm

How to embed YouTube videos in your posts
:: VineTop - Jan 19, 2008 12:52pm

Most Viewed
Most Commented
Top Rated

2007 - 3000 vinetop.com [ Terms & Policy :: Contact Us :: About ]