[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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 <hoherbe@charlie.cns.iit.edu>
> To: Ernest Johanson <ejohan@fuller.edu>
> 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;
>    <html><body>
>    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 <hoherbe@charlie.cns.iit.edu>
> > > 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 debian-user-request@lists.debian.org 
> > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 



Reply to: