BrainDump
  Home arrow BrainDump arrow Page 2 - Using the Web Test Environment
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Using the Web Test Environment
By: Nilpo/Developer Shed Staff Writer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-05-08

    Table of Contents:
  • Using the Web Test Environment
  • Executing CGI scripts
  • PHP switching
  • Allowing external access

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using the Web Test Environment - Executing CGI scripts


    (Page 2 of 4 )

    Getting started with XAMPP, you’ll need to take a few things into consideration.  If you intend to run CGI scripts, you’ll need to know the location of the Perl interpreter.  This will be used in the shebang line of your CGI scripts.  In Linux, you’re probably used to something like this:

    #!/usr/bin/perl

    On the default XAMPP installation it should be this:

    #!/xampp/perl/bin/perl

    Of course, you’ll need to make that change in every one of your CGI scripts.

    The second thing you’ll need to take into consideration is file/folder permissions.  In Linux you’re used to using chmod to change every file or folder to allow execution.  This is not necessary in Windows XP since all files are given the right to execute by default. (And yes, this is a security risk.)

    Apache should already be configured to allow CGI execution when installed with XAMPP.  Let’s double check just to be sure.  Open the httpd.conf file in notepad.  It should be located in C:xamppapacheconf.  Browse through the file until you find the section for your web root directory.  It should look like this:

    <Directory "C:/xampp/htdocs">

    In that section, you should find an Options line that defines settings for Apache.  Make sure that ExecGCI (and not NoExec) is included.

        Options Indexes FollowSymLinks Includes ExecCGI

    Down a little further in the file you’ll find the section that identifies the ScriptAlias.  This is the folder where CGI scripts should be found.  Typically, this is www.yourdomain.com/cgi-bin/ or similar.

    The default installation puts this folder above your web root for security reasons.  This is most likely not what you want and it probably won’t work with your current “live” site either.  Just change the path in the ScriptAlias line to a folder under your web root.

    ScriptAlias /cgi-bin/ "C:/xampp/htdocs/cgi-bin/"

    Now go down just underneath that and change the folder path in the directory declaration.

    <Directory "C:/xampp/htdocs/cgi-bin">

        AllowOverride None

        Options None

        Order allow,deny

        Allow from all

    </Directory>

    If you are not using a standard CGI file handler for your scripts, you can change that in this file as well.  Scroll down a bit more and you’ll find the section for the mime type module.  Locate the line that looks like this:

    AddHandler cgi-script .cgi

    You can add any extensions you like to have them treated as CGI script by Apache.

    AddHandler cgi-script .cgi .pl

    More BrainDump Articles
    More By Nilpo/Developer Shed Staff Writer


       · You've learned how to create an Apache test environment in Windows. Now learn how...
     

    BRAINDUMP ARTICLES

    - XAML Brushes and Silverlight
    - Silverlight and XAML Basics
    - Immortal XP
    - XAML Basics
    - Microsoft Surface
    - Making Your First Active X Control in Visual...
    - Codes and Packages in Microsoft Project 2007
    - Windows 7: Rumors and Demos
    - XP SP3 Why Me?
    - Breaking Up Your Work in Microsoft Project
    - Breaking Work into Task-Sized Chunks
    - Putting Microsoft`s Worldwide Telescope Unde...
    - Handling Multiple Contracts with Indigo
    - Cleaning Out Your Data in XP
    - Multiple Service Contracts and Indigo





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway