PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Wie CGI-Addressbook auf Webseite einbinden?


cyrano-online
20.04.2002, 10:11
Hi zusammen,

ich habe eine Frage bezüglich eines Addressbooks in Perl geschrieben!

Ein Beispiel gibt es auf folgender Seite:
http://www.extropia.com/cgi-bin/new_demo/address_book.cgi

Habe mir von dort auch das CGI-Script heruntergeladen.
(http://www.extropia.com/applications/address_book.html)
Komme damit aber nicht zurecht!
Wie muss ich das einbinden bzw. an die Datenbank anbinden?
Da ist zwar eine Install Anleitung dabei, aber diese hilft mir nicht wirklich weiter!

Ich habe zuhause bei mir auf dem PC einen Apache Webserver laufen (inkl. PHP4 und MySQL).

Ich würde gerne solch ein Addressbook auf meiner Homepage zur Verfügung stellen!

Ich hoffe mir kann da jemand von euch weitehelfen?!
Oder gibt es Alternativen, z.B in PHP?

Danke schon mal vorab und Gruß
Cyrano


Jonas
20.04.2002, 11:12
Poste mal den Inhalt der Installationshilfe...
Aber im Grunde denke ich mal, einfach eine MySQL-DB erstellen, und beim Script die DB und Username/PW angeben...

cyrano-online
20.04.2002, 15:18
Hi,

hier die Liste:

1
NAME

A Generic Extropia ADT Installation Guide

=head1 DESCRIPTION

=head2 The long way

At some point you will want to read up-to-date, detailed

documentation which
is available in the form of the online book at
http://www.extropia.com/support/docs/adt and
http://www.extropia.com/support/docs/webdb.
Please also check with http://www.extropia.com/freesupport.html for further help.

(The dead-trees form of

the book can be also purchased from
http://www.extropia.com/publications.html)

=head2 The short way

Let´s take a single application as an example and

install it. Other
applications can be installed in a similar way.
I´ll use the
AddressBook as an example.

=over

=item 1

Download the application from http://www.extropia.com/applications.html
You will get a file whose name will be similar to:
I<addressbook-8.0.noarch.tar.gz>.

(Be sure to use BINARY if you upload it to another machine)

=item

2


Move the package into the root of your cgi-bin directory.
For example
I</home/stas/cgi-bin/>:

$ mv addressbook-8.0.noarch.tar.gz /home/stas/cgi-bin/

=item

3

Change directory to I</home/stas/cgi-bin/>:

$ cd /home/stas/cgi-bin/

=item

4


Unpack and Untar the package:

$ tar xvfz addressbook-8.0.noarch.tar.gz

If that doesn&acute;t work,
try

$ gunzip addressbook-8.0.noarch.tar.gz
$ tar xvf addressbook-8.0.noarch.tar

=item

5


Change directory to the newly created directory I<addressbook>:

$ cd addressbook

=item

6


Look at the contents of the directory, they will look like this:


$ ls -l
total 52

drwxr-xr-x 3 stas stas 4096 Jul 4 16:12 ActionHandler

drwxr-xr-x 5 stas stas 4096 Jul 4 16:12 Datafiles

drwxr-xr-x 4 stas stas 4096 Jul 4 16:12 HTMLTemplates

drwxr-xr-x 3 stas stas 4096 Jul 4 16:12 Modules

-rw-r--r-- 1 stas stas 4 Jul 4 16:12 Version

-rwxr-xr-x 1 stas stas 30059 Jul 4 16:12 address_book.cgi

=item

7


Make sure that the cgi script is executable:


$ chmod a+rx address_book.cgi

or


$ chmod 755 address_book.cgi

=item

8


The default settings I<should> be enough to use the application.

If not, make sure that the I<Datafiles>
directory and all the directories
under it are writable by the webserver you intend to run the code
under. For e
xample if the webserver is running under your name, you
can do:

$ chmod -R u+rwx Datafiles

This will
recursively adjust the I<Datafiles> directory and the ones
underneath.


If your server is running under a different user, and you don&acute;t have a
I<root> (superuser) access,
you will have to make the directories
writable by all:

$ chmod -R a+rwx Datafiles

B<Security Warning!>

This is a fine approach to get your feet wet and see the application
working, but you shouldn&acute;t
leave it this way, since any other user
which has an access to the same machine, can not only read,
but also
modify your data files -- something that you don&acute;t really want to
happen.
For more information about these issues please refer to the
book I&acute;ve referred to at the beginning
of this document.

=back

Now you are ready to try the application. If you have a script called
I<test.pl>
in your I<cgi-bin> directory, and you run this script as
CGI via: I<http://yoursite.com/cgi-bin/test.pl>,
the addressbook app
will be called as

I<http://yoursite.com/cgi-bin/addressbook/address_book.cgi>.

If you see
that the application works -- great, we need to do some
more tuning and you are done. If not, you probably
need to read the
more extensive information in the book. If you get an error, like
I<500 Internal Server Error>you need
to make sure that you have cgi-bin
privileges, recheck the permissions on the files, and
check I
<http://www.extropia.com/faq/install_faq.html>. Please be sure your ISP
and hosting plan provide you with
cgi-bin access.

So now we need to make sure that the images used in the application
will be displayed. In order to accomplish
that you need to know where
the static pages reside on your server.
For example if you can have
the cgi scripts and static files in the same directory you don&acute;t have
to
move any files around, all you need to know is the URL you can
access the images with.

If the static
web page root directory is located elsewhere (e.g. in
I</home/stas/public_html/>) you should move the images
files there or use
the ln(1) to symlink to them if you know how.

Now you have to adjust all the occurences of I
<-IMAGE_ROOT_URL> in
I<address_book.cgi> to point the location of the images. For example
I</home/stas/public_html>
is the root directory of the webserver, if
you&acute;ve placed the images directory as
I
</home/stas/public_html/Images/addressbook> the I<-IMAGE_ROOT_URL> fields will
look like this:


-IMAGE_ROOT_URL => &acute;/Images/addressbook&acute;,

When you have modified the application,
try it again and see that the
images are showing up now.

Now you are all set.

Please refer to
Instant CGI/Perl by Eric Tachibana and Gunther Birznieks.
The book explains the entire
ADT in much more detail.

Refer to http://www.extropia.com/freesupport.html for additional help.


Ach ja wie erstelle ich die DB genau und wo gebe ich Username und PW ein?

Danke &
Gruß
Cyrano

Jonas
20.04.2002, 19:38
Naja ganz einfach mit der console in&acute;s MySQL-Dir wechseln und &quot;mysql&quot; eintippen. dann &quot;create database adressbook&quot; eingeben...
ich denke mal ein root-pw bei mysql hast gesetzt oder? dann kannst das ja einfach bei dem adressbuch angeben...

ansonsten das adressbuch, einfach entpacken, mehr is das eigentlich net...

cyrano-online
20.04.2002, 20:16
Hi,

okay! Danke dir!
Habe es nach ein paar Versuchen hinbekommen!

Es lag an dem Root Passwort bei mySQL :rolleyes:

Gruß
Cyrano

Jonas
21.04.2002, 12:42
fein :)