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

Prompted to Download

Quote Reply
Prompted to Download
I have just tried to set up the links2.
when I access the admin.cgi im prompted to download the file, I can choose to open the file from its current location, when I do this I get a Txt document with the following error:

"Error including libraries: Can't modify concatenation in scalar assignment at /c15/duane17/cgi-bin/links/admin/links.cfg line 26, near ""http://www.malepost.net/cgi-bin/links";"
Make sure they exist, permissions are set properly, and paths are set correctly."

I have triple checked my permissions.

The Server OS: BSDI
Version of Perl: 5.004.04

I have a Perl Validation Script with my Virtual Server Account this is its output for admin.cgi:

Name "main::db_script_url" used only once: possible typo at /c15/duane17/cgi-bin//links/admin/admin.cgi line 60.
Name "main::db_script_link_url" used only once: possible typo at /c15/duane17/cgi-bin//links/admin/admin.cgi line 60.
/c15/duane17/cgi-bin//links/admin/admin.cgi syntax OK




Here are the contents of my Links.cfg

(any comments appreciated) Im stuck. with this one

Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/c15/duane17/cgi-bin/links/admin";
$db_dir_url = "http://www.malepost.net/cgi-bin/links/admin";

URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://www.malepost.net/cgi-bin/links";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/c15/duane17/cgi-bin/links/pages";
$build_root_url = "http://www.malepost.net/cgi-bin/links/pages";

# PATH and URL of What's New page. No Trailing slash.
$build_new_path = "$build_root_path/New";
$build_new_url = "$build_root_url/New";

# PATH and URL of What's Cool page. No Trailing slash.
$build_cool_path = "$build_root_path/Cool";
$build_cool_url = "$build_root_url/Cool";

# PATH and URL of What's Rating page. No Trailing slash.
$build_ratings_path = "$build_root_path/Ratings";
$build_ratings_url = "$build_root_url/Ratings";

# Database Options
# --------------------------------------------------------
# You really need to use flock(). However if your system doesn't support it (Win95),
# then turn this off at your own risk!
$db_use_flock = 1;
# Use Pragma: no-cache to stop browsers from caching output? (0 = cache, 1 = nocache)
$db_nocache = 0;
# Use IIS headers? Set this to 1 if your web server needs the full headers (HTTP/1.0 etc.)
$db_iis = 0;
# Field number of category in category.db
$db_main_category = 1;
# Referers -- which hosts are allowed to add to your database.
@db_referers = ();
# 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 = "/usr/lib/sendmail"; $db_smtp_server = '';

# Email address of the administrator. BE SURE TO SET!
$db_admin_email = "duane17\@zoomnet.net";

# Notify visitors automatically when their links are validated?
$db_email_add = 1;

# Notify visitors automatically when their links are modified?
$db_email_modify = 1;

# Log all outgoing messages? Put the full path to a logfile and make sure it
# exists and is writeable (chmod 666 -rw-rw-rw-). This logfile can get pretty
# big!
$db_mailer_log = '';

# Build Options
# --------------------------------------------------------
# Setting for popular cutoff, can either be a percent (i.e. top 3%), or
# a fixed value (i.e. top 10). Enter 0.03 or 10 respectively.
$db_popular_cutoff = 0.03; # Top 3%
# Number of days a link is considered New.
$db_new_cutoff = 14; # 14 days old.
# Return search results bolded (1 = yes, 0 = no).
$search_bold = 1;
# The name of an index file.
$build_index = "index.html";
# The extension to use for non index files:
$build_extension = ".html";

# Should your add.cgi automatically select what category the user
# is adding his link into?
$db_single_category = 1;

# Directory Permissions. Do NOT put quotes around it. Set to 0777
# for world writeable. If you put this at 0755, you might need a
# script to remove any directories created as they will be owned
# by the web server or user nobody. Better solution might be to
# run the nph-build routine from the command shell.
$build_dir_per = 0777;

# The script can now break up category pages that have more then x
# number of links in it. It will also create next and previous links
# to help navigate. Set this to 1 if you want to break up pages or 0 if
# you want to have only one page per category.
# Setting this to one, will also break up the What's New pages into
# per day sections (not affected by number of links per page).
$build_span_pages = 1;

# Number of links per page.
$build_links_per_page = 10;

# Detailed View: The script can build a single html page per link. This is
# great if you have a review in your database. To enable, you must set
# the directory where all the pages will be stored, the url to that directory
# and set the enable option.
$build_detailed = 0;
$build_detail_path = "$build_root_path/Detailed";
$build_detail_url = "$build_root_url/Detailed";

# Use Templates: instead of editing site_html.pl, you can edit regular html pages
# encoded with special <%links_tags%>. It's not as flexible as site_html.pl, but it
# may be easier.
$build_use_templates = 1;

