Apache CGI outside server root?

Apache CGI outside server root?

Post by Patrick Pri » Wed, 26 Jan 2000 04:00:00



Apache:

I've scoured DejaNews and cannot find the answer how to allow CGI's to
run outside of the server root.

Let's say that ServerRoot is /www, then /www/cgi-bin runs cgi's just
fine.

Now I want to run CGI's in /usr/home/userdir/public_html/cgi-bin

<Directory /usr/home/>
Options ExecCGI
</Directory>

AddHandler cgi-script .cgi

Doesn't work.  Works only under ServerRoot.

What's the answer?

Patrick Price
Momentum Online

 
 
 

Apache CGI outside server root?

Post by Richard Scranto » Wed, 26 Jan 2000 04:00:00


Think carefully about the security exposure, and if you still want
to do this, look at the "Alias" directive.


> Apache:

> I've scoured DejaNews and cannot find the answer how to allow CGI's to
> run outside of the server root.

> Let's say that ServerRoot is /www, then /www/cgi-bin runs cgi's just
> fine.

> Now I want to run CGI's in /usr/home/userdir/public_html/cgi-bin

> <Directory /usr/home/>
> Options ExecCGI
> </Directory>

> AddHandler cgi-script .cgi

> Doesn't work.  Works only under ServerRoot.

> What's the answer?

> Patrick Price
> Momentum Online

--
_____________________________________________________
You can have it fast, good, and cheap.  Pick any two.
http://www.netcom.com/~scrantr/index.html

 
 
 

Apache CGI outside server root?

Post by Bill Mosele » Wed, 26 Jan 2000 04:00:00



remarked...

Quote:

> Apache:

> I've scoured DejaNews and cannot find the answer how to allow CGI's to
> run outside of the server root.

> Let's say that ServerRoot is /www, then /www/cgi-bin runs cgi's just
> fine.

You really mean DocumentRoot, don't you?

Quote:

> Now I want to run CGI's in /usr/home/userdir/public_html/cgi-bin

> <Directory /usr/home/>
> Options ExecCGI
> </Directory>

> AddHandler cgi-script .cgi

> Doesn't work.  Works only under ServerRoot.

> What's the answer?

Alias
ScriptAlias

--

pls note the one line sig, not counting this one.

 
 
 

Apache CGI outside server root?

Post by Anthony Austi » Thu, 27 Jan 2000 04:00:00


No full path name on the Directory Directive

> Apache:

> I've scoured DejaNews and cannot find the answer how to allow CGI's to
> run outside of the server root.

> Let's say that ServerRoot is /www, then /www/cgi-bin runs cgi's just
> fine.

> Now I want to run CGI's in /usr/home/userdir/public_html/cgi-bin

> <Directory /usr/home/>
> Options ExecCGI
> </Directory>

> AddHandler cgi-script .cgi

> Doesn't work.  Works only under ServerRoot.

> What's the answer?

> Patrick Price
> Momentum Online

 
 
 

Apache CGI outside server root?

Post by Patrick Pri » Thu, 27 Jan 2000 04:00:00


Thanks for replying, but FYI you dont' need the full path in
<Directory>, it also includes any subdirectories - here's what the
manual says about it:

<Directory> directive
Syntax: <Directory directory> ... </Directory>
Context: server config, virtual host
Status: Core.
<Directory> and </Directory> are used to enclose a group of directives
which will apply only to the named directory and sub-directories of
that directory

Thanks Again,
Patrick

On Wed, 26 Jan 2000 03:37:10 GMT, Anthony Austin


>No full path name on the Directory Directive


>> Apache:

>> I've scoured DejaNews and cannot find the answer how to allow CGI's to
>> run outside of the server root.

>> Let's say that ServerRoot is /www, then /www/cgi-bin runs cgi's just
>> fine.

>> Now I want to run CGI's in /usr/home/userdir/public_html/cgi-bin

>> <Directory /usr/home/>
>> Options ExecCGI
>> </Directory>

>> AddHandler cgi-script .cgi

>> Doesn't work.  Works only under ServerRoot.

>> What's the answer?

>> Patrick Price
>> Momentum Online

 
 
 

Apache CGI outside server root?

Post by Gabriele Bartolin » Fri, 28 Jan 2000 04:00:00




Quote:><Directory /usr/home/>
>Options ExecCGI
></Directory>

This gives perimissions to the directory. Just that ...

Quote:

>AddHandler cgi-script .cgi

You can either set it or not ...

Quote:>Doesn't work.  Works only under ServerRoot.
>What's the answer?

You have to set an alias to the cgi directory: you set already the
permissions, ok ... but how can that directory be called through HTTP?

"/cgi-bin" ? I suppose ...

So you have to issue an alias for the script ... so just look at the
ScriptAlias directive on the documentation.

Let me know

Ciao
-Gabriele

 
 
 

1. newbie help with starting an apache server...users outside local network cant find server.

I have just gotten apache v1.13 up and running on FreeBSD v4.7 .  I
have the server connected to my local network through a standalone
netgear router which is in turn connected to DSL provided by Verizon.

   I can get the apache default webpage if I http to the server from
any of the other computers on my local network.  However, anyone
outside the internet cannot get to the server by httping to the IP
address assigned to me from Verizon.  I did not change any
configuration from the standard apache install.

   My router is setup to forward port 80 to the server.  As a test, I
also started forwarding port 23 to the server and fired up telnetd.
Friends of mine could telnet to the box by using the Verizon IP
address, only still no go with http.

   So it looks like port forwarding is working, does anyone have any
ideas why this is happening?  I am hoping it is some configuration I
overlooked for Apache and hope that it is not Verizon blocking port
80.

TIA for any help,
Doug.

2. PCMCIA problem.

3. Execute cgi outside of cgi-bin

4. Redhat logout problem

5. Apache won't let me use CGI scripts outside of ScriptAliased dirs.

6. 2.4.0 and initrd problem

7. Running cgi scripts outside /cgi-bin directory

8. GCC 2.8.0 & C++ Exceptions & FreeBSD 2.2.2

9. Apache OS/2 CGI patch (was Re: Apache/2 web server)

10. Apache server behind Apache proxy / CGI environment question

11. NFS server won't share files outside of root volume

12. Apache Web Server--No outside access

13. Accessing files as root in CGI-Scripts under Apache