Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Enabling CGI Script from Apache's htdocs directory

by shmem (Chancellor)
on Apr 06, 2007 at 14:39 UTC ( [id://608684]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Enabling CGI Script from Apache's htdocs directory
in thread Enabling CGI Script from Apache's htdocs directory

Because there will be many webapps I need to build (hence many subdirectory other than "Test"). I've tried to modified the following httpd.conf entry:
#ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" # into ScriptAlias /cgi-bin/ "/usr/local/apache/htdocs/cgi-bin/

Note that there's the ending quote missing. But this modification would allow you to access scripts in /usr/local/apache/htdocs/cgi-bin/hello.cgi as

http://bioinfo-z.comp.nus.edu.sg/cgi-bin/hello.cgi

Try

ScriptAlias /Test/cgi-bin/ /usr/local/apache/htdocs/Test/cgi-bin/ ScriptAlias /Webap1/cgi-bin/ /usr/local/apache/htdocs/Webap1/cgi-bin/ ScriptAlias /Webap2/cgi-bin/ /usr/local/apache/htdocs/Webap2/cgi-bin/

inside your <IfModule alias_module></IfModule> block.

You could also omit the cgi-bin part

ScriptAlias /Test/ /usr/local/apache/htdocs/Test/cgi-bin/ ScriptAlias /Webap1/ /usr/local/apache/htdocs/Webap1/cgi-bin/ ScriptAlias /Webap2/ /usr/local/apache/htdocs/Webap2/cgi-bin/

to access e.g /usr/local/apache/htdocs/Webap1/cgi-bin/hello.cgi as

http://bioinfo-z.comp.nus.edu.sg/Webap1/hello.cgi

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608684]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-03-28 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found