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

Getting HTTP 500 Internal server error when adding a new link

Quote Reply
Getting HTTP 500 Internal server error when adding a new link
I keep getting HTTP 500 Internal server error when adding a link through the interface, not the admin. I did exactly what the readme said. I uploaded everything in ASCII, the path to perl is correct and I know I set the files to the right permissions. The Perl version is 5.004 on the server. So is there anything wrong with this links.cfg file:

#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: links.cfg
# Description: Contains all the setup variables.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 1.11
#
# COPYRIGHT NOTICE:
#
# Copyright 1997 Gossamer Threads Inc. All Rights Reserved.
#
# This program is being distributed as shareware. It may be used and
# modified free of charge for personal, academic, government or non-profit
# use, so long as this copyright notice and the header above remain intact.
# Any commercial use should be registered. Please also send me an email,
# and let me know where you are using this script. By using this program
# you agree to indemnify Gossamer Threads Inc. from any liability.
#
# Selling the code for this program without prior written consent is
# expressly forbidden. Obtain written permission before redistributing this
# program over the Internet or in any other medium. In all cases
# copyright and header must remain intact.
#
# Please check the README file for full details on registration.
# =====================================================================

# Paths and URL's to Important Stuff
# --------------------------------------------------------
# A Lot of these can be left as is. I've put a * by the important
# ones. You shouldn't have to change the others unless you don't
# use the default installation (i.e. have to use cgi-bin etc.)

# PATH of Admin Script directory. No Trailing Slash. *
$db_script_path = "/home/minoshia/public_html/links/admin";
# URL of Admin Script directory. No Trailing Slash. *
$db_dir_url = "http://tenkaichibudoukai.virtualave.net/links/admin";
# URL of Admin Script.
$db_script_url = $db_dir_url . "/admin.cgi";

# PATH of Pages to be built. No Trailing Slash. *
$build_root_path = "/home/minoshia/public_html/links";
# URL of Pages to be built. No Trailing Slash. *
$build_root_url = "http://tenkaichibudoukai.virtualave.net/links";
# PATH of What's New page. No Trailing Slash.
$build_new_path = $build_root_path . "/New";
# PATH of What's Cool page. No Trailing Slash.
$build_cool_path = $build_root_path . "/Cool";
# PATH of the header and footer directories. No Trailing Slash.
$db_header_path = $db_script_path . "/header";
$db_footer_path = $db_script_path . "/footer";

# URL of What's New Page
$build_new_url = $build_root_url . "/New";
# URL of What's Cool Page
$build_cool_url = $build_root_url . "/Cool";
# URL of Search Script
$build_search_url = $build_root_url . "/search.cgi";
# URL of Add Script
$build_add_url = $build_root_url . "/add.cgi";
# URL of Modify Script
$build_modify_url = $build_root_url . "/modify.cgi";
# URL of Jump Script
$build_jump_url = $build_root_url . "/jump.cgi";

# PATH of Library Directory. No Trailing Slash.
$db_lib_path = $db_script_path;
# PATH of the database backup directory. No Trailing Slash.
$db_backup_path = "$db_script_path/backup";
# PATH of the links database file.
$db_links_name = "$db_script_path/data/links.db";
# PATH of the category database file.
$db_category_name = "$db_script_path/data/categories.db";
# PATH of the validation file.
$db_valid_name = "$db_script_path/data/validate.db";
# PATH of the modification database:
$db_modified_name = "$db_script_path/data/modified.db";
# PATH of the URL index";
$db_url_name = "$db_script_path/data/url.db";
# PATH of the links database counter file.
$db_links_id_file_name = "$db_script_path/data/linksid.txt";
# PATH of the category database counter file.
$db_category_id_file_name = "$db_script_path/data/categoryid.txt";
# PATH of the verify links log.
$db_verify_path = "$db_script_path/data/verify.log";
# PATH of sendmail.
$db_mail_path = "/usr/lib/sendmail -t";

# 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;
$LOCK_EX = 2;
$LOCK_UN = 8;

# The verify script can now use fork() to spawn multiple processes. It's a little
# new, so if you run into problems with nph-verify or if your system doesn't support
# fork() (win95), then turn this off.
$db_use_fork = 1;

