Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2003, 08:36 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default Can't find Perl!!

I am helping janeth troubleshoot some script for an input to sendmail using "formmail".
First was 'Internal Server error"

I was able to figure out that the file had to be named .cgi and got " #!/usr/local/bin/perl " figured out in the script.

I then got "No Permission to View" type errors, so I learned to SSH (after trying telneting all day which I also had to learn!) and set file permissions.

I , of course, did ' chmod 755 FormMail.cgi ' , and then tried page again.

Back to "500 Internal Error" message.

I then queried " which perl" and got this:
" no perl in (/bin:/usr/local/bin:/usr/bin:.) "!

It is apache running linux, I've never done this before, what the heck! I used a script to test if perl is working, both it and formmail work on
my server, so I know that the script is proper.

It just seems odd that I would get a "permission" error, then get the "500" error again. All I can think is that the file was ftp'ed in binary. I used dreamweaver, it works on my Win2K server, I'm Needing help, please!
It's for janeth's site, and my learning. Thanks very much !
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #2 (permalink)  
Old 11-20-2003, 04:46 PM
Narasinha's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 306
Narasinha RepRank 1
Default Perl problems

The dreaded "500 Internal Server Error" can truly be a nightmare. The error itself gives you no information about what caused the error. If you have access to the server logs, the log entries may be able to help with tracking down the actual problem.

The first thing I would check is to see if any Perl CGI at all will work. A simple script to display the webserver's environment variables would be helpful. Here's one that I use:

Code:
#!/usr/bin/perl
############################################
# envcheck.cgi - Check environment variables
############################################

############################################
# Main Program Routine
############################################

&header;
print <<"EOT";
<table border="1" cellpadding="1" cellspacing="1">
<tr><td align="center">Variable</td><td align="center">Contents</td></tr>
EOT
foreach $key (sort keys(%ENV)) {
  print "<tr><td>$key</td><td>$ENV{$key}</td></tr>";
}
print <<"EOT";
</table>
EOT
&footer;

exit (0);

############################################
# Subroutines used in this program are below
############################################

############################################
# Print HTTP and HTML header information

sub header {
  print <<"EOT";
Content-type: text/html

<html>
<head>
  <title>Environment Variable Check</title>
</head>
<body BGCOLOR="#FFFFFF" TEXT="#000000">
EOT
}

# end of sub header
############################################

############################################
# Print HTML footer

sub footer {
  print <<"EOT";
</body>
</html>
EOT
}

# end of sub footer
############################################
Another problem may be in the method the script is using to send the mail. The Unix "sendmail" program is pretty much the standard method, but some servers have this program disabled to prevent sending spam from their server.

If you need more assistance with this problem, feel free to let me know. There may be some special settings required for janeth's server. Oh.. That reminds me... There was a problem executing Perl on one server where I have a few things. I found that I had to add an ".htaccess" file to the cgi-bin directory in order to allow execution. Here are the contents of that file:

Code:
Options +ExecCGI
AddHandler cgi-script cgi pl
This file instructs the server to allow perl execution in that directory and all sub-directories.

Best Regards,
Narasinha
Reply With Quote
  #3 (permalink)  
Old 11-21-2003, 01:19 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default Thanks narasinha

I just got back online and got notified of your reply.

Thanks very much, I will get to work and get back to you!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #4 (permalink)  
Old 11-21-2003, 01:37 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

Ya, 500 errors ?!
Can't say I'm a fan of perl.

You should do a php version of the formmail. LOL!
__________________
|
Web Hosting Guru
| Need Help For Your Forum?
Reply With Quote
  #5 (permalink)  
Old 11-21-2003, 01:38 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default Oh well!

Well, I tried the script you posted here, got "no permission".
Then put ".htaccess" in cgi-bin, and then got "500" error! I named it .cgi, I'll try .pl and try all the common variations of : #!/usr/bin/perl.

Is there an installation file for perl that I could check - to see if it is there? I can 'see' the Apache folder etc.
Come to think of it, this IS weird!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #6 (permalink)  
Old 11-21-2003, 01:39 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Hi cyanide!!!!!

No PHP!!!! Tried!!!!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #7 (permalink)  
Old 11-21-2003, 01:46 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Here is what I found when I ran the block owner's servers, the one I'm working on is number 10 :

1 http://uptime.netcraft.com/up/graph?...undcompany.net 223 244 227 Linux Apache/1.3.12 (Unix)
2 http://uptime.netcraft.com/up/graph?...ter-strike.com 136 170 171 Linux Apache
3 http://uptime.netcraft.com/up/graph?....meet-here.com 3 76 4 Linux Apache/1.3.26 (Unix)
4 http://uptime.netcraft.com/up/graph?site=www.sis-us.net 2 136 5 Linux Apache/1.3.26 (Unix) PHP/4.2.3 mod_perl/1.26 FrontPage/5.0.2.2510
5 http://uptime.netcraft.com/up/graph?...fieldgroup.com 2 7 5 Linux Apache/1.3.26 (Unix)
6 http://uptime.netcraft.com/up/graph?...he-shadows.com 1 101 0 Linux Apache/1.3.26 (Unix) PHP/4.2.3
7 http://uptime.netcraft.com/up/graph?...iointernet.net - 6 1 Linux Apache/1.3.26 (Unix) mod_perl/1.26
8 http://uptime.netcraft.com/up/graph?...ww.edynamo.com - 6 3 Linux Apache/1.3.26 (Unix) PHP/4.2.3 mod_ssl/2.8.14 OpenSSL/0.9.6b
9 http://uptime.netcraft.com/up/graph?...w.ultrajay.com - 5 5 Linux Apache/1.3.26 (Unix)
10 http://uptime.netcraft.com/up/graph?...connection.com - 5 5 Linux Apache/1.3.26 (Unix)
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #8 (permalink)  
Old 11-21-2003, 03:18 AM
Narasinha's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 306
Narasinha RepRank 1
Default CGI help

Hi mikmik,

I found someplace that may be of help, if what I deduced is correct.

From what I can tell, hosting for that site is done through worldaxxs.net. I wasn't able to bring up their regular site, but I did find a help site. The URL for their FAQ for CGI is http://support.worldaxxs.net/cgi-bin...=CGI%20scripts. Main FAQ is at http://support.worldaxxs.net/cgi-bin/mod-perl/faq200. According to their FAQ, the path to perl should simply be "/bin/perl", so the first line of the script should have "#!/bin/perl". Also, there was mention of setting permissions on the cgi-bin folder itself to 755. The upload folder specified for CGI scripts is "/usr/local/apache/cgi-bin". The following is something I don't know about. You'll have to ask janeth:

Why does my perl script give an error?
If you're sure the script is configured properly, the most common reasons are:
1. The Perl value application has not been installed from the domain's web GUI.

Best I can do for now. It's bedtime. See ya in about 8 hours or so.

Narasinha
Reply With Quote
  #9 (permalink)  
Old 11-21-2003, 05:07 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default You are MAGIC!

That is it!!

I was browsing the hard drive directory structure and that all looks familiar. I just don't know how to recognize a perl installation.

Also, narasinha, thanks for finding the support pages. I knew it was 'worldaxxs' but couldn't find anything on google or else got '404' error when typing 'worldaxxxs.net' etc. in address bar.

I'm very optimistic, now.
Janeth is going to hear about this, as well as Steve Glover!!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags:



Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0