You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ranganadh <ti...@yahoo.co.in> on 2002/07/08 16:09:23 UTC

problem with accessing cgi files



Hi,

 i had a problem when i am accessing the CGI scripts.
I entered ScriptAlias line in the my httpd.conf file. 

ScriptAlias /cgi-bin/ "/var/www/cgi-bin"

And when i am trying to access script file
i am getting the following error

     i stored the file in /var/www/cgi-bin



**************************************************
          ERROR
****************************************************
Object not found!
The requested URL was not found on this server. If you
entered the URL manually please check your spelling
and try again.
If you think this is a server error, please contact
the webmaster
Error 404
192.168.100.98
Mon Jul 8 19:20:04 2002
Object not found!
The requested URL was not found on this server. If you
entered the URL manually please check your spelling
and try again.
If you think this is a server error, please contact
the webmaster
Error 404
192.168.100.98
Mon Jul 8 19:20:04 2002
****************************************************







And this is the part of httpd.conf file

***************************************************
        part of configuration file

****************************************************

# ScriptAlias: This controls which directories contain
server scripts.
# ScriptAliases are essentially the same as Aliases,
except that
# documents in the realname directory are treated as
applications and
# run by the server when requested rather than as
documents sent to the client.
# The same rules about trailing "/" apply to
ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
*****************************************************

Can anyone tell me what could be the problem


thanks in advance

regards

Ranganadh

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by BAO RuiXian <ba...@atbusiness.com>.
Ranganadh wrote:

> Hi,
>
>  i had a problem when i am accessing the CGI scripts.
> I entered ScriptAlias line in the my httpd.conf file.
>
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
>

I think you missed slash '/' inside the quotes above.

Best

Bao
--
BAO RuiXian,  PROGRAMMER, Technologies Team, Project Services Group
AtBusiness Communications Corp., Kaapeliaukio 1, FIN-00180 Helsinki
tel. +358-9-2311 6674, mob. +358-50-329 6275,  fax +358-9-2311 6601
http://www.atbusiness.com, email: bao.ruixian@atbusiness.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Zac Stevens <zt...@cryptocracy.com>.
Hi Gary,

On Mon, Jul 08, 2002 at 10:46:20AM -0500, Gary Turner wrote:
> On Tue, 09 Jul 2002 01:02:14 +1000, Zac Stevens wrote:
> >On Mon, Jul 08, 2002 at 09:58:46AM -0500, Gary Turner wrote:
> >> As a side note, if you wish to comply with the Filesystem Hierarchy
> >> Standard, a more appropriate location would be /usr/local/lib/cgi-bin/.
> >
> >Could you point me towards that standard?  I'd be interested to have a
> >read, but that sounds like an entirely broken place to put one's cgi-bin...
> 
> See http://www.pathname.com/fhs/2.2/

Thanks.  I've only had a brief look over it thus far but it looks pretty
reasonable.

> /usr/local/ is the hierarchy used for locally installed programs and
> data that should not be over-written by other installs. ./lib/ is for
> "... object files, libraries, and internal binaries that are not
> intended to be executed directly by users or shell scripts..."  In other
> words, called by another program such as Apache.

I can see where you're coming from but I tend to disagree.  I don't
consider CGI scripts "internal binaries" as there isn't a strong coupling
between the webserver and the scripts.  An example of something I would
consider to fall into this category is 'suexec' - a binary specific to
Apache HTTPD which is never executed by anything but the webserver.

As with many things in system administration, this is probably in no small
part a matter of opinion and little else.

Personally speaking, I virtualise just about every service I can - so
putting things like cgi-bin in system locations doesn't sit too well with
me as a general rule.  In the case of HTTPD, I create a tree - usually
based at /var/www or /export/www, depending on the size of the installation
- with a subdirectory for each hosted domain.  I tend to do this even if I
only plan on hosting a single site as I like having the flexibility to
change my mind without expending significant effort :)

Locating the data for services in a single location also makes it trivial
to relocate the service to another machine, store data on an network
fileserver, or chroot() either CGI execution or the entire webserver.

Thanks for your thoughts on this subject - it's always good to hear other
opinions on how to approach these problems.


Zac


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Jeff Beard <je...@cyberxape.com>.
On Tue, 9 Jul 2002, Ranganadh wrote:

>
>  hi,
>
>  now I am able execute files from /cgi-bin/. But I
>  want to allow users to put their cgi script in their
> "public_html". For that i followed the method which i
> found in documentation.

Ick. I'd never do this. I wouldn't want a script running
on a system that I manage that I (or another knowledgeable
programmer) hadn't vetted. And when you do that you might
as well put them all in one hierarchy.

--Jeff

