Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
apache and perl
View previous topic :: View next topic  
Author Message
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Fri Jan 25, 2008 8:43 pm    Post subject: apache and perl Reply with quote

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
View user's profile Send private message
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Fri Jan 25, 2008 9:20 pm    Post subject: Reply with quote

sorry! I did not realize I posted to first look. Please administrator move to support.

thanks Embarassed
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Sat Jan 26, 2008 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Wed Jan 30, 2008 6:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Thu Jan 31, 2008 1:15 am    Post subject: Reply with quote

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
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Thu Jan 31, 2008 7:52 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Thu Jan 31, 2008 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Wed Feb 06, 2008 1:15 am    Post subject: Reply with quote

thanks for all the input. I've been traveling so it took awhile for me to get back to you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional