Re: apache, perl, 403 forbidden, help?

2000-11-28 Thread will trillich
On Wed, Nov 22, 2000 at 06:28:10AM -0600, Herbert Ho wrote:
 I've tried it both with and without the '+'. they both result in the
 same error (403 forbidden). i check my permissions again and as far as
 i can tell all parent directories are at least o+rx.
 
 for some reason i can't understand apache is ignoring the Directory
 directives i use in the conf file... =(
 
 thanks for your suggestion.
 
 
 herbert
 
 On Tue, Nov 21, 2000 at 04:57:03PM -0600, Chris Feist wrote:
  
  SNIP
   1) i've added the handler and options directives to my srm.conf:
   
 AddHandler cgi-script .cgi .pl
 Directory /
Options +All +ExecCGI
 /Directory
  
  You shouldn't have a + in front of All and ExecCGI.  I'm not sure if 
  you're just doing it for empahsis, but that could be your problem.

au contraire.
Options ExecCGI
sets options to be 'ExecCGI' only, regardless of what they were
before, whereas
Options +ExecCGI
leaves current options as is, except for turning ExecCGI on.

as i understand it, anyhow.

  Make sure your permissions are at least 755.

make sure the partition is mounted for executability
(as opposed to noexec) -- use command 'mount'

can you run the perl from the command line?

have you enabled mod_cgi?
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
# if you don't `apt-get install apache-perl` you'll need to:
# LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so
AddHandler cgi-script .cgi

# note that this will tell apache to run ANYthing
# ending in *.cgi or *.pl, so beware!
FilesMatch \.cgi
# these will need '#!' shebang path on first line
SetHandler cgi-script
Options +ExecCGI
/FilesMatch
FilesMatch \.pl
Options +ExecCGI
SetHandler perl-script
PerlSendHeader Off
PerlHandler Apache::PerlRun
# or
# PerlHandler Apache::Registry
/FilesMatch

   2) i tried pointing the directory to the exact directory where i'm
  executing the script (i.e. / - /home/herb/public_html/init, my
  script resides in init/) to no avail.
   
   3) i tried replacing the Directory directive w/
   
 ScriptAlias ~herb/public_html/init /home/herb/public_html/init
   
  again, no effect.

LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
UserDir disabled root
UserDir /home/*/public_html
DirectoryMatch ^/home/.*/public_html/cgi-bin
Options +ExecCGI
/DirectoryMatch

   4) installing the 'apache' package instead of 'apache-perl'. it makes
  me download the script.
   
   
   permissions look correct. all parents of the script directory are at
   least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
   (ScriptAlias'ed to cgi-bin/), but not elsewhere.
   
   HELP? any is appreicated...

hopefully there's a pointer in the above hoo-hah to nudge
you over the top...? (and with luck, i've not left out
anything important -- there's lots!)

-- 
There are only two places in the world where time takes
precedence over the job to be done.  School and prison. 
--William Glasser 

[EMAIL PROTECTED]***http://www.dontUthink.com/

volunteer to document your experience for next week's
newbies -- http://www.eGroups.com/messages/newbieDoc



Re: apache, perl, 403 forbidden, help? (SOLVED...kinda)

2000-11-27 Thread Ernest Johanson
Herb,

There's a typo in your document header in the perl script. It has to have
2 newlines at the end.

Ernest Johanson
Web Systems Administrator
Fuller Theological Seminary


On Sun, 26 Nov 2000, Herbert Ho wrote:

 Date: Sun, 26 Nov 2000 14:49:42 -0600
 From: Herbert Ho [EMAIL PROTECTED]
 To: Ernest Johanson [EMAIL PROTECTED]
 Cc: debian-user@lists.debian.org
 Subject: Re: apache, perl, 403 forbidden, help? (SOLVED...kinda)
 
 thanks for everyone's help so far. it works...a little bit more. =)
 
 the problem i found is that there is already a Directory directive
 for the public_html/ directories in access.conf. this seems to either
 be read last (thus overrriding changes made in other files)  or
 conflict w/ changes made in other files.
 
 so it now is able to run the perl script. but it still doesn't work
 entirely. the problem i have now is i get a '500 internal server
 error' from my browser.
 
 checking the error.log shows
 
Premature end of script headers: /home/herb/public_html/init/test.pl
 
 the problem is a similar script works on a working http server my
 university runs (so i can't get the httpd.conf file to compare).
 
 here's the simple script. hopefully you can punch a hole in it for me:
 
#!/usr/bin/perl -w
print Content-type: text/html\n\;
 
print EOF;
htmlbody
hi
/body/html
 
EOF
 
 also, here's the relative modification from my access.conf that made
 apache want to run it:
 
DirectoryMatch ^/home/.*/public_html
AddHandler cgi-script .pl .cgi
Options ExecCGI Indexes SymLinksIfOwnerMatch
AllowOverride None
/DirectoryMatch
 
 
 thanks in advance,
 
 herb
 
 On Wed, Nov 22, 2000 at 01:47:38PM -0800, Ernest Johanson wrote:
  Herbert, 
  
  A few things to check:
  
  1. Remove the quotes in your Directory statement, i.e. Directory /
  instead of Directory /.
  
  2. Make sure the directory you are trying to execute cgis in is under your
  DocmentRoot if you're using a Directory / statement. If what you want is
  to serve pages and execute cgis from your user directory (typically
  outside the DocumentRoot), then read up on the UserDir directive in the
  apache docs.
  
  3. Check your access.conf file to make sure there isn't already some
  directives configured for the path your directory is in. The default
  configuration in Debian has something for public_html that you may need to
  edit.
  
  4. Be sure to restart the server after making changes.
  
  HTH,
  
  Ernest Johanson
  Web Systems Administrator
  Fuller Theological Seminary
  
  
  On Tue, 21 Nov 2000, Herbert Ho wrote:
  
   Date: Tue, 21 Nov 2000 15:55:26 -0600
   From: Herbert Ho [EMAIL PROTECTED]
   To: debian-user@lists.debian.org
   Subject: apache, perl, 403 forbidden, help?
   
   hi all.
   
   i can't get apache to execute a perl/cgi script.
   
   *box: potato/sparc, installed apache-perl and its dependencies.
   
   *error: 403 forbidden in web browser. this in error log:
   
  Options ExecCGI is off in this directory: 
   /home/herb/public_html/init/login.pl
   
   i tired everything in the faq and manual to little success. things
   i've tried:
   
   1) i've added the handler and options directives to my srm.conf:
   
 AddHandler cgi-script .cgi .pl
 Directory /
Options +All +ExecCGI
 /Directory
   
  i know +All and +ExecCGI are redudant and this is not secure, but
  i'm desperate. =) 
  
   2) i tried pointing the directory to the exact directory where i'm
  executing the script (i.e. / - /home/herb/public_html/init, my
  script resides in init/) to no avail.
   
   3) i tried replacing the Directory directive w/
   
 ScriptAlias ~herb/public_html/init /home/herb/public_html/init
   
  again, no effect.
   
   4) installing the 'apache' package instead of 'apache-perl'. it makes
  me download the script.
   
   
   permissions look correct. all parents of the script directory are at
   least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
   (ScriptAlias'ed to cgi-bin/), but not elsewhere.
   
   HELP? any is appreicated...
   
   
   herbert
   
  
  
  -- 
  To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
  with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 



Re: apache, perl, 403 forbidden, help? (SOLVED...kinda)

2000-11-26 Thread Herbert Ho
thanks for everyone's help so far. it works...a little bit more. =)

the problem i found is that there is already a Directory directive
for the public_html/ directories in access.conf. this seems to either
be read last (thus overrriding changes made in other files)  or
conflict w/ changes made in other files.

so it now is able to run the perl script. but it still doesn't work
entirely. the problem i have now is i get a '500 internal server
error' from my browser.

checking the error.log shows

   Premature end of script headers: /home/herb/public_html/init/test.pl

the problem is a similar script works on a working http server my
university runs (so i can't get the httpd.conf file to compare).

here's the simple script. hopefully you can punch a hole in it for me:

   #!/usr/bin/perl -w
   print Content-type: text/html\n\;

   print EOF;
   htmlbody
   hi
   /body/html

   EOF

also, here's the relative modification from my access.conf that made
apache want to run it:

   DirectoryMatch ^/home/.*/public_html
   AddHandler cgi-script .pl .cgi
   Options ExecCGI Indexes SymLinksIfOwnerMatch
   AllowOverride None
   /DirectoryMatch


thanks in advance,

herb

On Wed, Nov 22, 2000 at 01:47:38PM -0800, Ernest Johanson wrote:
 Herbert, 
 
 A few things to check:
 
 1. Remove the quotes in your Directory statement, i.e. Directory /
 instead of Directory /.
 
 2. Make sure the directory you are trying to execute cgis in is under your
 DocmentRoot if you're using a Directory / statement. If what you want is
 to serve pages and execute cgis from your user directory (typically
 outside the DocumentRoot), then read up on the UserDir directive in the
 apache docs.
 
 3. Check your access.conf file to make sure there isn't already some
 directives configured for the path your directory is in. The default
 configuration in Debian has something for public_html that you may need to
 edit.
 
 4. Be sure to restart the server after making changes.
 
 HTH,
 
 Ernest Johanson
 Web Systems Administrator
 Fuller Theological Seminary
 
 
 On Tue, 21 Nov 2000, Herbert Ho wrote:
 
  Date: Tue, 21 Nov 2000 15:55:26 -0600
  From: Herbert Ho [EMAIL PROTECTED]
  To: debian-user@lists.debian.org
  Subject: apache, perl, 403 forbidden, help?
  
  hi all.
  
  i can't get apache to execute a perl/cgi script.
  
  *box: potato/sparc, installed apache-perl and its dependencies.
  
  *error: 403 forbidden in web browser. this in error log:
  
 Options ExecCGI is off in this directory: 
  /home/herb/public_html/init/login.pl
  
  i tired everything in the faq and manual to little success. things
  i've tried:
  
  1) i've added the handler and options directives to my srm.conf:
  
AddHandler cgi-script .cgi .pl
Directory /
   Options +All +ExecCGI
/Directory
  
 i know +All and +ExecCGI are redudant and this is not secure, but
 i'm desperate. =) 
 
  2) i tried pointing the directory to the exact directory where i'm
 executing the script (i.e. / - /home/herb/public_html/init, my
 script resides in init/) to no avail.
  
  3) i tried replacing the Directory directive w/
  
ScriptAlias ~herb/public_html/init /home/herb/public_html/init
  
 again, no effect.
  
  4) installing the 'apache' package instead of 'apache-perl'. it makes
 me download the script.
  
  
  permissions look correct. all parents of the script directory are at
  least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
  (ScriptAlias'ed to cgi-bin/), but not elsewhere.
  
  HELP? any is appreicated...
  
  
  herbert
  
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: apache, perl, 403 forbidden, help? (SOLVED...kinda)

2000-11-26 Thread Herbert Ho
  
 #!/usr/bin/perl -w
 print Content-type: text/html\n\;
 
 print Content-type: text/html\n\n;
 

doh! that's what happens when you don't copy/paste. =(

but in the code that i actually run, the two '\n' do exist.

sorry. =p


herbert



Re: apache, perl, 403 forbidden, help?

2000-11-22 Thread Herbert Ho
I've tried it both with and without the '+'. they both result in the
same error (403 forbidden). i check my permissions again and as far as
i can tell all parent directories are at least o+rx.

for some reason i can't understand apache is ignoring the Directory
directives i use in the conf file... =(

thanks for your suggestion.


herbert

On Tue, Nov 21, 2000 at 04:57:03PM -0600, Chris Feist wrote:
 
 SNIP
  1) i've added the handler and options directives to my srm.conf:
  
AddHandler cgi-script .cgi .pl
Directory /
   Options +All +ExecCGI
/Directory
  
 i know +All and +ExecCGI are redudant and this is not secure, but
 i'm desperate. =) 
 
 
 You shouldn't have a + in front of All and ExecCGI.  I'm not sure if 
 you're just doing it for empahsis, but that could be your problem.
 
 Make sure your permissions are at least 755.
 
  2) i tried pointing the directory to the exact directory where i'm
 executing the script (i.e. / - /home/herb/public_html/init, my
 script resides in init/) to no avail.
  
  3) i tried replacing the Directory directive w/
  
ScriptAlias ~herb/public_html/init /home/herb/public_html/init
  
 again, no effect.
  
  4) installing the 'apache' package instead of 'apache-perl'. it makes
 me download the script.
  
  
  permissions look correct. all parents of the script directory are at
  least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
  (ScriptAlias'ed to cgi-bin/), but not elsewhere.
  
  HELP? any is appreicated...
  
  
  herbert
  
  
  -- 
  Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null




Re: apache, perl, 403 forbidden, help?

2000-11-22 Thread Herbert Ho
i tried this, but it hasn't worked. i did both

   AddHandler cgi-script .cgi

and
   
   AddHandler cgi-script .cgi .pl

i tried renaming all my perl scripts to .cgi, but it doesn't like it.
if i use the first one (with my scrips still having .pl), the browser
ends up downloading the script...

i'm sure it's something really stupid but i don't know what it is...
=p

thanks for the help.


herbert

On Tue, Nov 21, 2000 at 06:19:57PM -0600, Rob VanFleet wrote:
 It might be that you don't have it set up as a handler.
 Look in /etc/apache/srm.conf for
 AddHandler cgi-script .cgi
 
 I think it's commented out by default. Just uncomment it, and change your
 script's extenstion to .cgi (You could add .pl as a handler, but it's better
 just to stick with cgi).
 
 Hope that helps,
 Rob
 
 
 -- 
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null



Re: apache, perl, 403 forbidden, help?

2000-11-22 Thread Ernest Johanson
Herbert, 

A few things to check:

1. Remove the quotes in your Directory statement, i.e. Directory /
instead of Directory /.

2. Make sure the directory you are trying to execute cgis in is under your
DocmentRoot if you're using a Directory / statement. If what you want is
to serve pages and execute cgis from your user directory (typically
outside the DocumentRoot), then read up on the UserDir directive in the
apache docs.

