LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2009, 09:16 PM   #1
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Rep: Reputation: 0
Unhappy problem getting perl working with apache2 cgi script


I am struggling trying to get awstats working on my vps site

I installed mod_perl and configured httpd.conf

when I access mysite.com/cgi-bin/test.pl it offers to download it

as if it did not know what a .pl file was

there are no errors in error_log

here is relevant parts of my http.conf




LoadModule perl_module modules/mod_perl.so
AddType application/x-httpd-perl .pl .p

<Directory "/usr/lib/cgi-bin">
AllowOverride ALL
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Order allow,deny
Allow from all
</Directory>

//ifmodule alias_module
ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"

//ifmodule mime_module
AddHandler cgi-script .cgi .pl



Pleeease need help :{
 
Old 04-12-2009, 01:38 PM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Does awstats directory reside in /usr/lib/cgi-bin? Are the directories set to executable?
You better shouldn't have installed mod_perl. It is more complicated to work with mod_perl all in all and you don't need it to run CGI scripts.
You could run
apachectl configtest
to see if it spits out warnings in respect of the configuration.
 
Old 04-14-2009, 03:06 PM   #3
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Original Poster
Rep: Reputation: 0
I tried setting usr usr/lib and /usr/lib/cgi-bin to executable, I do it through nautalis on ubuntu and make the checkbox dark plus a check mark.

yes awstats.pl is in /usr/lib/cgi-bin also a file called test.pl which is not executing.

I tried apachectl command but it is not found on my debian vps. I have tried entering /usr/local/apache2/bin directory to execute it there but it is still not found. I will keep looking for it

should I uninstall mod_perl?

will it revert to perl if it was already installed?
 
Old 04-14-2009, 03:13 PM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
you don't need to uninstall mod_perl but I think you better comment out the
LoadModule mod_perl line in the conf and restart the server.
If you load mod_perl then you have to configure apache according to mod_perl2 rules, name a PerlHandler PerlRun or similar. But mod_perl for apache1 and 2 are different and one has to read a while to get that started.
So if awstats is the only thing to work with perl you are better off using CGI.

apachectl is probably /usr/sbin/apache2ctl
at least you could give that a try,
good luck

Last edited by j-ray; 04-14-2009 at 03:18 PM.
 
Old 04-15-2009, 01:14 PM   #5
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Original Poster
Rep: Reputation: 0
I commented out

LoadModule perl_module modules/mod_perl.so


still same problem with browser offering to down load file

still can't find apache2ctl

any suggestions?

Perl is installed
 
Old 04-15-2009, 02:57 PM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

That's the default of debian/ubuntu I guess and it works fine. /etc/apache2/sites-enabled/000-default. No AddHandler, AddType application...
 
Old 04-16-2009, 08:39 AM   #7
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks J-ray but I do not have a sites-enabled/000-default file

if I created it what would I put in it?

what about addhandler and adtype, I currently have them in httpd.conf
should I remove them?
 
Old 04-16-2009, 08:50 AM   #8
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Original Poster
Rep: Reputation: 0
well I commented out addhandler and addtype (.pl) line in httpd.conf
and created 000-default.conf
I notice this file is included at the end of httpd.conf.

I restarted apache and still the same problem

I am also using this code now

<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
 
Old 04-16-2009, 08:53 AM   #9
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
The ".../sites-enabled/default000" is a default config file that is included by apache2.conf in some distributions.
How did you install apache2? If you are using a debian based system you can simply type

sudo apt-get install apache2

and get a working http server with a configured cgi-bin...

How do you call the script?
 
Old 04-16-2009, 08:55 AM   #10
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
How do you call the script?
 
Old 04-17-2009, 08:30 AM   #11
jabberwok
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Original Poster
Rep: Reputation: 0
It was pre-installed on a vps. I think it was a source install /usr/local/apache2 is the server root directory

Maybe I should see if I can remove then install again using apt, but I dont know if this will hurt the site I have created.

mysite.com/cgi-bin/test.pl

Last edited by jabberwok; 04-17-2009 at 02:37 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd CVS checkout problem from CGI perl script spadesmaster Linux - Software 0 04-27-2007 04:19 PM
Apache2 on Debian won't execute perl cgi scripts, have tried chmod, Options ExecCGI dewert Linux - Software 1 07-03-2006 12:44 PM
PERL: cgi script copy problem from server to another <db> Programming 2 04-16-2006 09:14 PM
CGI-script problem on Apache2 jkt2000 Linux - Networking 3 01-28-2005 04:38 AM
Apache2 CGI-Perl will not read files fefeh Linux - Software 0 06-30-2003 08:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration