Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Admin.cgi problem

Quote Reply
Admin.cgi problem
When i try to access admin.cgi the browser asks me where to Save it. It wont display it in the browser.

I downloaded it and the following showed up :
"Error including libraries: syntax error at links.cfg line 69, near "= |"

Make sure they exist, permissions are set properly, and paths are set correctly."

Would anyone know what this means, as far as i know the links.cfg has been setup correctly (following the steps in the readme.txt).

Thanks.
tel.

Quote Reply
Re: Admin.cgi problem In reply to
having read some other posts i realised it would be better to show the lines that are at fault :

Line 68: # PATH of sendmail. # SMTP Server
Line 69: $db_mail_path = /bin/easymail; $db_smtp_server = '';

thanks in advance.



Quote Reply
Re: Admin.cgi problem In reply to
You are not using the correct syntax for the $db_mail_path variable configuration...

It should be:

Code:

$db_mail_path = '/bin/easymail';


And that is the strangest sendmail path I've ever seen...I would double check and make sure that is the correct path to your sendmail program.

Regards,

Eliot Lee

Quote Reply
Re: Admin.cgi problem In reply to
Like Eliot said, if you are having problems finding the correct path to your sendmail program, I found this nifty little script that you can use to find the location of everything on your server. just cut and paste into any text editor and save as tesbin.cgi (copy all the way down to the final bracket).

#!/usr/bin/perl

# DO NOT EDIT code below this line!!

# The first line above must be a call to the location of your PERL 5 program.
# This MUST BE CORRECT - view installed scripts or consult Hosts Manual.
# FTP upload as an ASCII file to your CGI-BIN and set permissions to chmod 755
# CALL as "http://www.yourdomain.name/cgi-bin/testbin.cgi
# CHANGE this next line to the correct URL to this program

$sriptURL = "http://www.yourdomain.name/cgi-bin/testbin.cgi";

# DO NOT LEAVE this program on your site - delete after use!!!
# Australian/International copyright Ron F Woolley 2000

$field{'mailpth'} = "/usr/lib/sendmail"; my $cnvrt; my $boo = "
"; &GetFormInput;
&is_mail if $field{'mailpth'} && $field{'email'} && $field{'send'};
print "Content-Type: text/html\n\n";
open (FLE, $0);@p1 = <FLE>;close (FLE);($pl = $p1[0]) =~s/\n//g if $p1[0] =~ /^#!\//;
if (-e "C:/" || $^O =~ /MSWin32/i) {$is32 = " on Win32:NT!";}
if (($ENV{'REMOTE_ADDR'} eq $ENV{'REMOTE_HOST'} || !$ENV{'REMOTE_HOST'}) && $ENV{'REMOTE_ADDR'} =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) {
$pk = pack('C4', $1, $2, $3, $4); $cnvrt = (gethostbyaddr($pk, 2))[0]; if ($cnvrt) {$ENV{'REMOTE_HOST'} = $cnvrt;} }
if ($] =~ /^5/ && !$is32) {
$t1 = "<p>If you can read this page then the cgi-bin and

this script have executed without errors. Your

CGI-BIN is set up and working correctly.

<p>If installing dtp-aus.com scripts, you can now

try the makedir.cgi script to create directories

and empty files, ready for FTP uploading of all

the files supplied (see readme.htm)."; }
elsif ($] && $] !~ /^5/ && !$is32) {
$t1 = "<p>If you can read this page then the cgi-bin and

this script have executed without errors. Your

CGI-BIN is set up and working correctly.

<p><font color=#FF0000>However, $pl is

is NOT calling Perl versions 5. My dtp-aus.com

scripts are written for Perl Version 5. Contact

your Host Service for the correct path to Perl 5<BR>
on your server.</font>"; }
elsif ($is32) {
$t1 = "<p><font color=#FF0000>My dtp-aus.com Perl 5 scripts are not written for

<B>MS NT</B>, nor do they currently receive any support

for that operating system.</font>

<p>But, if you can read this page then the cgi-bin

and this script have executed without errors. Your

CGI-BIN is set up and working correctly."; }
elsif (!$]) {
$t1 = "<p><font color=#FF0000><B>Your Perl Version could not be ascertained

for installation verification.</B></font>

<p>But, if you can read this page then the cgi-bin

and this script have executed without errors. Your

CGI-BIN is set up and working correctly."; }
else {$t1 = "<p><font color=#FF0000><B>Details could not be ascertained.</B></font>";}
print qq~<html><head><title>Unix CGI-BIN Perl 5 Test</title><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"></head><body bgcolor="#d5d5d5" text="#000000">
<center>$boo<table width="550" border=0 cellspacing=0 cellpadding=2><tr><th bgcolor="#cc0000"><font face="courier new,courier" size="3" color="#ffffff"><b>$pl<BR>Perl $]$is32</b></font></th></tr><tr><td align=center
bgcolor="#cc0000"><table width="100%" border=0 cellspacing=0 cellpadding=6><tr><td nowrap bgcolor="#ffffff">
<font face="courier new,courier" size="3"><small>Absolute path : $ENV{'SCRIPT_FILENAME'}</small>
$t1<p><em>Thank You</em><BR>Ron Woolley - <small>www.dtp-aus.com / www.hostingnet.com</small></font></td></tr></table></td></tr></table></font>
<center><table width="550" cellspacing="0" cellpadding="4" border="0"><tr><td width="100%" align="center"><font face="arial, geneva, helvetica" size="2">

If the latest v5 of perl is not reported above, try another (<i>first line, top of the script</i>).

<b>**</b> <b>From <u>most</u> servers a list should have been created below</b>.
</font></td></tr><tr><td width="100%" valign="TOP" bgcolor="#EFEFEF">
<font face="arial, geneva, helvetica" size="2"><b>To check your Sendmail program, enter the path in the first box.</b>
IF A CRASH OCCURS then use the back arrow to return and try another. BUT IF this

page reappears then check your e-mail where a simple letter should arrive within minutes.
</font></td></tr><tr>
<td width="100%" valign="TOP" align="CENTER" bgcolor="#EFEFEF"><font face="arial, geneva, helvetica" size="2"></font><form method="POST" action="$sriptURL">
<font face="arial, geneva, helvetica" size="2">The <b>PATH</b> to your servers "Sendmail" program</font>
<input type="text" name="mailpth" size="35" maxlength="65" value="$field{'mailpth'}">
<font face="arial, geneva, helvetica" size="2"><b>Your E-Mail</b> address ( <i>double check it</i> )</font>
<input type="text" name="email" value="" size="35" maxlength="65">
<input type="submit" name="send" value="Test Sendmail Path">
<input type="reset" value="reset form"></form></td></tr><tr><td width="100%" valign="TOP"><font face="arial, geneva, helvetica" size="2"> <b>* </b><i>malfunctioning server Sendmail set up can receive without error BUT not send!!</i>

NOTE: Some servers might report the Sendmail path below.
** <i>perl paths may be listed below from some servers but not the sendmail path.</i></font></td></tr></table></center>~;
print qq~<p><table width=550 border=0 cellspacing=0 cellpadding=2><tr><td bgcolor=#E5E5E5><blockquote>~;
$mprog =`whereis sendmail`;
$path =`whereis perl`;
@chked1 = split(" ",$mprog);
@chked2 = split(" ",$path);
$is = `which perl`;
$mis = `which sendmail`;
print qq~<p><b>Perl Path</b>(s)
~; foreach $s2 (@chked2) {print "&#149; $s2
";}
print qq~<b>Default Perl</b> : $is
<b>Sendmail Path</b>(s)
~; foreach $s2 (@chked1) {print "&#149; $s2
";}
print qq~<b>Default Sendmail</b> : $mis
</blockquote></td></tr></table><hr width=\"550\"></center></body></html>~;

exit(0);
sub is_mail {
my ($mprog,$rec,$tm); $tm = localtime(time);
$mprog = "$field{'mailpth'}";
$rec = "$field{'email'}";
if (open (MAIL, "|$mprog -t")) {
print MAIL "To: $rec\n";
print MAIL "From: $rec\n";
print MAIL "Subject: TESTBIN.CGI\n";
print MAIL "\n\n";
print MAIL "--------------------------------\n" ;
print MAIL " This is just test blurb.\n Your Sendmail path worked!!\n \"$field{'mailpth'}\"\n" ;
print MAIL "--------------------------------\n" ;
print MAIL " IP# < $ENV{'REMOTE_ADDR'} >\n Host < $ENV{'REMOTE_HOST'} >\n $tm\n\n";
close (MAIL);
$boo = "<p><b>Mail 'attempt' passed</b> - check your mail</p>"; }
else {$boo = "<p><b>Could not open Sendmail!</p>";}
}
sub GetFormInput {
if ( $ENV{'REQUEST_METHOD'} eq 'GET' ) { $buffa = $ENV{'QUERY_STRING'}; }
elsif ( $ENV{'REQUEST_METHOD'} eq 'POST' ) { read(STDIN,$buffa,$ENV{'CONTENT_LENGTH'}); }
else { print "Content-Type: text/html\n\n"; print "<html><head><title>OOOPs!</title><meta HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\"></head><body bgcolor=#FFFFFF text=#CC0000><center><h3>Use ONLY GET or POST method!</h3></center></body></html>"; exit(0);}
@bvals = split(/&/,$buffa);
foreach $i (0 .. $#bvals){
($name,$val) = split (/=/,$bvals[$i],2);
$val=~tr/+/ /;
$val=~ s/%(..)/pack("c",hex($1))/ge;
$name=~tr/+/ /;
$name=~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/~!/ ~!/g;
$val =~ s/`//g;
$val =~ s/<([^>]|\n)*>//g;
$name =~ s///g;
$field{$name} = $val;
}
}

Hope this helps.

Shawn Anderson
President and Webmaster
southwest Virtual Airways
http://www.virtualswa.com