--
Jeff Beard | Systems Architect, Programmer, Sysadmin
Contact    | jeff at cyberxape dot com
Location   | In front of the computer, Boulder, CO, USA


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Ranganadh <ti...@yahoo.co.in>.
  
 hi,
 
 now I am able execute files from /cgi-bin/. But I
 want to allow users to put their cgi script in their
"public_html". For that i followed the method which i
found in documentation.
 
 my problem is that i am getting script code instead
of output of the script.
 
****************************************************
        steps i followed
 
****************************************************
 
 1. I added this to configuration file
  
   <Directory /home/*/public_html>
                 Options +ExecCGI
         </Directory>
 
 
 2. I added this also 
 
  AddHandler cgi-script cgi pl
 
 
 3. and this to httpd.conf
 
  AllowOverride Options
 
 4. and i created .htaccess file in public_html
 directory and entered following line in .htaccess
 file
 
  Options +ExecCGI
***************************************************

 I checked there is NO problem with the   permissions
of the file. 
 
 And there is NO problem with the script. I am able
 accessthe same script from /cgi-bin/ i am getting
html document. 
 
 But when i am accessing from /home/ranga/public_html
 .
 Instead of getting output of the script i am getting 
script code itself. 
 
 
 Can anyone tell me what could be the problem
 
 
 thanks in advance
 
 regards

 Ranganadh
 
 
 
 
 
 
> 
> 
>  --- Gary Turner <kk...@swbell.net> wrote: > On 
> Tue, 09 Jul 2002 01:02:14 +1000, Zac Stevens
> > wrote:
> > 
> > >Hi there,
> > >
> > >On Mon, Jul 08, 2002 at 09:58:46AM -0500, Gary
> > Turner wrote:
> > >> As a side note, if you wish to comply with the
> > Filesystem Hierarchy
> > >> Standard, a more appropriate location would be
> > /usr/local/lib/cgi-bin/.
> > >
> > >Could you point me towards that standard?  I'd be
> > interested to have a
> > >read, but that sounds like an entirely broken
> place
> > to put one's cgi-bin...
> > 
> > See http://www.pathname.com/fhs/2.2/
> > 
> > /usr/local/ is the hierarchy used for locally
> > installed programs and
> > data that should not be over-written by other
> > installs. ./lib/ is for
> > "... object files, libraries, and internal
> binaries
> > that are not
> > intended to be executed directly by users or shell
> > scripts..."  In other
> > words, called by another program such as Apache.
> > 
> > In fact, /var/www/ is non-compliant, but is there
> > for historical and
> > negotiated reasons (as I have been told).  I have
> > placed my document
> > root at /usr/local/lib/www/. (I don't have to
> > remember where it is
> > because I know where it belongs.)
> > --
> > gt
> > It ain't so much what you don't know that gets you
> > in trouble---
> > it's what you do know that ain't so.--unk
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail:
> > users-help@httpd.apache.org
> > 
> 
>
________________________________________________________________________
> Want to sell your car? advertise on Yahoo Autos
> Classifieds. It's Free!!
>        visit http://in.autos.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Ranganadh <ti...@yahoo.co.in>.
hi,

now I am able execute files from /cgi-bin/. But I want
to allow users to put their cgi script in their 
"public_html". For that i followed the method which i
found in documentation.

my problem is that i am getting script code instead of
output of the script.

****************************************************
        steps i followed

****************************************************

1. I added this to configuration file
 
  <Directory /home/*/public_html>
                Options +ExecCGI
        </Directory>


2. I added this also 

 AddHandler cgi-script cgi pl


3. and this to httpd.conf

 AllowOverride Options

4. and i created .htaccess file in public_html
directory and entered following line in .htaccess file

 Options +ExecCGI
****************************************************

I checked there is problem with the permissions of the
file. 

And there is problem with the script. I am able access
the same script from /cgi-bin/ i am getting html
document. 

But when i am accessing from /home/ranga/public_html .
Instead of getting output of the script i am getting
script code itself. 


Can anyone tell me what could be the problem


thanks in advance

regards

Ranganadh








 --- Gary Turner <kk...@swbell.net> wrote: > On 
Tue, 09 Jul 2002 01:02:14 +1000, Zac Stevens
> wrote:
> 
> >Hi there,
> >
> >On Mon, Jul 08, 2002 at 09:58:46AM -0500, Gary
> Turner wrote:
> >> As a side note, if you wish to comply with the
> Filesystem Hierarchy
> >> Standard, a more appropriate location would be
> /usr/local/lib/cgi-bin/.
> >
> >Could you point me towards that standard?  I'd be
> interested to have a
> >read, but that sounds like an entirely broken place
> to put one's cgi-bin...
> 
> See http://www.pathname.com/fhs/2.2/
> 
> /usr/local/ is the hierarchy used for locally
> installed programs and
> data that should not be over-written by other
> installs. ./lib/ is for
> "... object files, libraries, and internal binaries
> that are not
> intended to be executed directly by users or shell
> scripts..."  In other
> words, called by another program such as Apache.
> 
> In fact, /var/www/ is non-compliant, but is there
> for historical and
> negotiated reasons (as I have been told).  I have
> placed my document
> root at /usr/local/lib/www/. (I don't have to
> remember where it is
> because I know where it belongs.)
> --
> gt
> It ain't so much what you don't know that gets you
> in trouble---
> it's what you do know that ain't so.--unk
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Gary Turner <kk...@swbell.net>.
On Tue, 09 Jul 2002 01:02:14 +1000, Zac Stevens wrote:

