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

Links 2.0 and xampp

Quote Reply
Links 2.0 and xampp
I want to install Links 2.0 on my local PC (Windows XP Prof.) .
Xampp (Ver. 1.6.3) (http://www.apachefriends.org/de/xampp.html ) and Perl 5.8.8-2.2.4 (http://www.apachefriends.org/de/xampp-windows.html#629 ) are installed.

My windows directory:
C:\xampp

My perl directory:
C:\xampp\perl

What must be done before installing links?
In which directory must I install links?
What must be changed in the cgi`s and in links.cfg (the path`s)?

.


Andreas

Dr.Windows








Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
The path to perl will need to be changed in the scripts to #!C:\xampp\perl. Note that the path only appears in .cgi files, not .pl files.

Your address would be http://localhost.

Install the cgi scripts in /xampp/cgi-bin/links and the pages in /xampp/htdocs/links/, and make the paths in links/cfg C:\xampp\cgi-bin\links and C:\xampp\htdocs\links


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Links 2.0 and xampp In reply to
Hi Leonard - thank you for your reply.

I installed links completely in the directory : C:\xampp\htdocs\public_html\ .

Relevant parts of links.cfg :

Code:

$db_script_path = "C:/xampp/htdocs/public_html/cgi-bin/admin";
$db_dir_url = "http://localhost/public_html/cgi-bin/admin";

$db_cgi_url = "http://localhost/public_html/cgi-bin";

$build_root_path = "C:/xampp/htdocs/public_html/links";
$build_root_url = "http://localhost/public_html/links";

$build_image_url = "http://localhost/public_html/links/images";


Now I have a curios problem:

nph-build.cgi works (fine) if I commet out #&parse_form and start the script from the command line.
It doesn`t work if start with the browser : http://localhost/public_html/cgi-bin/admin/nph-build.cgi.

admin.cgi doesn`t work if started with the browser.

If start from the command line (perl -w admin.cgi) I receive an error message :

db_utils_pl:
Use of uninitialized value in string eq at
C:\xampp\htdocs\public_html\cgi-bin\admin\db_utils.pl
at line 562

The problem is probably the call of sub &parse_form in admin cgi.

admin.cgi:
Code:
#!C:/xampp/perl
#
#-/usr/bin/perl
#-/usr/local/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: admin.cgi
# Beschreibung: This is the administrative interface for the links program.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# German Translation by Nicky
# http://www.nicky.net
# Deutsches Forum http://forum.nicky.net
#
# Required Librariers
# --------------------------------------------------------

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
print "INC : " , @INC , "\n\n" ;
require 5.001; # Make sure we have at least perl 5.001.
# require "C:\\xampp\\htdocs\\public_html\\cgi-bin\\admin\\links.cfg";
require "links.cfg"; # Ändern Sie dieses zum vollen Pfad zu links.cfg, wenn Sie Probleme haben sollten.

print " db_lib_path : " , $db_lib_path , "\n\n";
require "$db_lib_path/db.pl"; # Database Routines.
require "$db_lib_path/db_utils.pl"; # Database Support utilities.
require "$db_lib_path/admin_html.pl"; # Admin HTML routines.
};

if ($@) {
print "Content-type: text/plain\n\n";
print "Fehler beim einlesen von dazugehörigen Bibliothek Dateien: $@\n";
print "Überprüfen Sie ob diese existieren, Pfade richtig eingestellt sind, und ob die Dateien richtig CHMOD-ed sind.";
exit;
}

# ========================================================
eval { &main; };
if ($@) { &cgierr("Allgemeiner Fehler: $@"); }
exit;
# ========================================================