# Site Title, the default title to use. You should really spend some time customizing
# the directory though!
$build_site_title = 'MalePost TGP and Search Engine';



[This message has been edited by duane17 (edited August 07, 1999).]
Quote Reply
Re: Prompted to Download In reply to
I don't see anything wrong in links.cfg. Perhaps it was not uploaded as ASCII? That is what usually prompts the download prompt. Either links.cfg or perhaps admin.cgi or admin_html.pl.

I hope this helps.
Quote Reply
Re: Prompted to Download In reply to
I reuploaded them In ASCII, Didn't help. Thanks anyway. Still get the same error.
Quote Reply
Re: Prompted to Download In reply to
Is the top line of admin.cgi pointing to the correct location for perl on your system?

Also, make sure that one of the comments above what you are showing in links.cfg is not messed up somehow, making part of it a non-comment.
Quote Reply
Re: Prompted to Download In reply to
I had something similair to this because i had copies the root to my cgi folder in the top of the file by mistake. Perhaps you have done something similair or removed a comment tag?

------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: Prompted to Download In reply to
I am currently undergoing installation myself and was having the same problem -- a prompt for download rather than an execution of the called upon script. I read through the messages here and like you was certain that I uploaded in ASCII.

I went back to my links.cfg and looked it over. I changed the $db_script_path from /cgi-bin/links/admin/admin.cgi to the whole path on my server i.e. usr/local/httpd/htdocs/user/cgi-bin/links/admin/admin.cgi

I then uploaded (in ASCII) again the links.cfg file, and it worked!

I am still going through and setting it up but I have gotten past this step.

I hope this gives you a resolution to your problem!

Good Luck!
Quote Reply
Re: Prompted to Download In reply to
Took care of the problem thanks.

Quote Reply
Re: Prompted to Download In reply to
Also, when it prompts you to download, if you can open the file instead, do that. If not, download it and open it. In either case, there should be an error included in the file to point you to the problem.
Quote Reply
Re: Prompted to Download In reply to
Weird... Just thought I'd bring this thread back to the top of the pile.

I've got a Links 2 installation that builds fine under site_html.pl. As soon as I switch to $build_use_templates = 1; (site_html_templates.pl) nph-build.cgi tries to download when executed. Something in one of the files must be causing it, but it's odd that nph-build.cgi would act this way instead of throwing an error.

Dan

Quote Reply
Re: Prompted to Download In reply to
What error message is printed in the file when you download it?

Regards,

Eliot Lee

Quote Reply
Re: Prompted to Download In reply to
Wow, that was a quick reply! I just checked that after posting and saw that an include file of the form

$file = "/path/to/top.txt";

in site_html_templates.pl isn't being given permission to open. Commenting out that section, the build process is choking at another odd spot. Templates.pm isn't finding home.html, although the path it prints out in the error code is exactly where the templates are, home.html included...

I think whoever set things up with non-templates modified some configuration stuff that I'm missing. I noticed that several of the "Extra Paths" at the bottom of links.cfg were set up in a non-standard fashion.

Thanks,
Dan

Quote Reply
Re: Prompted to Download In reply to
Well...it looks like the included files is the source of the problem...

I assume that in the site_html.pl file you are using something like:

Code:

print &header;


These need to be converted into tags in the appropriate subs in the sub site_html_templates.pl file.

Regards,

Eliot Lee

Quote Reply
Re: Prompted to Download In reply to
If I'm not using site_html.pl (it was in use previously), have set up new templates, and have all the tags defined in site_html_templates.pl, there's no reason to have to worry about the tags in site_html.pl, is there?

It seems like there's a couple of things going on:

1) It won't include the file - have you ever seen that method not work? This is a first for me.

2) Even without the include file statement, it dies building from the home.html template, which doesn't include the tag that had to be commented out because of the file include problem.

I've uploaded working scripts over the top of everything in the admin directory, but the behavior persists. This doesn't sount like a server problem -- too specific to the template usage -- but I'm a bit baffled at the moment what else it could be.

Dan

Quote Reply
Re: Prompted to Download In reply to
Ok, I made it past hurdle #1. Apparently, this server does not allow files to be included unless they are chmod 777 (possibly other values as well, but 777 works). There's a first time for everything...

Now if I can just figure out #2, which is still happening.

Dan

Quote Reply
Re: Prompted to Download In reply to
I certainly wouldn't have come up with this! The site owner fixed the problem by issuing this command, presumably at a telnet prompt:

chown -R www-data.www-data /path/to/templates

Additionally, html files apparently cannot be included within the cgi-bin, so the template files had to be moved elsewhere (that was before learning of the chown command, so it may not have been necessary).

I'm guessing this solution was incredibly server specific, but maybe it will help others in the future?

Dan