3. Check your access.conf file to make sure there isn't already some
directives configured for the path your directory is in. The default
configuration in Debian has something for public_html that you may need to
edit.

4. Be sure to restart the server after making changes.

HTH,

Ernest Johanson
Web Systems Administrator
Fuller Theological Seminary


On Tue, 21 Nov 2000, Herbert Ho wrote:

 Date: Tue, 21 Nov 2000 15:55:26 -0600
 From: Herbert Ho [EMAIL PROTECTED]
 To: debian-user@lists.debian.org
 Subject: apache, perl, 403 forbidden, help?
 
 hi all.
 
 i can't get apache to execute a perl/cgi script.
 
 *box: potato/sparc, installed apache-perl and its dependencies.
 
 *error: 403 forbidden in web browser. this in error log:
 
Options ExecCGI is off in this directory: 
 /home/herb/public_html/init/login.pl
 
 i tired everything in the faq and manual to little success. things
 i've tried:
 
 1) i've added the handler and options directives to my srm.conf:
 
   AddHandler cgi-script .cgi .pl
   Directory /
  Options +All +ExecCGI
   /Directory
 
i know +All and +ExecCGI are redudant and this is not secure, but
i'm desperate. =) 

 2) i tried pointing the directory to the exact directory where i'm
executing the script (i.e. / - /home/herb/public_html/init, my
script resides in init/) to no avail.
 
 3) i tried replacing the Directory directive w/
 
   ScriptAlias ~herb/public_html/init /home/herb/public_html/init
 
again, no effect.
 
 4) installing the 'apache' package instead of 'apache-perl'. it makes
me download the script.
 
 
 permissions look correct. all parents of the script directory are at
 least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
 (ScriptAlias'ed to cgi-bin/), but not elsewhere.
 
 HELP? any is appreicated...
 
 
 herbert
 



apache, perl, 403 forbidden, help?

2000-11-21 Thread Herbert Ho
hi all.

i can't get apache to execute a perl/cgi script.

*box: potato/sparc, installed apache-perl and its dependencies.

*error: 403 forbidden in web browser. this in error log:

   Options ExecCGI is off in this directory: 
/home/herb/public_html/init/login.pl

i tired everything in the faq and manual to little success. things
i've tried:

1) i've added the handler and options directives to my srm.conf:

  AddHandler cgi-script .cgi .pl
  Directory /
 Options +All +ExecCGI
  /Directory

   i know +All and +ExecCGI are redudant and this is not secure, but
   i'm desperate. =) 
   
2) i tried pointing the directory to the exact directory where i'm
   executing the script (i.e. / - /home/herb/public_html/init, my
   script resides in init/) to no avail.

3) i tried replacing the Directory directive w/

  ScriptAlias ~herb/public_html/init /home/herb/public_html/init

   again, no effect.

4) installing the 'apache' package instead of 'apache-perl'. it makes
   me download the script.


permissions look correct. all parents of the script directory are at
least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
(ScriptAlias'ed to cgi-bin/), but not elsewhere.

HELP? any is appreicated...


herbert



Re: apache, perl, 403 forbidden, help?

2000-11-21 Thread Chris Feist

SNIP
 1) i've added the handler and options directives to my srm.conf:
 
   AddHandler cgi-script .cgi .pl
   Directory /
  Options +All +ExecCGI
   /Directory
 
i know +All and +ExecCGI are redudant and this is not secure, but
i'm desperate. =) 


You shouldn't have a + in front of All and ExecCGI.  I'm not sure if 
you're just doing it for empahsis, but that could be your problem.

Make sure your permissions are at least 755.

 2) i tried pointing the directory to the exact directory where i'm
executing the script (i.e. / - /home/herb/public_html/init, my
script resides in init/) to no avail.
 
 3) i tried replacing the Directory directive w/
 
   ScriptAlias ~herb/public_html/init /home/herb/public_html/init
 
again, no effect.
 
 4) installing the 'apache' package instead of 'apache-perl'. it makes
me download the script.
 
 
 permissions look correct. all parents of the script directory are at
 least o+rx. i am able to execute scripts ok in /usr/lib/cgi-bin/
 (ScriptAlias'ed to cgi-bin/), but not elsewhere.
 
 HELP? any is appreicated...
 
 
 herbert
 
 
 -- 
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null


pgpSNG8hTeZuZ.pgp
Description: PGP signature


Re: apache, perl, 403 forbidden, help?

2000-11-21 Thread Rob VanFleet
It might be that you don't have it set up as a handler.
Look in /etc/apache/srm.conf for
AddHandler cgi-script .cgi

I think it's commented out by default. Just uncomment it, and change your
script's extenstion to .cgi (You could add .pl as a handler, but it's better
just to stick with cgi).

Hope that helps,
Rob