Author Topic: simple cgi-bin Q  (Read 703 times)

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
simple cgi-bin Q
« on: 19 November 2002, 01:21 »
when i do
ScriptAlias /cult/ib/cgi-bin/ "/var/www/cgi-bin"
will my cgi scripts that are in /var/www/cgi-bin fail to work properly if the have relative links that are relative to /var/www/html/cult/ib/cgi-bin (which is where they use to reside)??

I am plannin to upgrade my server and wanna use a cgi-bin at /var/www/cgi-bin instead of having the scripts executable anywhere.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
simple cgi-bin Q
« Reply #1 on: 19 November 2002, 01:49 »
another q:
should my cgi-bin directory container look like this:

<Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

or like this:

  <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None ExecCGI
        Order allow,deny
        Allow from all
    </Directory>

[ November 18, 2002: Message edited by: The Master of Reality / B0B ]

Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
simple cgi-bin Q
« Reply #2 on: 19 November 2002, 02:02 »
quote:
Originally posted by The Master of Reality / B0B:
when i do
ScriptAlias /cult/ib/cgi-bin/ "/var/www/cgi-bin"
will my cgi scripts that are in /var/www/cgi-bin fail to work properly if the have relative links that are relative to /var/www/html/cult/ib/cgi-bin (which is where they use to reside)??

I am plannin to upgrade my server and wanna use a cgi-bin at /var/www/cgi-bin instead of having the scripts executable anywhere.



Yes, that should work. Instead of www.someserver.com/cgi-bin/script.cgi you would have www.someserver.com/cult/ib/cgi-bin/script.cgi.

If you want both you'll need to add an "Alias".

[ November 18, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
simple cgi-bin Q
« Reply #3 on: 19 November 2002, 02:05 »
quote:
m0ranother q:
or like this:



Like this (the default):
Code: [Select]

Just make sure you don't have "ExecCGI" in your other directory definitions and it will only execute CGI from your cgi-bin.

[ November 18, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
simple cgi-bin Q
« Reply #4 on: 19 November 2002, 02:37 »
quote:
Originally posted by void main:


Yes, that should work. Instead of www.someserver.com/cgi-bin/script.cgi you would have www.someserver.com/cult/ib/cgi-bin/script.cgi.

If you want both you'll need to add an "Alias".

[ November 18, 2002: Message edited by: void main ]


thanx
that was really the question... but i got it figured out.

[ November 18, 2002: Message edited by: The Master of Reality / B0B ]

Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
simple cgi-bin Q
« Reply #5 on: 20 November 2002, 01:12 »
quote:
like this (default)
Code: [Select]

Just make sure you don't have "ExecCGI" in your other directory definitions and it will only execute CGI from your cgi-bin.

[ November 18, 2002: Message edited by: void main]

thats not the default in my apache. my default is:

<Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

should i change the "none" to "ExecCGI"?

[ November 19, 2002: Message edited by: The Master of Reality / B0B ]

[ November 19, 2002: Message edited by: The Master of Reality / B0B ]

Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
simple cgi-bin Q
« Reply #6 on: 20 November 2002, 01:29 »
Hmm, interesting. It appears that you only need ExecCGI if the directory in question is not a "ScriptAlias" directory. All files (regardless of thier extension) are treated as executable if they are in a ScriptAlias directory. It's interesting that my Apache 2.x server (and all of my other servers) have the ExecCGI set even though they are also are defined via ScriptAlias, I think that's a RedHat default because I don't remember setting any of them that way. Here a FAQ:

http://httpd.apache.org/docs/misc/FAQ-F.html#CGIoutsideScriptAlias

[ November 19, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...