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

Instalation help for a Newbie?

Quote Reply
Instalation help for a Newbie?
Hi,

I'm really new to CGI scripts. This is my first attempt at installing one. I'm a quick learner though. I'm fairly skilled in PHP, but can't seem to get Links SQL up and running. Sort of embarassing for me really... Pirate

It's uploaded to my cgi-bin and I thought I set all the permissions correctly and modified "links.cfg" correctly, but I guess I haven't. When I try to go to admin.cgi it wont open, but instead downloads that file and gives me this error message: "Error including libraries: Can't locate /links/cgi-bin/admin/db.pl at admin.cgi line 28. Make sure they exist, permissions are set properly, and paths are set correctly." Here's the URL for that: http://www.highsierratopix.com/...inks/admin/admin.cgi
I made sure that my path to Perl is set correctly on all cgi files as well, so that can't be it.

I'm stumped. It's probably something really silly that I forgot to do, but I just can't figure out what.

Any ideas?


Cheers,
ERIC

http://www.highsierratopix.com/community/


EDIT:

Forgot to mention that I left the directory structure as is from the download except for renaming the directory "Links2" to "links". So the structure is something like: cgi-bin/links/admin....

Last edited by:

Topix: Jan 19, 2004, 12:26 PM
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
"Error including libraries: Can't locate /links/cgi-bin/admin/db.pl at admin.cgi line 28. Make sure they exist, permissions are set properly, and paths are set correctly." Here's the URL for that: http://www.highsierratopix.com/...inks/admin/admin.cgi

It's looking for a links directory, THEN the cgi-bin, while it should be looking for the links directory WITHIN the cgi-bin. In links.cfg, you should have /cgi-bin/links/admin. Don't know why it comes with an example path that is quite different from most users' setup.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
Hey Leonard,


Thanks for the quick response to my problem.
Yeah, I noticed that... I even went in and changed that setting to see if that could be the problem. It wasn't. The file is attached.



Thanks again,

ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
You have this:

# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/cgi-bin/links/admin";
$db_dir_url = "http://localhost/cgi-bin/links/admin";

Replace localhost with your domain name (mydomain.com). [In each place that 'localhost' appears.] You did put the files into the proper places, right? You should have a folder named 'links' (or whatever you want to use) in the cgi-bin, and in it should be the public cgi scripts (search, add, etc), and there should also be an admin folder, inside which are all the other files that make links run.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
Hello Again Leonard,

Ok, I went ahead and made those modifications you suggested. I also tried re-uploading the script and re-set the permissions. No luck. I'm having the same problem.
As far as I know, the files are all in the proper places. In my cgi-bin I created a folder called "links". In that directory I placed the "pages" and "admin" folders (with their contents in tact the way they were unziped) as well as the cgi files (rate, add, modify, etc).
My host server has Perl 5. The path is correct (*!/usr/bin/perl) for each cgi file. CrazyCrazyCrazyCrazyCrazy

An example server path (shown using WS_FTP LE) where this script is stored would be "/var/www/cgi-bin/links/admin/links.cfg". I was looking at this thread and thought this might be my problem. Maybe there should be something more than (or other than) my domain in the place of "localhost"? Here's the thread: http://www.gossamer-threads.com/...ror_message_P188973/

Cheers again for the help,

ERIC

Last edited by:

Topix: Jan 19, 2004, 6:16 PM
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
You have:

# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/cgi-bin/links/admin";

This needs to be the full (absolute) path. It will normally include either your username or your domain name (on a shared server, anyway). It is generally different than the ftp address. Here is an example...

# Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/www/j/jameswooten/cgi-bin/patches/admin";
$db_dir_url = "http://jamesdpatches.com/cgi-bin/patches/admin";

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

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/www/j/jameswooten/htdocs/patches";
$build_root_url = "http://jamesdpatches.com/patches";

Also, the 'pages' directory should be in the www/html part of the server, not in the cgi-bin. And, you need to set this:

# Set only ONE of either $db_mail_path which should go to a
# mail program like sendmail, or $db_smtp_server which will use
# a SMTP server. Do not set both at once!

# PATH of sendmail. # SMTP Server
$db_mail_path = ''; $db_smtp_server = '';

Have you looked over this page...

http://theonetruechurch.com/resource/index.shtml


Leonard
aka PerlFlunkie
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
Ok...

So what I did is this. I used the advice of that thread I posted a link to in my last post and I think I found success. What happened is the file this time downloaded to my temporary internet files and then automatically opened into the browser window as the admin panel. Is this what is supposed to happen?

EDIT:

Just saw your last post. Cheers for the advice. I think the absolute path is what I added. The result is what's mentioned above. I think I'm on the right path (pun intended) now. What do you think? Pirate