>Hi there,
>
>On Mon, Jul 08, 2002 at 09:58:46AM -0500, Gary Turner wrote:
>> As a side note, if you wish to comply with the Filesystem Hierarchy
>> Standard, a more appropriate location would be /usr/local/lib/cgi-bin/.
>
>Could you point me towards that standard?  I'd be interested to have a
>read, but that sounds like an entirely broken place to put one's cgi-bin...

See http://www.pathname.com/fhs/2.2/

/usr/local/ is the hierarchy used for locally installed programs and
data that should not be over-written by other installs. ./lib/ is for
"... object files, libraries, and internal binaries that are not
intended to be executed directly by users or shell scripts..."  In other
words, called by another program such as Apache.

In fact, /var/www/ is non-compliant, but is there for historical and
negotiated reasons (as I have been told).  I have placed my document
root at /usr/local/lib/www/. (I don't have to remember where it is
because I know where it belongs.)
--
gt
It ain't so much what you don't know that gets you in trouble---
it's what you do know that ain't so.--unk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Zac Stevens <zt...@cryptocracy.com>.
Hi there,

On Mon, Jul 08, 2002 at 09:58:46AM -0500, Gary Turner wrote:
> As a side note, if you wish to comply with the Filesystem Hierarchy
> Standard, a more appropriate location would be /usr/local/lib/cgi-bin/.

Could you point me towards that standard?  I'd be interested to have a
read, but that sounds like an entirely broken place to put one's cgi-bin...

Cheers,


Zac


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Gary Turner <kk...@swbell.net>.
On Mon, 08 Jul 2002 15:09:23 +0100 (BST), Ranganadh wrote:

>
>Hi,
>
> i had a problem when i am accessing the CGI scripts.
>I entered ScriptAlias line in the my httpd.conf file. 
>
>ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
>
>And when i am trying to access script file
>i am getting the following error
>
You are missing the closing /, eg. "/var/www/cgi-bin/"

As a side note, if you wish to comply with the Filesystem Hierarchy
Standard, a more appropriate location would be /usr/local/lib/cgi-bin/.
--
gt
It ain't so much what you don't know that gets you in trouble---
it's what you do know that ain't so.--unk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: problem with accessing cgi files

Posted by Jeff Beard <je...@cyberxape.com>.
Are the rest of the permissions for this directory set
appropriately? Also, check that can you run the program
from the command line.

--Jeff

On Mon, 8 Jul 2002, Ranganadh wrote:

>
> Hi,
>
>  i had a problem when i am accessing the CGI scripts.
> I entered ScriptAlias line in the my httpd.conf file.
>
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
>
> And when i am trying to access script file
> i am getting the following error
>
>      i stored the file in /var/www/cgi-bin
>
>
>
> **************************************************
>           ERROR
> ****************************************************
> Object not found!
> The requested URL was not found on this server. If you
> entered the URL manually please check your spelling
> and try again.
> If you think this is a server error, please contact
> the webmaster
> Error 404
> 192.168.100.98
> Mon Jul 8 19:20:04 2002
> Object not found!
> The requested URL was not found on this server. If you
> entered the URL manually please check your spelling
> and try again.
> If you think this is a server error, please contact
> the webmaster
> Error 404
> 192.168.100.98
> Mon Jul 8 19:20:04 2002
> ****************************************************
>
> And this is the part of httpd.conf file
>
> ***************************************************
>         part of configuration file
>
> ****************************************************
>
> # ScriptAlias: This controls which directories contain
> server scripts.
> # ScriptAliases are essentially the same as Aliases,
> except that
> # documents in the realname directory are treated as
> applications and
> # run by the server when requested rather than as
> documents sent to the client.
> # The same rules about trailing "/" apply to
> ScriptAlias directives as to
> # Alias.
> #
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
> *****************************************************
>
> Can anyone tell me what could be the problem
>
>
> thanks in advance
>
> regards
>
> Ranganadh
>
> ________________________________________________________________________
> Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
>        visit http://in.autos.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

--
Jeff Beard | Systems Architect, Programmer, Sysadmin
Contact    | jeff at cyberxape dot com
Location   | In front of the computer, Boulder, CO, USA


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org