WebNap v1.0.2
-------------
a PHP web napster client
===================================
August 17, 2000

http://webnap.sourceforge.net
http://www.idearing.com
Email: aakash@idearing.com (Aakash)
       kalpak@idearing.com (Kalpak)

WebNap is a PHP Napster client that allows you to download songs from
a Napster/Opennap/MyNapster or compatible servers using a web-browser.

Requirements:
1. Web server with PHP (3.0 or higher) support
2. Perl 5.0 or higher (for firewall download)
3. CGI version of PHP (optional for server-list cronjob)
4. mySQL database

INSTALL:
--------
To install, simply copy all the files to a web-accessible directory
(eg. /home/httpd/html/foo) and point your browser to form.php (eg.
http://your-domain-name/foo/form.php).


CONFIGURATION:
--------------

1. Generating server list ("servers.inc.php")

A default list of Opennap/MyNapster/Napster servers is provided in
this package in "servers.inc.php".

If you wish to create an up-to-date list, you may run "servers.php"
which recreates the server list file. There are two ways to run
servers.php:

1.1. From the prompt using the CGI version of PHP (secure):
     - run "php servers.php" from the webnap directory

     [Note: If you use Linux, you could setup a cron job to update the
     server list once a day.]

1.2. From a web browser (you need to give your web server write
     permission to "servers.inc.php") (hence, insecure):

 1.2.1  In Linux with Apache web server (user: nobody):
	- chmod o+rw servers.inc.php
	- from a browser: http://yourdomain/webnap/location/servers.php
	- this will create servers.inc.php
	- chmod o-w servers.inc.php
	  (make sure that you remove write permission immediately to
	  maximize security.)

This server list is graciously provided by Napigator, your Navigator
To Nap Servers And Internet Audio. Please visit
http://www.napigator.com for more information.

Please do not run servers.php too often since we have promised the
Napigator staff with minimal traffic to their server.

---
2. Customize WebNap Appearance ("config.inc.php")

2.1 Color Scheme: Edit the file "config.inc.php" and follow the
instructions therein to change row colors, link colors, etc.
	
2.2 Form Support: If your web server cannot handle long query strings
(this isn't a problem in most cases), you can enable FORM POST support
by setting the variable "$FORMPOST" to 1 in "config.inc.php".

---
3. Setup mySQL for file-transfer queue feature ("queue.php")

3.1 First create the necessary table as follows:

	CREATE TABLE drive (
	   file_id int(11) NOT NULL auto_increment,
	   username varchar(50) NOT NULL,
	   password varchar(50) NOT NULL,
	   napserver varchar(50) NOT NULL,
	   nick varchar(50) NOT NULL,
	   title varchar(100) NOT NULL,
	   mpsize varchar(30) NOT NULL,
	   affil int(2) NOT NULL,
	   KEY file_id (file_id),
	   UNIQUE file_id_2 (file_id)
	);


3.2 Edit the file "queue.php" and change the host, username,
password, database name at the top of the file.

---
4. Simultaneous Firewall Download: 

4.1 First create the necessary table that stores a list of ports as
follows:

	CREATE TABLE ports (
	   state int(1) NOT NULL DEFAULT '0',
	   port int(6) NOT NULL,
	   KEY state (state),
	   UNIQUE port_id (port)
	);

4.2 Now fill up the table with a few ports that you want to use:
    example: Let's add ports 6699-6703 as follows:
	insert into ports (port) values (6699);
	insert into ports (port) values (6700);
	insert into ports (port) values (6701);
	insert into ports (port) values (6702);
	insert into ports (port) values (6703);

4.3 Edit the file "config.inc.php" and change the host, username, password,
database name in first section.

4.4 Make sure the firewall.pl Perl script is executable:
	chmod a+rx firewall.pl

Note: In v1.0, we were using a file for keeping a free port list. This
was a bad idea since there was no way to handle concurrent accesses.
We believe in v1.0.1, the mySQL table will handle the free port list better.

---
Congratulations! You have setup WebNap. 

For suggestions and feedback, please send us mail.

Thank you,

Kalpak & Aakash,
WebNap Developers

