Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie puzzled by mod-perl

Status
Not open for further replies.

Newposter

Technical User
May 9, 2002
735
US
Installed linux distro with mod-perl selected. Successfully enabled Apache running web site with internal IP address, except .cgi wouldn't run. Checked permissions and AddHandler, all OK; found that PERL path is invalid (default when I ran this script on 3rd party host was /usr/local/bin/perl). This path is empty. What do I need to do to find the path and enable script? What is the difference between installing PERL separately vs mod-perl (bear in mind that I don't know some of these acronyms). Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
You still need to install perl on your system. Mod _perl requires it. You also need the mod_perl version that is designed for your apache version. For example, if you are running apache 1.x.x then you need mod_perl version 1.x. Mod_perl is not an either/or for perl. It is used by apache for inline perl functions. It allows apache to use 3rd party modules written in perl without having to access the main perl interpreter. It also allows you to have perl script whin your httpd.conf. You should be able to get the version of perl for your distro at or from the home website of your linux distro.
 
Thanks. That leads to another question. In unix, where does one commonly save downloaded modules in preparation for installation? Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Either [tt]/usr/src[/tt] or [tt]/usr/local/src[/tt] is used for source installation files. For example, the linux kernel source code is typically in kept in [tt]/usr/src/linux[/tt].

jaa
 
RhythmAce, PERl WAS installed - just in a different location from what I had seen in previous linux installations.

So, found the perl command, tested it with hello.pl and it's active. Fixed the shebang and now got this error:

Internal Server Error

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

Please contact the server administrator, me@domain.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.

Error log in Apache shows:

Premature end of script headers: index.cgi, referer:
So I had read before that the script needed modification as follows:

The .cgi file has at the beginning:

#!/usr/bin/perl
print "Content-type: text/html\n";


The "print" line was later in the file, but needed to be moved up to right after the shebang. Note that this script was proven to work on an earlier version of linux from the same company. It had to be modified for the newest version. Thanks to all in this forum and others who helped!
Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top