[TriLUG] Apache with mod_perl

William Sutton william at trilug.org
Wed Dec 14 09:52:14 EST 2005


Someone correct me if I'm wrong (no doubt you will :) ) but...

shouldn't the ScriptAlias path (e.g., /var/www/cgi-bin) point to the 
location where the perl program is?  that is, shouldn't it be 
/var/www/cgi-bin where the perl code goes rather than /usr/lib/cgi-bin/ ?

-- 
William Sutton

On Tue, 13 Dec 2005, Corey wrote:

> O.K., I see what I was missing...Owen gave this
> 
> ScriptAlias /cgi-bin/  /var/www/cgi-bin/
> 
> <Directory /var/www/cgi-bin>
>      AllowOverride None
>      Options None
>      Order allow,deny
>     Allow from all
> </Directory>
> 
> but I needed to add within <Directory></Directory>
> Options +ExecCGI
> 
> However, I am still having to place the .pl into /usr/lib/cgi-bin/  (default
> location)
> 
> Any ideas?
> 
> 
> On 12/13/05, Cristobal Palmer <cristobalpalmer at gmail.com> wrote:
> >
> > >From man chmod:
> >
> > "Any  omitted  digits  are assumed  to  be leading zeros."
> >
> > I was <blink>not</blink> wrong.
> >
> > :)
> >
> > On 12/13/05, Cristobal Palmer <cristobalpalmer at gmail.com> wrote:
> > > I should clarify (per the link Owen Berry provided):
> > >
> > > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> > >
> > > is telling the server that requests for
> > > http://myImaginaryDomain.org/cgi-bin/ should be pointed to the Linux
> > > directory named /var/www/cgi-bin/
> > >
> > > That is, there is no Linux directory named /cgi-bin/ BUT there is a
> > > /var/www/cgi-bin/
> > >
> > > So if you're going to be changing the permissions on something, it
> > > should be /var/www/cgi-bin/
> > >
> > > -CMP
> > >
> > > On 12/13/05, Cristobal Palmer <cristobalpalmer at gmail.com> wrote:
> > > > > sudo chmod 0755 /var/www /cgi-bin/ and sudo chmod 0755
> > > > > /var/www/cgi-bin/env_variables.pl.
> > > >
> > > > Why do you have that leading zero? I think it should be "sudo chmod
> > > > 755 foo" (where foo is the file/directory you are trying to change).
> > > > Also, I think you're trying to give the full path "/var/www/cgi-bin"
> > > > instead of the path "/var/www/" and the non-existent "/cgi-bin/"
> > > > (unless that space is a typo).
> > > >
> > > > -CMP
> > > >
> > > > >
> > > > > Still no luck, any ideas why the script won't execute?
> > > > >
> > > > > On 12/13/05, Corey <ohkeepah at gmail.com> wrote:
> > > > > >
> > > > > > is there a space in the first line between /cgi-bin/ and
> > > > > > "/var/www/cgi-bin/"?  There isn't any reference to scriptalias in
> > the
> > > > > > apache2.conf yet so i can just place it there?
> > > > > >
> > > > > > On 12/13/05, Owen Berry <oberry at trilug.org> wrote:
> > > > > > >
> > > > > > > What you're looking for in your Apache config files is something
> > like
> > > > > > > this:
> > > > > > >
> > > > > > > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> > > > > > >
> > > > > > > <Directory "/var/www/cgi-bin">
> > > > > > >     AllowOverride None
> > > > > > >     Options None
> > > > > > >     Order allow,deny
> > > > > > >     Allow from all
> > > > > > > </Directory>
> > > > > > >
> > > > > > > Thus, you could place your Perl script in /var/www/cgi-bin/ and
> > call it
> > > > > > > as http://localhost/cgi-bin/script.pl
> > > > > > >
> > > > > > > Note that this is CGI, which is not the same as mod_perl. Here
> > is a
> > > > > > > handy reference if you want to see what mod_perl is:
> > > > > > > http://modperlbook.org/index.html. Indeed, the first chapter is
> > > > > > > "Introducing CGI and mod_perl".
> > > > > > >
> > > > > > > Owen
> > > > > > >
> > > > > > > On Tue, 2005-12-13 at 14:29 -0500, Corey wrote:
> > > > > > > > Hi,
> > > > > > > > I am setting up a testing web server on an Averatec 3270
> > running
> > > > > > > > Ubuntu 5.04and Apache 2.  The goal is to use it to test perl
> > scripts
> > > > > > > > (just learning) as
> > > > > > > > well as php and mysql.  So far I have installed apache, php,
> > mod_perl
> > > > > > > and
> > > > > > > > mysql through apt-get.  The testphp.php script works fine as
> > well as
> > > > > > > mysql
> > > > > > > > but I don't know how to configure apache to run perl
> > scripts.  I don't
> > > > > > > have
> > > > > > > > a cgi bin, or if one is there I don't know where it is.  Could
> > anyone
> > > > > > > > instruct me what I would have to do in apache2.conf to execute
> > .pl
> > > > > > > scripts
> > > > > > > > and where i need to put a cgi directory?  http://localhost is
> > directed
> > > > > > > to
> > > > > > > > /var/www/.
> > > > > > > > corey
> > > > > > >
> > > > > > > --
> > > > > > > TriLUG mailing list        :
> > > > > > > http://www.trilug.org/mailman/listinfo/trilug
> > > > > > > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > > > > > > TriLUG Member Services FAQ :
> > http://members.trilug.org/services_faq/
> > > > > > >
> > > > > >
> > > > > >
> > > > > --
> > > > > TriLUG mailing list        :
> > http://www.trilug.org/mailman/listinfo/trilug
> > > > > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > > > > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Cristobal M. Palmer
> > > > UNC-CH SILS Student
> > > > cristobalpalmer at gmail.com
> > > > cmpalmer at ils.unc.edu
> > > > ils.unc.edu/~cmpalmer
> > > > "Television-free since 2003"
> > > >
> > >
> > >
> > > --
> > >
> > > Cristobal M. Palmer
> > > UNC-CH SILS Student
> > > cristobalpalmer at gmail.com
> > > cmpalmer at ils.unc.edu
> > > ils.unc.edu/~cmpalmer
> > > "Television-free since 2003"
> > >
> >
> >
> > --
> >
> > Cristobal M. Palmer
> > UNC-CH SILS Student
> > cristobalpalmer at gmail.com
> > cmpalmer at ils.unc.edu
> > ils.unc.edu/~cmpalmer
> > "Television-free since 2003"
> > --
> > TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> >
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> 
> 



More information about the TriLUG mailing list