# Maximum number of children to spawn if you are using fork.
$db_max_children = 10;

# 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;

# Load the category definition file, or the links definition file depending
# on the path info variable.
if ($ENV{'PATH_INFO'} =~ m,^/category,) {
require "$db_lib_path/category.def";
}
else {
require "$db_lib_path/links.def";
}

# Field number of category in category.db
$db_main_category = 1;

# Ignore doubles if the links are in the following domains (note: no http!)
%db_ignore_doubles = ( "www.adobe.com" => 1,
"www.microsoft.com" => 1,
"www.cnet.com" => 1 );

# Email Notifications
# --------------------------------------------------------
# NOTE: Be sure to edit the text of the message. It can be found
# in the subroutines html_email_add and html_email_modify in
# admin_html.pl.

# Email address of the administrator. BE SURE TO SET!
$db_admin_email = 'dyim7@yahoo.com';

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

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

# Build Globals
# --------------------------------------------------------
# What you consider to be popular (top what %), and how many days old do you
# consider a link to be "new".
$db_popular_cutoff = 0.03; # Top 3%
$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";

# 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;

# Allowable extra characters. The program defaults to let you use
# letters, numbers, the "/" and the "_". Never allow a "." and only
# allow the minimum chars that work for you.
$build_allow_char = "-";

# 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;

# Adding a Record Globals
# --------------------------------------------------------
# When a visitor adds a record, these fields will automatically
# be filled in with the respective values.
%add_system_fields = ( 'isNew' => 'No',
'isPopular' => 'No',
'Hits' => '0'
);

# Date Routines
# --------------------------------------------------------
# Your date format can be whatever you like, as long as the following
# two functions are defined &date_to_unix and &unix_to_date:
# The default is dd-mmm-yyyy.

sub date_to_unix {
# This routine must take your date format and return the time a la UNIX time().
# Some things to be careful about..
# timelocal does not like to be in array context, don't do my($time) = timelocal (..)
# int your values just in case to remove spaces, etc.
# catch the fatal error timelocal will generate if you have a bad date..
# don't forget that the month is indexed from 0!
#
my ($date) = $_[0];
my (%months) = ("Jan" => 0, "Feb" => 1, "Mar" => 2, "Apr" => 3, "May" => 4, "Jun" => 5,
"Jul" => 6, "Aug" => 7, "Sep" => 8, "Oct" => 9, "Nov" => 10,"Dec" => 11);
my ($time);
my ($day, $mon, $year) = split(/-/, $_[0]);

if (!defined($months{$mon})) { die "invalid date format: $date. Reason: unkown month: $mon"; }
$day = int($day); $year = $year - 1900;

use Time::Local;

eval {
$time = timelocal(0,0,0,$day, $months{$mon}, $year);
};
if ($@) { die ("invalid date format: $date. Reason: $@"); } # Could return 0 if you want.
return ($time);
}

sub unix_to_date {
# This routine must take a unix time and return your date format
# A much simpler routine, just make sure your format isn't so complex that
# you can't get it back into unix time.
#
my ($time) = $_[0];
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time);
my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
$year = $year + 1900;

return "$day-$months[$mon]-$year";
}

sub long_date {
# This routine is for printing a nicer date format on the what's new page. It should
# take in a date in your current format and return a new one.
my ($time) = $_[0];
$time = &date_to_unix ($time);
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time);
my (@months) = qw!January February March April May June July August September October November December!;
my (@days) = qw!Sunday Monday Tuesday Wednesday Thursday Friday Saturday!;
$year = $year + 1900;

return "$days[$dweek], $months[$mon] $day $year";
}

1;
Quote Reply
Re: Getting HTTP 500 Internal server error when adding a new link In reply to
I don't see any problems with your links.cfg file.

Check your Perl Error Logs -OR- check the syntax of your admin.cgi and admin_html.pl files.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Getting HTTP 500 Internal server error when adding a new link In reply to
I solved the problem. I forgot to change the path of sendmail .
Quote Reply
Re: Getting HTTP 500 Internal server error when adding a new link In reply to
Good. Glad you figured it out.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.