LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-04-2004, 07:27 PM   #1
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Rep: Reputation: 30
Question CGI / Perl Internal Server Error


I am running a RH 9 server. I am having some trouble. My server will not run CGI or Perl.

Whenever I try to run it I get this message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, cpellizzi@aol.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.40 Server at server.myserver.com Port 80

Could someone please help me?
Any help would be great.

Thanks,
 
Old 08-04-2004, 08:05 PM   #2
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
How did you set it up?

I used Apache 1.3.28 on RH 9 and yes I took notes.

http://www3.sympatico.ca/arothmel/ht...l.html#Perl101

I wrote this quite some time ago but the install was successful,
maybe you can find info that will help you with Apache 2.x

Search for the bit:
ReBuild Apache to include mod_perl

I do remember having problems with CPAN and opted to build
manually.....

Apache configuration

The Apache script I will be running will have two new parameters, but first be sure to build mod_perl first.


--activate-module=src/modules/perl/libperl.a \
--enable-module=perl


Hope this helps,
alar

Last edited by alar; 08-04-2004 at 10:36 PM.
 
Old 08-04-2004, 10:53 PM   #3
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
By the way I don't think perl is the problem. I have a website administration tool called webmin. It has some perl in it and it runs fine. It is just the things in the cgi-bin that will not run. Even the simplest of scripts.

Thanks,
 
Old 08-04-2004, 11:16 PM   #4
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
Again old stuff not fresh in my mind but:
http://www3.sympatico.ca/arothmel/ht...he_SSICGI.html

Search for:
Implementing CGI Scripts

If you still have troubles, I would be interested in determining why....

alar
 
Old 08-04-2004, 11:21 PM   #5
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
Could it be my perl.conf file?

This is what it looks like:
#
# Mod_perl incorporates a Perl interpreter into the Apache web server,
# so that the Apache web server can directly execute Perl code.
# Mod_perl links the Perl runtime library into the Apache web server
# and provides an object-oriented Perl interface for Apache's C
# language API. The end result is a quicker CGI script turnaround
# process, since no external Perl interpreter has to be started.
#

LoadModule perl_module modules/mod_perl.so

# This will allow execution of mod_perl to compile your scripts to
# subroutines which it will execute directly, avoiding the costly
# compile process for most requests.
#
#Alias /perl /var/www/perl
#<Directory /var/www/perl>
# SetHandler perl-script
# PerlHandler ModPerl::Registry::handler
# PerlOptions +ParseHeaders
# Options +ExecCGI
#</Directory>

Thanks,
 
Old 08-04-2004, 11:41 PM   #6
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
Looks the same as mine.

Sorry I can't help you. I would check Apache next

http://httpd.apache.org/docs-2.0/mod/

http://httpd.apache.org/docs-2.0/mod/mod_cgi.html


Good luck

alar
 
Old 08-04-2004, 11:53 PM   #7
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
Hey thanks alot for you help but I just fixed the problem. I don't know if its the right way but at least it works!!!

Heres what I changed it too:

#
# Mod_perl incorporates a Perl interpreter into the Apache web server,
# so that the Apache web server can directly execute Perl code.
# Mod_perl links the Perl runtime library into the Apache web server
# and provides an object-oriented Perl interface for Apache's C
# language API. The end result is a quicker CGI script turnaround
# process, since no external Perl interpreter has to be started.
#

LoadModule perl_module modules/mod_perl.so

# This will allow execution of mod_perl to compile your scripts to
# subroutines which it will execute directly, avoiding the costly
# compile process for most requests.
#
Alias /cgi-bin /var/www/cgi-bin
<Directory /var/www/perl>
SetHandler perl-script
PerlHandler ModPerl::Registry::handler
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

Thanks again,
 
Old 08-05-2004, 12:02 AM   #8
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
Kewl.
 
Old 09-14-2004, 08:51 PM   #9
mindfrost82
Member
 
Registered: Apr 2003
Distribution: Slackware
Posts: 60

Rep: Reputation: 15
Try my walkthrough:

http://www.mindfrost82.com/forums/showthread.php?t=737

You may want to search your system for apsx since it might not be in the same place as it is in Slackware.
 
Old 09-23-2004, 10:45 AM   #10
David Mann
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Rep: Reputation: 0
Perl, Mod_Perl and Apache configuration

Just wanted to say a big thank you for the tip on this thread. I've spent several hours trying to configure Apache to allow me to run Perl CGI scripts on Fedora Core 2. I messed around with /etc/httpd/conf/httpd.conf for ages and tried setting permissions using Konqueror and chmod from terminal but nothing worked. I downloaded various distributions of Apache and Mod_Perl but upgrading to newer versions of Mod_Perl didn't help.

Lines like this in the httpd.conf file seemed crucial:

#ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
#<Directory "/var/www/cgi-bin">
# AllowOverride None
# Options ExecCGI FollowSymLinks
# Order allow,deny
# Allow from all
# SetHandler cgi-script
#</Directory>

These weren't commented out of course - at the moment they're commented out because of the tip I got from this thread.

Nobody mentioned /etc/httpd/conf.d/perl.conf in any of the tutorial or bits of documentation I read. perl.conf has a similar <Directory> directive and it was easy to remove the comment marks and set the cgi-bin as needed.

The original had something like this:
Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

I added this because my colleague has code which assumes the perl scripts will be in the cgi-bin directory

Alias /cgi-bin /var/www/cgi-bin
<Directory /var/www/cgi-bin>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

This is a little different to the syntax in Apache's configuration file so copying and pasting did the trick.

I presume this is because of the presence of mod_perl. I would like to see if I uninstall mod_perl whether this perl.conf file then becomes inactive.
 
Old 09-26-2004, 02:50 AM   #11
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
Yes, It took me a while too to figure that one out. I'm pretty new to linux but I was just playing with Webmin trying to get it working and under edit apache files I clicked on perl.conf uncommented the lines and bingo.

Thanks,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl-CGI 500 Error tzarcone Programming 1 07-01-2005 02:45 AM
Perl: Internal Server Error! Jake_B Linux - Software 0 12-26-2004 01:37 PM
HELP! CGI problem : HTTP 500 - Internal server error eech55 Programming 2 10-11-2004 11:27 AM
CGI Internal server error newuser455 Linux - General 2 06-10-2004 09:39 PM
Executing a program on server using CGi/PERl ?! avios Red Hat 1 12-29-2003 02:34 AM


All times are GMT -5. The time now is 05:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration