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

CGI Error: line 55 of admin.cgi <<<HELP!!!

Quote Reply
CGI Error: line 55 of admin.cgi <<<HELP!!!
I'm not quite surr what to do now... I've followed all of the steps carefully,
all non .cgi files and directories are 777 (except those that are 666 or 755).
When I run admin.cgi I get this error



CGI ERROR
==========================================
Error Message : fatal error: Unrecognized character \x12 at /home/thenoncom2/cgi-bin/links/admin/links.def line 1.
Compilation failed in require at /home/thenoncom2/cgi-bin/links/admin/admin.cgi line 55.

Script Location : /home/thenoncom2/cgi-bin/links/admin/admin.cgi
Perl Version : 5.006001

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /home/thenoncom2
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : */*
HTTP_ACCEPT_LANGUAGE: en
HTTP_CONNECTION : Keep-Alive
HTTP_EXTENSION : Security/Remote-Passphrase
HTTP_HOST : thenoncom.net
HTTP_IF_MODIFIED_SINCE: Sat, 15 Sep 2001 22:33:09 GMT
HTTP_UA_CPU : PPC



(more info on my sever follows this jibber jabber )

I checked line 55 which is this:


$in{'db'} ?


(Here is the code chunk that this line comes form:

# Load the database definition file and set the link url.
$in{'db'} ?
require "$db_lib_path/$in{'db'}.def" :
require "$db_lib_path/links.def";

$db_script_link_url = "$db_script_url?db=$in{'db'}"; )

Now what... should that question mark be there or what?
Quote Reply
Re: [DualDiesel] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
ummm ....

Error Message : fatal error: Unrecognized character \x12 at /home/thenoncom2/cgi-bin/links/admin/links.def line 1.

do you have a weird character at the beginning of links.def ???

the question mark in admin.cgi is correct -- well, I have it too.

you might want to check links.cfg too.

here's my info:
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/Users/127/Sites/cgi-bin/links2/admin";
$db_dir_url = "http://127.0.0.1/cgi-bin/links2/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://127.0.0.1/cgi-bin/links2";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/Users/qooq/Sites/links2pages";
$build_root_url = "http://127.0.0.1/links2pages";


I have a demo version running on my home computer and so of course you'll need to change your information accordingly ...

I suggest looking at links.cfg since maybe LINKS might be having troubles finding files, but the error at the top is the first thing I'd check ...


good luck

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
Ok I goofed around and now I've got it working... what's a good script to use to password protect my admin center now?

Last edited by:

DualDiesel: Sep 15, 2001, 11:34 PM
Quote Reply
Re: [DualDiesel] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
Ya don't need a script......

Just run this code and paste the output into a file called .htpasswd....

#!/usr/bin/perl

my $user = "USERNAME";
my $pass = "PASS";

my $res = crypt($pass, "salt");

print "Content-type: tect/html\n\n";
print "$user:$res\n";


Then paste this into a file called .htaccess

AuthUserFile .htpasswd
AuthName Secure
AuthType Basic
<Limit GET>
require valid-user
</Limit>

Then upload both into the adm,in directory.

Quote Reply
Re: [PaulWilson] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
One more question... how would I add an additional user & password?
Quote Reply
Re: [DualDiesel] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
Just run the code again and paste it onto the next file of .htpasswd

Last edited by:

PaulWilson: Sep 18, 2001, 3:36 AM
Quote Reply
Re: [PaulWilson] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
next line even?
Quote Reply
Re: [wil] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
lol - I stumbled out of bed about 30 seconds before writing that post :)
Quote Reply
Re: [PaulWilson] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
Ok.. wait... what do you mean?

can I do this?

#!/usr/bin/perl

my $user = "USERNAME1";
my $pass = "PASS";

my $user = "USERNAME2";
my $pass = "PASSCODE";

my $user = "USERNAME3";
my $pass = "PASSWORD";

my $res = crypt($pass, "salt");

print "Content-type: tect/html\n\n";
print "$user:$res\n";

or not?

Quote Reply
Re: [DualDiesel] CGI Error: line 55 of admin.cgi <<<HELP!!! In reply to
No,

But you can do.....
Code:
#!/usr/bin/perl

print "Content-type: text/plain\n\n";

my %users = (
1 => ['USERNAME', 'PASSWORD'],
2 => ['USERNAME', 'PASSWORD'],
3 => ['USERNAME', 'PASSWORD']
);

foreach (keys %users) {
print "$users{$_}[0]:" . crypt($users{$_}[1], "salt") . "\n";
}

I just wrote that quickly but it should work.

Last edited by:

RedRum: Sep 19, 2001, 12:54 PM