Last edited by:

Topix: Jan 19, 2004, 8:43 PM
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
You have the CHMOD set correctly on the files?

Which file downloaded, admin.cgi?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Instalation help for a Newbie? In reply to
Hey Andy,

Yes. As far as I know I have it set correctly. I use WS_FTP LE. I re-uploaded all the files and then re-set all the permissions just to make sure.

The file that downloads now is admin.cgi. It downloads to temp internet files directory and opens in a new browser window and allows me to make modifications. I just installed password protection, but ran into some problems with that as well. I'll have to look at it tonight when I get some time.


Cheers for the help guys,

ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
It's not supposed to download, it should just open up in the browser. What are you using to edit the file? Make sure it's a text processer. Upload in ASCII.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
Yes, I use Notepad to edit it and I have been uploading everything in ASCII, nothing in Binary.

Yes, the file opens up in the browser. But in the address bar it shows it as a file in my temporary internet files on the C Drive - exactly how an html doc does when you preview it using Dreamweaver, etc. It does not show up in the address bar as a URL from my domain.


ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
Ok...

I fixed my problem. Don't know what I did, but I uploaded and re-set everything. Now I'm good. One problem though...

I get this error in my admin area when I attempt to "Build All" after adding a category and a couple links:

Quote:
Links Manager: Building Pages
Building Pages
Pages built on 22-Jan-2004 at 23:34:06
--------------------------------------------------------

Backing up database . . .
Backup exists for today.. Skipping
Done.

Building URL Index . . .
Done.

Updating New and Popular Records . . .
What's New Cutoff: 14 days
Popular Cutoff: 2 hits
Updating record: 3, marking as new.
Updating record: 4, marking as new.
Done.

Updating ratings ..
Done.

Loading Category Information . . .
Done.

Gathering Category and Link information . . .
Done

Building Home Pages . . .
Subcategories: 1
Total Links: 2
Opening page: /home/virtual/highsierratopix.com/var/www/links/pages/index.html

CGI ERROR
==========================================
Error Message : unable to open home page: /home/virtual/highsierratopix.com/var/www/links/pages/index.html. Reason: No such file or directory
Script Location : nph-build.cgi
Perl Version : 5.006001

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

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /home/virtual/site140/fst/var/www/html
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : highsierratopix.com
HTTP_REFERER : http://highsierratopix.com/cgi-bin/links/admin/admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
PATH : /usr/local/bin:/usr/bin:/bin
QUERY_STRING :
REMOTE_ADDR : 66.229.104.108
REMOTE_PORT : 3262
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/links/admin/nph-build.cgi
SCRIPT_FILENAME : /home/virtual/site140/fst/var/www/cgi-bin/links/admin/nph-build.cgi
SCRIPT_NAME : /cgi-bin/links/admin/nph-build.cgi
SCRIPT_URI : http://www.highsierratopix.com/cgi-bin/links/admin/nph-build.cgi
SCRIPT_URL : /cgi-bin/links/admin/nph-build.cgi
SERVER_ADDR : 69.57.144.58
SERVER_ADMIN : osterlings@comcast.net
SERVER_NAME : www.highsierratopix.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache
SITE_CGIROOT : /home/virtual/site140/fst/var/www/cgi-bin
SITE_HTMLROOT : /home/virtual/site140/fst/var/www/html
SITE_ROOT : /home/virtual/site140/fst
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
>>>/home/virtual/highsierratopix.com/var/www/links/pages/index.html.<<<

Does this file exist? You could try CHMODing /home/virtual/highsierratopix.com/var/www/links/pages/ to 777 (almost make sure the 'pages' folder exists).

That should fix it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Instalation help for a Newbie? In reply to
Actually, you only need to be sure the directory structure is in place, Links will create the html page itself. Be sure you have www/links/pages on your server. You could remove the 'pages' part as it serves only to push your directory deeper. Set it up as www/links, and make sure you set it that way in links.cfg, too. Glad you got it working, sure is annoying when it doesn't!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
DOH!

Andy, Leonard...cheers for all the help. True rockstars... Cool

What a silly mistake. It usually is, and I'm no exception. You were right. I muffed the path. Forgot to put the "html" section in there after the "www". So now it looks like this: home/virtual/highsierratopix.com/var/www/links/pages/index.html
All's well and working perfectly now thanks you you two. And I'm probably going to take your advice now that I know what I'm doing and get rid of the excess "pages" directory to cut the URL down to size and make things a bit more tidy.

Cheers and beers fellas,

ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
Hey guys,

Whoops!

Now I'm getting this error when I try to validate or delete a resource:

Quote:

