You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "motty.cruz" <mo...@gmail.com> on 2010/10/29 00:11:03 UTC

[users@httpd] CGI-BIN

Hello, 
I'm trying  to get apache to execute cgi scripts outside  cgi-bin
directory(/usr/local/www/cgi-bin) instead I want to run scripts from
/usr/local/www/directory. I google it but most furums are for Linux. My
machine is a FreeBSD 8.1 running Apache 1.2
Any help is appreciated. 

Thanks, 
Motty


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] CGI-BIN

Posted by "motty.cruz" <mo...@gmail.com>.
Thanks Rich, it worked perfect!

-----Original Message-----
From: Rich Bowen [mailto:rbowen@rcbowen.com] 
Sent: Friday, October 29, 2010 11:34 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CGI-BIN


On Oct 29, 2010, at 2:20 PM, motty.cruz wrote:

> Hello Rich,
> Here what I get on the browser
>
> You don't have permission to access /second/ on this server
>
> Here is the access_log
> ip - - [29/Oct/2010:11:14:31 -0700] "GET /second/ HTTP/1.1" 403 209

> here is the error_log
> [Fri Oct 29 11:13:08 2010] [error] [client ip] client denied by server
> configuration: /usr/local/www/second



That's got nothing whatever to do with CGI configuration. That means that
you need to add the following:

<Directory /usr/local/www/second/>
  order allow,deny
  allow from all
</Directory>

--
Rich Bowen
rbowen@rcbowen.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI-BIN

Posted by Rich Bowen <rb...@rcbowen.com>.
On Oct 29, 2010, at 2:20 PM, motty.cruz wrote:

> Hello Rich,
> Here what I get on the browser
>
> You don't have permission to access /second/ on this server
>
> Here is the access_log
> ip - - [29/Oct/2010:11:14:31 -0700] "GET /second/ HTTP/1.1" 403 209

> here is the error_log
> [Fri Oct 29 11:13:08 2010] [error] [client ip] client denied by server
> configuration: /usr/local/www/second



That's got nothing whatever to do with CGI configuration. That means  
that you need to add the following:

<Directory /usr/local/www/second/>
  order allow,deny
  allow from all
</Directory>

--
Rich Bowen
rbowen@rcbowen.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] CGI-BIN

Posted by "motty.cruz" <mo...@gmail.com>.
Hello Rich, 
Here what I get on the browser

You don't have permission to access /second/ on this server

Here is the access_log
ip - - [29/Oct/2010:11:14:31 -0700] "GET /second/ HTTP/1.1" 403 209
ip - - [29/Oct/2010:11:14:32 -0700] "GET /second/ HTTP/1.1" 403 209
ip- - [29/Oct/2010:11:14:33 -0700] "GET /second/ HTTP/1.1" 403 209
ip - - [29/Oct/2010:11:14:33 -0700] "GET /second/ HTTP/1.1" 403 209
ip - - [29/Oct/2010:11:14:33 -0700] "GET /second/ HTTP/1.1" 403 209

here is the error_log
 [Fri Oct 29 11:13:08 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/second
[Fri Oct 29 11:14:31 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/ second
[Fri Oct 29 11:14:32 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/ second
[Fri Oct 29 11:14:33 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/ second
[Fri Oct 29 11:14:33 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/ second
[Fri Oct 29 11:14:33 2010] [error] [client ip] client denied by server
configuration: /usr/local/www/ second

Thanks, 
-Motty

-----Original Message-----
From: Rich Bowen [mailto:rbowen@rcbowen.com] 
Sent: Friday, October 29, 2010 11:09 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CGI-BIN


On Oct 29, 2010, at 1:53 PM, motty.cruz wrote:

> Hello Devraj,
> I already have the following line in my httpd.conf
>
> ScriptAlias  /cgi-bin/  "/usr/local/www/cgi-bin/"
>
> Can I add a second directory?
> ScriptAlias /second/  "/usr/local/www/second/"   <-- I added second  
> line but
> apache won't recognize the cgi scripts in side this dir.


Yes, you can have as many ScriptAlias directives as you like. When you say
"won't recognize", what precisely do you mean? What does the error log say?

--
Rich Bowen
rbowen@rcbowen.com
http://drbacchus.com/




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI-BIN

Posted by Rich Bowen <rb...@rcbowen.com>.
On Oct 29, 2010, at 1:53 PM, motty.cruz wrote:

> Hello Devraj,
> I already have the following line in my httpd.conf
>
> ScriptAlias  /cgi-bin/  "/usr/local/www/cgi-bin/"
>
> Can I add a second directory?
> ScriptAlias /second/  "/usr/local/www/second/"   <-- I added second  
> line but
> apache won't recognize the cgi scripts in side this dir.


Yes, you can have as many ScriptAlias directives as you like. When you  
say "won't recognize", what precisely do you mean? What does the error  
log say?

--
Rich Bowen
rbowen@rcbowen.com
http://drbacchus.com/




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] CGI-BIN

Posted by "motty.cruz" <mo...@gmail.com>.
Hello Devraj, 
I already have the following line in my httpd.conf

 ScriptAlias  /cgi-bin/  "/usr/local/www/cgi-bin/"

Can I add a second directory? 
ScriptAlias /second/  "/usr/local/www/second/"   <-- I added second line but
apache won't recognize the cgi scripts in side this dir. 

Thanks, 
-Motty

-----Original Message-----
From: Devraj Mukherjee [mailto:devraj@gmail.com] 
Sent: Thursday, October 28, 2010 3:24 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CGI-BIN

Hi Motty,

On Fri, Oct 29, 2010 at 9:11 AM, motty.cruz <mo...@gmail.com> wrote:
> Hello,
> I'm trying  to get apache to execute cgi scripts outside  cgi-bin
> directory(/usr/local/www/cgi-bin) instead I want to run scripts from 
> /usr/local/www/directory. I google it but most furums are for Linux. 
> My machine is a FreeBSD 8.1 running Apache 1.2 Any help is 
> appreciated.

You have to explicitly allow CGI execution

   ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"
Refer to http://httpd.apache.org/docs/2.0/howto/cgi.html

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI-BIN

Posted by Devraj Mukherjee <de...@gmail.com>.
Hi Motty,

On Fri, Oct 29, 2010 at 9:11 AM, motty.cruz <mo...@gmail.com> wrote:
> Hello,
> I'm trying  to get apache to execute cgi scripts outside  cgi-bin
> directory(/usr/local/www/cgi-bin) instead I want to run scripts from
> /usr/local/www/directory. I google it but most furums are for Linux. My
> machine is a FreeBSD 8.1 running Apache 1.2
> Any help is appreciated.

You have to explicitly allow CGI execution

<Directory /usr/local/apache2/htdocs/somedir>
Options +ExecCGI
</Directory>

Refer to http://httpd.apache.org/docs/2.0/howto/cgi.html

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org