Gossamer Forum
Home : General : Perl Programming :

Apache cgi configuration

Quote Reply
Apache cgi configuration
Hi
I don't know if you can help me with this problem. I hope so.

the httpd.conf in apache server tells the following:
----
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
#AddHandler cgi-script .cgi
------

When I uncomment AddHandler and try to execute a cgi outside the scriptaliased directory I receive 403 error (forbidden).

Do you know how this could be fixed?

Thank you.



Quote Reply
Re: Apache cgi configuration In reply to
Have you got the following (or something similar) in http.conf?

ScriptAlias /cgi-bin/ "/absolute/path/to/cgi/"

<Directory "/absolute/path/to/cgi/">
AllowOverride None
Options None
</Directory>
<Directory "/path/to/web/docs/">
Options Includes ExecCGI
</Directory>

You can have as many aliases as you want. To run SSI outside the cgi-bin you will also need the following:

AddHandler server-parsed .shtml

Hopefully, this will work for you. For more information try this link: http://www.apache.org/...GIoutsideScriptAlias and http://www.apache.org/...od/core.html#options.

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Apache cgi configuration In reply to
Ok I guess it could work even if in my case doesn't. How do you explane the 'forbidden' page?

In your solution I should add tons of lines to make hosted domains execute in any directories simply by changing permissions. I know it is possible since there are apache servers providing such feature for any domain. But I don't know how they reach the result :(
Thanks.


Quote Reply
Re: Apache cgi configuration In reply to
Do you know if there is a good forum for apache questions?

Quote Reply
Re: Apache cgi configuration In reply to
Documentation at http://www.apache.org/docs/

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: Apache cgi configuration In reply to
I think you only need to specify the base directory for your HTML docs. That's three lines.

Just did a search; try this Apache forum:

http://www.tek-tips.com/...ev2/3/lev3/22/pid/65

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Apache cgi configuration In reply to
To run cgi scripts in a directory not setup using ScriptAlias, you need two things:

1. Make sure AddHandler cgi-script cgi is setup.
2. Make sure Options ExecCGI is in a <Directory> or <Location> tag for the area you want.

Cheers,

Alex

--
Gossamer Threads Inc.