sub main {
# --------------------------------------------------------

$| = 1 ;

%in = &parse_form ;


$in{'db'} ?
require "$db_lib_path/$in{'db'}.def" :
require "$db_lib_path/links.def";

$db_script_link_url = "admin.cgi?db=$in{'db'}";


if ($in{'add_form'}) { &html_add_form; }
elsif ($in{'add_record'}) { &add_record; }
elsif ($in{'add_record_mult'}) { &add_record_mult; }
elsif ($in{'view_search'}) { &html_view_search; }
elsif ($in{'view_records'}) { &view_records; }
elsif ($in{'delete_search'}) { &html_delete_search; }
elsif ($in{'delete_form'}) { &html_delete_form; }
elsif ($in{'delete_records'}) { &delete_records; }
elsif ($in{'modify_search'}) { &html_modify_search; }
elsif ($in{'modify_mult_form'}) { &html_modify_mult_form; }
elsif ($in{'modify_form'}) { &html_modify_form; }
elsif ($in{'modify_form_record'}) { &html_modify_form_record; }
elsif ($in{'modify_record'}) { &modify_record; }
elsif ($in{'modify_mult_record'}) { &modify_mult_record; }
elsif ($in{'validate_form'}) { &html_validate_form; }
elsif ($in{'validate_records'}) { &validate_records; }
elsif ($in{'check_links'}) { &check_links; }
elsif ($in{'fix_links'}) { &fix_links; }
elsif ($in{'check_duplicates'}) { &check_duplicates; }
elsif ($in{'html_mail_target'}) { &html_mail_target; }
elsif ($in{'html_mail_form'}) { &html_mail_form; }
elsif ($in{'html_mail_update'}) { &html_mail_update; }
elsif ($in{'html_edit_template'}) { &html_edit_template; }
elsif ($in{'save_template'}) { &save_template; }
elsif ($in{'html_template_help'}) { &html_template_help; }
elsif ($in{'display'} eq 'navigation') { &html_navigation; }
elsif ($in{'display'} eq 'body') { &html_body; }
elsif ($in{'display'} eq 'top') { &html_top; }
else { &html_home; }

# &cgierr("Done"); # Debugger

}

db_utils.pl : sub parseform
Code:
sub parse_form {
# --------------------------------------------------------

my (@pairs, %in);
my ($buffer, $pair, $name, $value );

if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
}
else {
&cgierr('Dieser Script kann nicht aus Telnet gestartet werden.');
}

PAIR: foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);

$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

($value eq "---") and next PAIR;
exists $in{$name} ? ($in{$name} .= "~~$value") : ($in{$name} = $value);
}
return %in;
}


Andreas

Dr.Windows








Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
I forgot to post the error message:

Error 500


Andreas

Dr.Windows








Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
I looked over the documentation here: http://www.apachefriends.org/en/xampp-windows.html, question#8.
According to that, the Links scripts should be in /xampp/cgi-bin, not /xampp/htdocs/cgi-bin:

Code:
$db_script_path = "C:/xampp/cgi-bin/admin";
$db_dir_url = "http://localhost/cgi-bin/admin";

$db_cgi_url = "http://localhost/cgi-bin";

$build_root_path = "C:/xampp/htdocs/public_html/links";
$build_root_url = "http://localhost/public_html/links";

$build_image_url = "http://localhost/public_html/links/images";

But as I said, I have not used this, and am not familiar with how xampp is set up.

Did you check any entries in the xampp\apache\logs\error.log or the access.log?

You might try posting in their forum: http://www.apachefriends.org/f/


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Links 2.0 and xampp In reply to
 

The result of your example is exact the same .

The idea of my example was to preserve the origin directory structure of the web server installation .

I will check and post the entries of the log files later.


Andreas

Dr.Windows








Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
The problem is solved:

1. I removed .htaccess and .htpasswd files in admin directory

2. First line in CGI files:

Instead of :

Code:
#!C:/xampp/perl

use:

Code:
#!c:/xampp/perl/bin/perl.exe

Now it works fine! Smile

PS:
Thanks again, Leonard!

.


Andreas

Dr.Windows








Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
Glad you got it! I had that path to perl in one post, but removed it before posting.


Leonard
aka PerlFlunkie
Quote Reply
Re: [SevenSpirits] Links 2.0 and xampp In reply to
XAMPP is a complete web, database and FTP server package for Windows that's ready to go in minutes and completely portable. The full XAMPP package includes:

Apache
MySQL
PHP + PEAR
MiniPerl
OpenSSL
phpMyAdmin
XAMPP Control Panel
Webalizer
Mercury Mail Transport System
FileZilla FTP Server
SQLite
ADODB
Zend Optimizer
XAMPP Security
XAMPP Lite leaves off the additional packages and sticks to Apache, mySQL, phpMyAdmin, SQLite and related packages resulting in an installation that's significantly smaller. There are no upgrade packages for XAMPP Lite like there are for XAMPP, though.

Last edited by:

Andy: Sep 5, 2010, 11:56 PM