CGI ERROR
==========================================
Error Message : Unable to init mailer! Reeason: Neither sendmail nor SMTP were specified!
Script Location : admin.cgi
Perl Version : 5.006001

Form Variables
-------------------------------------------
8 : delete
Category-8 : Accomodation
Contact Email-8 : eric_osterling@hotmail.com
Contact Name-8 : eric
Date-8 : 29-Jan-2004
Description-8 : this is a test
Hits-8 : 0
ID-8 : 8
Rating-8 : 0
ReceiveMail-8 : No
Title-8 : Lost Valley Pack Station
URL-8 : http://www.lostanddumbbbber.com
Votes-8 : 0
db : links
isNew-8 : No
isPopular-8 : No
reason-8 : Your link:

http://www.lostanddumbbbber.com

that was submitted on 29-Jan-2004 has been rejected
for one of the following reasons:

1. Unsuitable content.
2. Duplicate URL.

If you have any questions, please don't hesitate to ask.

Links Manager

validate_records : Validate/Delete Selected Link(s)

Environment Variables
-------------------------------------------
AUTH_TYPE : Basic
CONTENT_LENGTH : 709
CONTENT_TYPE : application/x-www-form-urlencoded
DOCUMENT_ROOT : /home/virtual/site140/fst/var/www/html
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CACHE_CONTROL : no-cache
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : highsierratopix.com
HTTP_REFERER : http://highsierratopix.com/cgi-bin/links/admin/admin.cgi?db=links&validate_form=1
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
PATH : /usr/local/bin:/usr/bin:/bin
QUERY_STRING :
REMOTE_ADDR : 66.229.104.108
REMOTE_PORT : 3487
REMOTE_USER : admin
REQUEST_METHOD : POST
REQUEST_URI : /cgi-bin/links/admin/admin.cgi
SCRIPT_FILENAME : /home/virtual/site140/fst/var/www/cgi-bin/links/admin/admin.cgi
SCRIPT_NAME : /cgi-bin/links/admin/admin.cgi
SCRIPT_URI : http://www.highsierratopix.com/cgi-bin/links/admin/admin.cgi
SCRIPT_URL : /cgi-bin/links/admin/admin.cgi
SERVER_ADDR : 69.57.144.58
SERVER_ADMIN : osterlings@comcast.net
SERVER_NAME : www.highsierratopix.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache
SITE_CGIROOT : /home/virtual/site140/fst/var/www/cgi-bin
SITE_HTMLROOT : /home/virtual/site140/fst/var/www/html
SITE_ROOT : /home/virtual/site140/fst


Any ideas?

Cheers,

ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
In the links.cfg file, find this:

# Email Options
# --------------------------------------------------------
# NOTE: Be sure to edit the text of the message. It can be found
# in the templates directory: email-add.txt, email-del.txt and
# email-mod.txt respectively.
# Set only ONE of either $db_mail_path which should go to a
# mail program like sendmail, or $db_smtp_server which will use
# a SMTP server. Do not set both at once!
# PATH of sendmail. # SMTP Server
$db_mail_path = ''; $db_smtp_server = '';

Here's some info... $db_mail_path To use sendmail, set this to the location provided by your host. This should be one of the following: /usr/sbin/sendmail, /lib/sendmail, or /bin/sendmail.

$db_smtp_server To use SMTP (Secure Mail Transfer Protocol), set this to the location of your mail server. Generally mail.mysite.com.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
Leonard,

Here we go again, a stupid oversight on my part. I'm up and running no problems now. Doubt there will be any more pressing issues (I hope?!) Crazy I was even able to put the password protection on the admin directory which I thought might give me some headaches....cake job to say the least.
Embarassing.... Sorry for the trouble.

Cheers for the help once again bro, Wink

ERIC
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
Ok,

Last question...I swear! Crazy

My server is in Montreal, Canada and I'm in California - 3hr difference. How do I change that in my configuration file so that builds reflect that time?
Quote Reply
Re: [Topix] Instalation help for a Newbie? In reply to
Here's afew things to try. Looks like the 'real' fix was made by Stealth (anthrorules), and is no longer available...

http://www.gossamer-threads.com/...cgi?post=21741#21741

http://www.gossamer-threads.com/...cgi?post=21513#21513

http://www.gossamer-threads.com/...cgi?post=51456#51456

http://www.gossamer-threads.com/...cgi?post=21909#21909


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Instalation help for a Newbie? In reply to
Nice one!

Cheers Leonard... This is what worked for me:

----------------------------------------------------

open db_utils.pl and go to sub get_time
change the line:

Quote:
my ($sec, $min, $hour, @junk) = localtime ($time);


to read:

Quote:
my ($sec, $min, $hour, @junk) = localtime ($time - 10800);