faqts : Computers : Internet : Web Servers : Apache

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

Web Server: Apache: CGI: How to run CGI programs?

Jan 15th, 2007 14:52
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 15 January 2021 - 11:18 pm --------------------
Web Server: Apache: CGI: How to run CGI programs?
===
Steps: Overview:
 1. -Create a backup of your Apache httpd.conf file
 2. -Open your Apache httpd.conf file
     1. -E.g.
          notepad  c:\apache\Apache2\conf\httpd.conf
 3. -Search for a line similar to this
     (remove the # in front to make that line active)
      ScriptAlias /cgi-bin/ "/pdrive/apache/Apache2/htdocs/cgi-bin/"
     (note: you will have to adapt this path to the conditions
            on your computer, so that Apache can find it)
 4. -Search for a line similar to this
     (remove the # in front to make that line active)
      AddHandler cgi-script .cgi
 5. -Search for a line similar to this
     (remove the # in front to make that line active)
      <Directory "/pdrive/apache/Apache2/htdocs/cgi-bin">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
       </Directory>
     (note: you will have to adapt this path to the conditions
            on your computer, so that Apache can find it)
 6. -Save this file
 7. -Copy your cgi files to that directory
     1. -E.g.
          copy *.* "/pdrive/apache/Apache2/htdocs/cgi-bin/"
     1. -E.g.
          copy input.exe output.exe "/pdrive/apache/Apache2/htdocs/cgi-
bin"
 8. -Start Apache
     1. -E.g. open an MSDOS box and type the following command
          start f:\pdrive\apache\Apache2\bin\Apache.exe
                (note: you will have to adapt this path to the
                       conditions on your computer)
     2. -Note:
         Make sure no other web servers run on port 80 (possibly stop
         that process (e.g. 'tiny.exe' or 'inetinfo.exe (=IIS)') via
         Microsoft task manager)
 9. -Open your browser
10. -Type the URL
      http://<your web server machine name>/cgi-bin/<your cgi filename>
     1. -E.g.
          http://localhost/cgi-bin/input.exe
===
Tested successfully on
Microsoft Windows XP Professional (service pack 2),
running
Apache v2.0.52
===
Internet: see also:
---
BBCBASIC: Windows: CGI: Link: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/43627/fid/768
----------------------------------------------------------------------