View previous topic :: View next topic |
Author |
Message |
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Fri Jan 25, 2008 8:43 pm Post subject: apache and perl |
|
|
Hi,
I know apache is configured for perl support because I can run a perl script in firefox. But for the life of me, I can not see in the httpd.conf file how you configured perl support.
Could you please point me to where perl is configured for apache?
thanks much appreciated |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Fri Jan 25, 2008 9:20 pm Post subject: |
|
|
sorry! I did not realize I posted to first look. Please administrator move to support.
thanks |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sat Jan 26, 2008 10:02 am Post subject: |
|
|
Perl it's a program language such as python, web scripts usually run on cgi-bin with .cgi extension...
You should search for
AddHandler cgi-script .cgi
But no need to do anything if it's working...
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Wed Jan 30, 2008 6:15 pm Post subject: |
|
|
I am not changing anything. Just wanted to learn how you installed and configured perl support for apache.
thanks for your reply |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Thu Jan 31, 2008 1:15 am Post subject: |
|
|
Okay, I did a search of httpd.conf and found Addhandler. But its commented out. So, I would really like to know how apache knows perl exists.
It does work. I installed a program called easyauction, written in perl. And it runs perfectly. I just would like to know how apache knows how to use perl.
I can not find anything in httpd.conf that points to perl. Hope I am not being a pain, but I would like to learn.
thanks |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Thu Jan 31, 2008 7:52 am Post subject: |
|
|
When compiling apache amongst a lot of things you add
--enable-cgi option, I thing that is what you are looking...
the AddHandler option is for handling .cgi scripts outside cgi-bin/ directory.
there is a module called "mod_perl" but neither PAT (Slackware) or I have configure apache with that module.
With that module you can add perl code inside httpd.conf e.g.
Code: | NameVirtualHost 192.168.0.1:80
<Perl>
my $config = "/etc/apache/vhosts.txt";
open HOSTS, $config or die "Failed to open $config: $!";
while (<HOSTS>) {
my %config;
my @params = qw/ServerName DocumentRoot ErrorLog TransferLog ServerAdmin/;
@config{ @params } = split /\t/;
$config{ Directory }{ $config{DocumentRoot} } = { Allow => 'from all' };
push @{ $VirtualHost{'192.168.0.1:80'} }, \%config;
}
close HOSTS;
</Perl> |
But you can add it if you like, you don't need to recompile apache for adding mod_perl.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Thu Jan 31, 2008 10:59 am Post subject: |
|
|
Mod_Perl Package is available here
and here is the Slackbuild
Code: | #!/bin/bash
PKG=/tmp/pkg-mod_perl
TARGZ=mod_perl-2.0-current.tar.gz
if [ -f mod_perl-2.0-current.tar.gz ]; then
echo Package found
else
wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
fi
tar -xf $TARGZ
rm -rf $PKG
mkdir -p $PKG/install
cd mod_perl-2.0.3
perl Makefile.PL \
MP_APXS=/usr/sbin/apxs
make && make test
make install DESTDIR=$PKG
cd $PKG
echo "
#!/bin/bash
echo \"# Uncomment the following line to enable mod_perl support
LoadModule perl_module lib/httpd/modules/mod_perl.so\" >> /etc/httpd/httpd.conf
apachectl restart" > $PKG/install/doinst.sh
makepkg -l y -c n mod_perl-2.0.3-1sms.tgz |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Wed Feb 06, 2008 1:15 am Post subject: |
|
|
thanks for all the input. I've been traveling so it took awhile for me to get back to you. |
|
Back to top |
|
|