* Last modified: 17/07/2006 * * */ // Originally this was an include, but as its all in ONE file, i can include it right here ;P /* miniconf 1.06 - - 03/04/2002 */ function footer($prev,$next) { global $coder_name,$coder_email,$os,$modules,$secure,$r,$subset; echo "
\n"; if ($prev!="" || $next!="") { $urlroot = "./?s=3&os=" . urlencode($os) . "&modules=" . urlencode($modules) . "&r=" . $r . "&secure=" . $secure; echo "\n"; echo ""; echo ""; echo "
"; if ($prev!="") { if ($prev!="*") { echo "< Previous"; } else { echo "< Previous"; } } $tmp = explode("-",$subset); echo "Up Level"; if ($next!="") { if ($next!="*") { echo "Next >"; } else { echo "Next >"; } } echo "
\n"; echo "
\n"; } $offset = date("Z",time()); if ($offset<0) { $sign = "-"; } else { $sign = "+"; } $gmtoffset = $sign . abs(($offset/3600)); if ($offset==0) { $gmtoffset = ""; } //echo "
maintained by <" . $coder_email . "> - Last modified : " . date("M-d-Y H:i:s", ( filemtime("index.php")+( date("Z",filemtime("index.php"))/3600 ) ) ) . " UTC/GMT - [Home]
"; echo "
maintained by <" . $coder_email . "> - [Home]"; echo " 
"; ?>$Id: index.php,v 1.22 2007/06/07 01:52:37 nighty Exp $
\n"; echo "\n"; echo "\n"; echo "\n"; die; } function ugig_err($err_code) { echo "

Error

"; echo "


"; switch ($err_code) { default: echo " "; break; } echo "

Click Here, and start over"; footer(); die; } $coder_email = "nighty@undernet.org"; $coder_name = "nighty"; define(PG_SQL_FTP_SOURCE,"ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql/source/"); define(PG_SQL_FTP_SOURCE_FILE,"ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql/source/v8.1.4/postgresql-8.1.4.tar.gz"); define(PG_SQL_RECOM_VERSION,"8.1.4"); define(TCL_83_PORT_SOURCE,"http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/tcl84/"); define(TCL_83_PORT_SOURCE_FILE,"http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/tcl84/tcl84.tar.gz?tarball=1"); define(TCL_83_LINUX_SOURCE,"http://sourceforge.net/project/showfiles.php?group_id=10894"); define(TCL_83_LINUX_SOURCE_FILE,"http://belnet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.13-src.tar.gz"); define(TCL_83_LINUX_FILE_NAME,"tcl8.4.13-src.tar.gz"); define(TCL_83_RECOM_VERSION,"8.4.13"); define(APACHE_FTP_SOURCE,"http://mir2.ovh.net/ftp.apache.org/dist/httpd/"); define(APACHE_FTP_SOURCE_FILE,"http://mir2.ovh.net/ftp.apache.org/dist/httpd/apache_1.3.36.tar.gz"); define(APACHE_FILE_NAME,"apache_1.3.36.tar.gz"); define(APACHE_RECOM_VERSION,"1.3.36"); define(PHP_FTP_SOURCE,"http://www.php.net/downloads.php"); define(PHP_FTP_SOURCE_FILE,"http://nl2.php.net:80/distributions/php-4.4.2.tar.gz"); define(PHP_FILE_NAME,"php-4.4.2.tar.gz"); define(PHP_RECOM_VERSION,"4.4.2"); define(LIBPNG_URL,"http://www.libpng.org/"); define(LIBPNG_URL_FILE,"http://belnet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.12.tar.gz"); define(LIBPNG_VERSION,"1.2.12"); define(LIBPNG_FILE_NAME,"libpng-1.2.12.tar.gz"); define(LIBJPEG_URL,"http://www.ijg.org/"); define(LIBJPEG_URL_FILE,"http://www.ijg.org/files/jpegsrc.v6b.tar.gz"); define(LIBJPEG_VERSION,"6b"); define(LIBJPEG_FILE_NAME,"jpegsrc.v6b.tar.gz"); define(FREETYPE2_URL,"http://freetype.sourceforge.net"); define(FREETYPE2_URL_FILE,"http://download.savannah.gnu.org/releases/freetype/freetype-2.2.1.tar.gz"); define(FREETYPE2_VERSION,"2.2.1"); define(FREETYPE2_FILE_NAME,"freetype-2.2.1.tar.gz"); define(ZLIB_URL,"http://www.gzip.org/zlib/"); define(ZLIB_URL_FILE,"http://www.gzip.org/zlib/zlib-1.2.3.tar.gz"); define(ZLIB_VERSION,"1.2.3"); define(ZLIB_FILE_NAME,"zlib-1.2.3.tar.gz"); ?> Undernet GNUworld Interactive Installation Guide

Undernet GNUworld Interactive Installation Guide

Operating System"; echo "Back to introduction"; break; case 2: echo "

Modules Options

"; echo "Back to operating system choice"; break; case 3: echo "

Installation details

"; if ($subset=="") { echo "Back to modules options"; } else { echo "Table of content"; if (strlen($subset)>1) { echo " / "; $tmp = explode("-",$subset); $maincat = $tmp[0]; if ($maincat=="A") { $catname = "Setting up PostgreSQL"; } if ($maincat=="B") { $catname = "Setting up GNUworld"; } if ($maincat=="C") { $catname = "Setting up Apache and PHP"; } echo "" . $catname . ""; } } break; case 4: echo "

Frequently Asked Questions (and answers)

"; break; case 5: echo "

Upgrading GNUworld

"; break; case 6: echo "

Credits

"; break; default: echo "

Introduction

"; $s=0; break; } ?>
Welcome to the Undernet GNUworld Interactive Installation Guide.

The purpose of that page is to provide a targeted help, using your own specifications,
on how to install GNUworld properly onto your system.

This help covers only the two most common types of Operating Systems, Linux and FreeBSD.

If you wish to share your experiences on other systems, like SunOS or HPUX etc.. of working installations
using modified parameters of this HOWTO, please let me know, this may get included.

  1. Click here to start building your HOWTO
  2. Frequently Asked Questions (F.A.Q.)
  3. Upgrading GNUworld
  4. Credits


GNUworld Homepage			: http://www.gnuworld.org/
Undernet Coder-Comittee Homepage	: http://coder-com.undernet.org/
Undernet Homepage			: http://www.undernet.org/
Undernet CService Website Interface	: http://cservice.undernet.org/live/
Undernet CService Website		: http://cservice.undernet.org/

If you have any questions about GNUworld,
or other's Coder-Comittee projects such as ircu2.10.x,

you can either :
	- post your questions to coder-com@undernet.org,
	- join the Undernet IRC Network
		use either eu.undernet.org or us.undernet.org or the Undernet servers list,
		depending on your location, as your IRC server (port 6667)
		and /join #coder-com.
	- view discussions and post your questions on the Undernet Coder-Comittee Forum


To start, choose an Operating System :
>
  1. Do you want to setup :

    mod.cservice only (X like module)
    mod.ccontrol only (Uworld like module)
    both mod.cservice and mod.ccontrol


  2. Can you access root priviledges on your machine ?

    Yes
    No


  3. Do you want help on how to secure your database with a password ?
                 (advanced users)
    Yes
    No


1) { ugig_err(0); } if ($r==0 && $subset=="") { echo "

Warning

"; echo "
";
		echo "Installing GNUworld without having root access on the machine\nhas requirements and constraints: \n\n";
		if ($secure) {
			echo "	- In order to have password support for PostgreSQL, ask your System administrator.";
		}
		echo "
"; } $url_root="./?s=3&os=" . urlencode($os) . "&modules=" . urlencode($modules) . "&r=" . $r . "&secure=" . $secure; if (!isset($secure) || $secure<0 || $secure>1) { ugig_err(0); } if (!isset($subset) || $subset<0 || $subset>50) { $MODULESLIST="mod.cservice and mod.ccontrol modules"; if ($modules=="cservice") { $MODULESLIST="mod.cservice module"; } if ($modules=="ccontrol") { $MODULESLIST="mod.ccontrol module"; } ?>
  1. Setting up PostgreSQL
    1. Getting PostgreSQL
    2. Requirements
      1. Getting and Installing TCL 8.x+
    3. Building PostgreSQL
    4. Setting up Database space
    5. Setting up security for the database (passwords)
  2. Requirements
  3. Setting up GNUworld
    1. Obtaining CVS distributions
    2. Building
    3. Initializing databases
    4. mod.cservice configuration
    5. mod.ccontrol configuration
    6. Running GNUworld
    7. Configuring website (config.inc)
    8. Configuring and setting up 'THE JUDGE'
  4. Setting up Apache and PHP
    1. Getting Apache
    2. Getting PHP
    3. Building Apache with PHP and PostrgreSQL support
    4. Short HOWTO on apache's <VirtualHost> directive
    \n"; } ?>

A. Setting up PostgreSQL

This part will help you in setting up PostreSQL properly for a GNUworld usage of it.

  1. Setting up PostgreSQL
    1. Getting PostgreSQL
    2. Requirements
      1. Getting and Installing TCL 8.x+
    3. Building PostgreSQL
    4. Setting up Database space
    5. Setting up security for the database (passwords)

B. Setting up GNUworld

This part will provide the help you need to setup the GNUworld program.

  1. Setting up GNUworld
    1. Obtaining CVS distributions
    2. Building
    3. Initializing databases
    4. mod.cservice configuration
    5. mod.ccontrol configuration
    6. Running GNUworld
    7. Configuring website (config.inc)
    8. Configuring and setting up 'THE JUDGE'

C. Setting up Apache and PHP

This part will help you in setting up Apache and PHP with PostgreSQL support and explain how you can add a virtualhost for your website.

  1. Setting up Apache and PHP
    1. Getting Apache
    2. Getting PHP
    3. Building Apache with PHP and PostrgreSQL support
    4. Short HOWTO on apache's <VirtualHost> directive

A. Requirements

This is what you need to ensure before trying to install GNUworld if you are not root
on your system and want to set up GNUworld using an already existing Installation


	- Check that you can access a web browsable directory (web space) on the machine
	  (if you have an URL like http://www.some-site.com/~youruser/ and you place the files for that URL
	   in a directory in your HOME (for example /home/youruser/public_html) then YOU DO HAVE a web space.)

	- Check that the machine is running a web server with PHP4+ and PostgreSQL 7.2+ support :
	  create a file in your web space called test_apache.php and put the following code in it :
	  
	  	<?
	  	phpinfo();
	  	?>
	  

	  Then access it to view the PHP options (http://www.some-site.com/~youruser/test_apache.php).
	  If you view the source code, your server probably either doesnt have PHP support, or doesnt support
	  the .php file extension. See your Server Administrator to fix this problem.

	  Check that the PHP version in the first purple block is 4.1.2 or above.
	  Otherwise you don't have the required version of PHP, sorry.

	  In the next block, in section Configure Command, check that the command
	  contains --with-pgsql, otherwise your existing PHP does'nt have the PostgreSQL support.


	- Check that your PostgreSQL installation was done with the following ./configure option(s):
		--with-CXX		: building the C Client
		--enable-multibyte	: Needed to solve a createdb problem and allow php to build correctly.

		--with-tcl		: building with TCL support (pgtclsh) for mod.cservice.


For the whole HOWTO here, we will assume PostreSQL is configured that way :
(replace with appropriate PATHs if yours are different)

		Binaries directory :	/usr/local/pgsql/bin
		LIB directory :		/usr/local/pgsql/lib
		Database directory :	/usr/local/pgsql/data

		User having DBA privs :	gnuworld

	- Check PostgreSQL version :

		:/home/gnuworld$ /usr/local/pgsql/bin/psql --version

	  the first lines should return a version number above or equal to 7.2.1 like this :
	  (preferrably above 8.0.0, version 7.2.x while compatible is not supported anymore
	   by PostgreSQL team)

	  	psql (PostgreSQL) 7.2.1
	  	contains readline, history support
		Portions Copyright (c) 1996-2000, PostgreSQL, Inc
		Portions Copyright (c) 1996 Regents of the University of California
		Read the file COPYRIGHT or use the command \copyright to see the
		usage and distribution terms.

	- Check that your user (assuming gnuworld) has DBA (DataBase Administrator) privileges :

		:/home/gnuworld$ /usr/local/pgsql/bin/createdb test_gnu
		:/home/gnuworld$ /usr/local/pgsql/bin/dropdb test_gnu

	  if you could run this without any error, then your user has those privileges.
	  Otherwise you need your System Administrator to allow you those actions.


Title


Getting PostgreSQL

In order to get PostgreSQL you should visit their official website :
	- http://www.postgresql.org/
	- PostgreSQL Public FTP Site

Direct link to download PostgreSQL  (recommended version) :
	- FTP

Requirements

GNUworld will need to use a tool called pgtclsh in PostgreSQL,
this tool is required to make the Registration System work properly,
if you don't build this programm you will not be able to complete the setup of 'THE JUDGE'
and your channel applications will all stag in Pending status.

pgtclsh needs the TCL library to be compiled.

To make sure you have TCL installed, do the following :


	:/root# /usr/bin/updatedb


	:/root# /usr/libexec/locate.updatedb

	:/root# locate tclConfig.sh


this should return something like /usr/lib/tclConfig.sh if you have TCL installed.


this should return something like /usr/local/lib/tcl8.x/tclConfig.sh if you have TCL installed.

If you dont have that file, go to Getting and installing TCL 8.x+.

If you have it, check that you have the proper version by doing :


	:/root# grep TCL_VERSION /usr/lib/tclConfig.sh


	:/root# grep TCL_VERSION /usr/local/lib/tcl8.x/tclConfig.sh


this should return something above or equal to 8.0.
If this number is 8.0 or above, please click here or go to next step,
if you have an older version of TCL please see Getting and installing TCL 8.x+.

Getting and installing TCL 8.x+



Get the latest TCL package in :
	- 

Recommended TCL  :
	- 

When you get the file , just unpack it in a place you have some space,
your home directory can be a good place to put that.

	:/root# tar -xzf 

now cd to the directory just created ...

	:/root# cd /unix/
	:/root//unix#

run the following commands to build and install TCL  on your  :

	:/root//unix# ./configure
	:/root//unix# make
	:/root//unix# make install

if you run into trouble, additional information can be found here.



Check if you have the recommended TCL 8.4.x ports for your ,
if the directory /usr/ports/lang/tcl84 doesn't exist on your system,
then download the corresponding FreeBSD ports here (needs FreeBSD port installation knowledge).

cd to the directory, and build TCL 8.4.x :

	:/root# cd /usr/ports/lang/tcl84/
	:/usr/ports/lang/tcl84# make

FreeBSD should take care of the full installation.


Building PostgreSQL

If you have trouble installing, and prior to asking PostgreSQL team about it,
please ensure you have a recent version of PostgreSQL, old 7.x series are not supported anymore !

Get the postgresql-.tar.gz file you downloaded into step 1.
Unpack it :

	:/root# tar -xzf postgresql-.tar.gz
	:/root# cd postgresql-/
	:/root/postgresql-# ./configure --with-CXX \
		--enable-multibyte \

		--with-tcl --without-tk \
		--with-tclconfig=/usr/local/lib/tcl8.4  \
		--with-includes=/usr/local/include/tcl8.4 \
		--with-libraries=/usr/local/lib/tcl8.4


		--with-tcl --without-tk

If the configure complains about not finding tclConfig.sh, or if
you experience missing .h files when doing the next steps of compilation,
you may want to re-run the ./configure adding the following parameters :

		--with-tclconfig=/path/to/tclConfig.sh_directory
		--with-includes=/path/to/tcl/include
		--with-libraries=/path/to/tcl/lib



You need gmake 3.79 or above to build PostgreSQL (and you will also need it for GNUworld later),
check you have it by running gmake --version, you should get something like this :
Note: You will also need automake 1.6 or above in order to build GNUworld.

	:/root/postgresql-# gmake --version
	GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.

	Built for i686-pc-linux-gnu


	Built for i386--freebsd4.4

	Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
	        Free Software Foundation, Inc.
	This is free software; see the source for copying conditions.
	There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
	PARTICULAR PURPOSE.

	Report bugs to <bug-make@gnu.org>.	

If you don't have gmake, you can get it here.
If you don't have automake 1.6+, you can get 1.7.9 here.
If that's ok, you can go on and build PostgreSQL for real, then install it...

	:/root/postgresql-# gmake


If compilation fails due to an error like ...
	commands/SUBSYS.o(.text+0x4902): In function `DoCopy':
	: undefined reference to `errno'
	collect2: ld returned 1 exit status
	gmake[2]: *** [postgres] Error 1
	gmake[2]: Leaving directory `/root/postgresql-/src/backend'
... then open file '/root/postgresql-/src/backend/commands/copy.c'
and add #include <errno.h> to the includes already present.
You will then be able to do gmake again so it will end without error.


	:/root/postgresql-# gmake install


If you are using bash as your shell programm, add the following line :

        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib

into /etc/profile.
zsh, sh and ksh use the same command in their respective .shrc .zshrc .kshrc ~ files.


For csh and tcsh you will need to use setenv instead :

        setenv LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib




Edit the file /etc/ld.so.conf and add the following line :

                   /usr/local/pgsql/lib


save the file, then run :

	:/root/postgresql-# ldconfig



To check that your PostreSQL installation includes TCL support, check that the following
file exists onto your system :

	/usr/local/pgsql/bin/pgtclsh

Setting up Database space


You now need to create a new user on the system that will be the DB Administrator
of your PostgreSQL, the following example will assume the username used by GNUworld
to access the database will be that DB Administrator.


The details on how to handle multiple users and password over PostgreSQL, and thus
making it possible to choose another user for your GNUworld to use, are described in the next part.


Creating the user, assuming username gnuworld :

	:/root# adduser
	Use option ``-silent'' if you don't want to see all warnings and questions.

	Check /etc/shells
	Check /etc/master.passwd
	Check /etc/group
	Enter your default shell: bash csh date false no sh tcsh
	[bash]: [ENTER]
	Your default shell is: bash -> /usr/bin/bash
	Enter your default HOME partition: [/home]: [ENTER]
	Copy dotfiles from: /usr/share/skel no [/usr/share/skel]: [ENTER]
	Send message from file: /etc/adduser.message no [no]: [ENTER]
	Do not send message
	Use passwords (y/n) [y]: [ENTER]

	Ok, let's go.
	Don't worry about mistakes. I will give you the chance later to correct any input.
	Enter username [a-z0-9_-]: gnuworld
	Enter full name []: GNUworld Account
	Enter shell bash csh date false no sh tcsh [bash]: [ENTER]
	Enter home directory (full patrld]: [ENTER]
	Uid [1001]: [ENTER]
	Enter login class: default []: [ENTER]
	Login group gnuworld [gnuworld]: [ENTER]
	Login group is ``gnuworld''. Invite gnuworld into other groups: guest no
	[no]: [ENTER]
	Enter password []: ********
	Enter password again []: ********

	Name:     gnuworld
	Password: ****
	Fullname: GNUworld Account
	Uid:      1001
	Gid:      1001 (gnuworld)
	Class:
	Groups:   gnuworld
	HOME:     /home/gnuworld
	Shell:    /usr/bin/bash
	OK? (y/n) [y]: [ENTER]
	Added user ``gnuworld''
	Copy files from /usr/share/skel to /home/gnuworld
	Add another user? (y/n) [y]: n
	Goodbye!




	Login name for new user (8 characters or less) []: gnuworld

	User id for gnuworld [ defaults to next available]: [ENTER]

	Initial group for gnuworld [users]: [ENTER]

	Additional groups for gnuworld (seperated
	with commas, no spaces) []: [ENTER]

	gnuworld's home directory [/home/gnuworld]: [ENTER]

	gnuworld's shell [/bin/bash]: [ENTER]

	gnuworld's account expiry date (YYYY-MM-DD) []: [ENTER]

	OK, I'm about to make a new account. Here's what you entered so far:

	New login name: gnuworld
	New UID: [Next available]
	Initial group: users
	Additional groups: [none]
	Home directory: /home/gnuworld
	Shell: /bin/bash
	Expiry date: [no expiration]

	This is it... if you want to bail out, hit Control-C.  Otherwise, press
	ENTER to go ahead and make the account.
	[ENTER]

	Making new account...

	Changing the user information for gnuworld
	Enter the new value, or press return for the default
	        Full Name []: GNUworld Account
	        Room Number []: [ENTER]
	        Work Phone []: [ENTER]
	        Home Phone []: [ENTER]
	        Other []: [ENTER]

	Changing password for gnuworld
	Enter the new password (minimum of 5, maximum of 127 characters)
	Please use a combination of upper and lower case letters and numbers.
	New password: ********
	Re-enter new password: ********
	Password changed.
	Done...


	:/root# mkdir /usr/local/pgsql/data
	:/root# chown gnuworld /usr/local/pgsql/data
	:/root# su - gnuworld
	:/home/gnuworld$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

Then run PostgreSQL :

	:/home/gnuworld$ /usr/local/pgsql/bin/postmaster -S -B 64 -N 32 -i -D /usr/local/pgsql/data -o -F

Note: if you plan on using this *STRICTLY* locally, and you want to ensure ONLY local connections are possible
therefore not requiring your to lock out port 5432 on your firewall to prevent remote access to your PostgreSQL database,
then you can run the following command instead of the above to run your PostgreSQL :
	:/home/gnuworld$ /usr/local/pgsql/bin/postmaster -S -B 64 -N 32 -i -D /usr/local/pgsql/data -o -F -h 127.0.0.1
You should run only ONE of those commands, not both !


	:/home/gnuworld$ exit
	:/root#

Setting up security for the database (passwords)


If, for example you want to install a PostgreSQL on a machine where resides some users you
don't trust, or just don't want to be able, just with a .php to edit your PostgreSQL database,
you should protect the access to the database with user passwords.

For this you will need to edit the /usr/local/pgsql/data/pg_hba.conf file.

Quite at the end of that file, you will see the two following lines :

	local        all                                           trust
	host         all         127.0.0.1     255.255.255.255     trust

Replace the two words 'trust' by the word 'crypt', making the lines look like :

	local        all                                           crypt
	host         all         127.0.0.1     255.255.255.255     crypt


This will require the user connecting to the database to issue the good password in pg_shadow,
in other words the UNIX password of that local user.

NOTE: You will NEED to use that password in and website configuration in the next steps.

After that change, you need to restart your PostreSQL, do the following :

	:/root# su - gnuworld
	:/home/gnuworld$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data restart


Obtaining CVS distributions

To obtain gnuworld website ";
}
?>using CVS, issue the following commands :


	:/root# su - gnuworld

	:/home/gnuworld$ touch .cvspass
	:/home/gnuworld$ cvs -d:pserver:anonymous@gnuworld.cvs.sourceforge.net:/cvsroot/gnuworld login

Just hit the [ENTER] key as the password.

	:/home/gnuworld$ cvs -z3 -d :pserver:anonymous@gnuworld.cvs.sourceforge.net:/cvsroot/gnuworld co gnuworld

	:/home/gnuworld$ cvs -z3 -d :pserver:anonymous@gnuworld.cvs.sourceforge.net:/cvsroot/gnuworld co website

You should now have two directories in /home/gnuworld called gnuworld/ and website/;
they contain the CVS latest distributions of both c++ program and website.


You should now have one directory in /home/gnuworld called gnuworld/;
it contains the CVS latest distribution of c++ program for GNUworld.

Building

cd to the gnuworld/ directory :

	:/home/gnuworld$ cd gnuworld/
	:/home/gnuworld/gnuworld$ ./configure --enable-modules=
	:/home/gnuworld/gnuworld$ gmake

NOTE:	Compilation may take time, up to a couple of hours on slow machines, just get a cofee ;)
	if you run on an SMP (multiple CPUs) machine, you can use gmake -j 2 (up to gmake -j 12) instead of gmake,
	to parallelize the compilation thus making it faster.

If you have the compiler complaining about libpq++.h, that means :

	- you didn't added the required stuff to /etc/ld.so.conf\n"; }
	if ($os=="freebsd") { echo "LD_LIBRARY_PATH\n"; }

	?>
	  as explained in Building PostgreSQL.

	- your PostgreSQL is NOT setup properly
	  (ie. was not build with the --with-CXX configure option),
	  you should then go to Setting up PostgreSQL.

	- your PostgreSQL is not properly setup and needs to be rebuilt
	  by the system administrator (root) using the required ./configure options.
	  (see Requirements).



	:/home/gnuworld/gnuworld$ gmake install
	:/home/gnuworld/gnuworld$ cd ..
	:/home/gnuworld$

Initializing databases


	:/home/gnuworld$ cd gnuworld/doc/
	:/home/gnuworld/gnuworld/doc$


mod.cservice (X like module)

Create the database : :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/createdb cservice Install the PL language : (if you skip this step or do it AFTER anything has been put in the database, this will NOT work and you will not be able to login properly to the bot on IRC) :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/createlang -L /usr/local/pgsql/lib plpgsql cservice Load the CService schema : :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < cservice.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < cservice.config.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < languages.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < language_table.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < greeting.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < cservice.help.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < cservice.web.sql You can safely ignore WARNINGS and NOTICES here. Now let's create the database that the website will use to handle user logging in on the Web. :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/createdb local_db :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql local_db < local_db.sql Now add the CService administrator to the cservice database. This command will add an account called 'Admin' with level 1000 access on channel '*'...use this power wisely, The Dark Side is very powerful. This will also register channel #coder-com to 'Admin' to make the VERIFY command work on authenticated users. :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql cservice < cservice.addme.sql NOTE: You will change the password for that user later.

mod.ccontrol (Uworld like module)

Create the database : :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/createdb ccontrol Load the CControl schema : :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql ccontrol < ccontrol.sql :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql ccontrol < ccontrol.help.sql Now add the CControl administrator to the ccontrol database. This command will add an account called 'Admin' with level CODER. :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql ccontrol < ccontrol.addme.sql NOTE: You will change the password for that user later. Then finish your CControl database setup with the following command : :/home/gnuworld/gnuworld/doc$ /usr/local/pgsql/bin/psql ccontrol < ccontrol.commands.sql

mod.cservice configuration


Go to the directory where the configuration files resides :

	:/home/gnuworld/gnuworld/doc$ cd ../bin
	:/home/gnuworld/gnuworld/bin$

Edit the file cservice.conf and change to whatever fits your local configuration,
mandatory changes should be :

	sql_db = cservice

	sql_pass = the_password_for_user_gnuworld


you should edit the following variables in that configuration, and leave the others untouched :

	sql_db, sql_pass, nickname, username, hostname, userdescription,
	pending_page_url, relay_channel, and debug_channel.

NOTE:	If you don't have any password, you probably didn't restricted your PostgreSQL,
	in that case, just leave the default one (foo), it will just be ignored
	but you need to put something, thus not leaving it blank.

mod.ccontrol configuration



Go to the directory where the configuration files resides :

	:/home/gnuworld/gnuworld/doc$ cd ../bin
	:/home/gnuworld/gnuworld/bin$


Edit the file ccontrol.conf and change to whatever fits your local configuration,
mandatory changes should be :

	sql_db = ccontrol

	sql_pass = the_password_for_user_gnuworld


you should edit the following variables in that configuration, and leave the others untouched :

	sql_db, sql_pass, nickname, username, hostname, userdescription,
	operchan, msgchan, abuse_mail, and ccemail.

NOTE:	If you don't have any password, you probably didn't restricted your PostgreSQL,
	in that case, just leave the default one (''), it will just be ignored
	but you need to put something, thus not leaving it blank.



mod.ccontrol is not, by default, enabled in GNUworld.conf,
you need to find the following line in that file :

	#module = libccontrol.la ccontrol.conf

and uncomment it (remove the first '#'), thus giving :

	module = libccontrol.la ccontrol.conf


Running GNUworld


Running GNUworld needs an IRC (P10 Protocol compliant) server ready to welcome it.
We recommend the use of the latest ircu2.10.x from Undernet's Coder-comittee.

Latest known STABLE version is ircu2.10.12.08, please visit http://coder-com.undernet.org/
to get information on how to download and install it.

We will assume you have set up an ircu2.10.12.08 server for the example.

Edit the file GNUworld.conf in the /home/gnuworld/gnuworld/bin/ directory,
and define the properties of the GNUWorld Oper Service server here.

*** WARNING ***: The default numeric for the GNUWorld Oper Service server is 51,
if you already have a Server linked on your network using that numeric,
GNUworld will not be able to link, and complain about NUMERIC COLLISION...
you need, if so, to pick a new numeric, not already in use onto your IRC Network.

uplink		must be the numerical IP of the IRC server GNUworld will link to
		This server needs to be compiled as a HUB (see ircu installation documentation).
		You can use 127.0.0.1 if your IRC server is on the same machine as GNUworld.
		We will assume the IP to be 192.168.0.1.

port		this should usually be kept at 4400. It is the server port to which
		GNUworld will try to connect to when linking to uplink.

password	this can be anything you want, avoid using weird chars,
		it's just the password GNUworld will use to authenticate itself when linking to uplink,
		this will also be the C:Line password on uplink.
		We will assume the password to be testlink.

name		This will be the server name of the GNUworld Oper Service server, keep it in mind,
		we will assume it is services.undernet.org.

description	Put whatever you want here, it will just be the server comment
		in the /whois X or /whois Uworld outputs.

Do not change maxclients.
At this step you should have finished editing GNUworld.conf, save it.

Now, right before trying to run GNUworld, you need to setup your C:Lines, H:Lines and U:Lines on
your IRC server(s) in order for GNUworld to be able to operate normally.

You will need to add the following U:Line/U Block in *ALL* servers on your network
(or Uworld will not be able to do modes, and X won't be able to op itself in channels)

U:Line (for ircd versions up to ircu2.10.11.x series)
	U:services.undernet.org::*

U Block (for ircd versions from ircu2.10.12.x series)
	[N/A]

You need to add the following lines/blocks only to the ircd.conf of the uplink server :

Lines to add (for ircd versions up to ircu2.10.11.x series)
	H:*:*:services.undernet.org
	C:192.168.0.1:testlink:services.undernet.org::90

Block additions (for ircd versions from ircu2.10.12.x series)
	[N/A]

this assumes 90 is a valid Y:Line in your config and is of type Server Class,
replace, if needed by the apropriate number.


Do not forget to either kill -HUP <your ircd PID> or /rehash as an Oper on it
for the changes in ircd.conf to take effect.


NOW ...

You should be able to start GNUworld ! issue the following command to start it : :/home/gnuworld/gnuworld/bin$ ./gnuworld -c -f GNUWorld.conf & If, for some reason, this doesnt work at this point and GNUworld either doesn't link at all to your network or gets disconnected immediately, take a look at the following files' last lines before asking your question on #coder-com on Undernet : /home/gnuworld/gnuworld/bin/socket.log and /home/gnuworld/gnuworld/bin/debug.log If GNUworld is linked, you should be able to /whois the two nicknames of the two clients (X-like and Uworld-like) you defined in cservice.conf and ccontrol.conf. If GNUworld is linked, you should be able to /whois the nickname of the X-like client you defined in cservice.conf. If GNUworld is linked, you should be able to /whois the nickname of the Uworld-like client you defined in ccontrol.conf. To login to X, issue the following command on IRC : /msg X@services.undernet.org login Admin temPass -X- AUTHENTICATION SUCCESSFULL AS Admin! You will change your password later using the web interface since the 'newpass' command was lately removed in X and is now outdated. To login to Uworld, issue the following command on IRC : /msg Uworld login Admin temPass -Uworld- Authentication successfull. Then change your password : /msg Uworld newpass your_new_password -Uworld- Password changed. The user's default for the Admin account is to allow non Opers to log in, provided they have the good password, since that user has alot of power, it is probably a good idea to change this so only Opers could login as Admin. For this, issue the following command : /msg Uworld moduser Admin -op on -Uworld- NeedOp set to ON for Admin. You now need to configure the website in order to use all the features of GNUworld, if you do not go on, you will not be able to use features as : - Channel automatic registration - User creation - Various forms and password recovery - Ability for admins to view and control alot of things over mod.cservice You have finished setting up GNUworld mod.ccontrol module. Clicking "Next" will bring you to the Table of Contents of this Interactive Guide. If you need any extra information, please feel free to /join #coder-com on /server us.undernet.org or /server eu.undernet.org.

Configuring website (config.inc)


Configuring config.inc is required, but should'nt be too much painfull ;)

	:/home/gnuworld/gnuworld/bin$ cd ../../website/php_includes/
	:/home/gnuworld/website/php_includes$

Edit the file config.inc with any decent text editor...
		DO NOT USE wordpad.exe HERE (or anywhere else tho ;P).

if you used wordpad.exe, click here and chill ;).


IMPORTANT NOTICE:
	The config.inc file starts with <? and ends with ?>.
	This should remain as is, if you insert any spaces or lines at the end or the begining
	of the file, the website will not work, echoing errors about Cannot add header....



	<?
	/*

	<!-- : config.inc,v -.-- ----/--/-- --:--:-- nighty Exp  //-->

	'config.inc' For GNUworld's mod.cservice's website interface

	Created:  - 10/29/2001
	Last modif:  - --/--/----

	This file contains two sections,
	- what you *MUST* edit to ensure your website can work properly.
	- what you *CAN* edit to tweak it more precisely.

	Enjoy!@#

	*/

	/*------------------------------------------------------------------------*/
	/*   WHAT YOU NEED TO EDIT (when finished, look at the end of this file)  */
	/*------------------------------------------------------------------------*/

For the example we will assume it stays in a /live subdir of an existing website.
	define(LIVE_LOCATION,"/live"); // define this to "" if you dont put it in a subdirectory like '/live' (default) but in '/' for example.

Set this to whatever your site will have as URL and the others for your convenience.

	define(IFACE_URL,"http://www.your-site.com/live/"); // The GUI main URL (the one to access it)

	define(IFACE_URL,"http://www.some-site.com/~youruser/live/"); // The GUI main URL (the one to access it)

	define(SERVICE_CHANNEL,"#cservice"); // The CService Official Channel

	/* NOTE: to FORGE reply adresses, user 'nobody' needs a 'Tnobody' line added in /etc/sendmail.cf (or equiv.) */

	define(NETWORK_NAME,"Your Network"); // Define this to your network name... better to be a "normal" single word ;)
	define(BOT_NAME,"X"); // You bot's name, defines some strings in the website to fit more your configuration.
	define(IRC_SERVER,"irc.network.net"); // Default server for irc:// option.
	define(NETWORK_EMAIL,"cservice@network.net"); // the email of your network (default).

	define(PURGE_EMAIL,"purge@network.net"); // the email where channel purge request form is sent.
	define(XAT_EMAIL,"x@network.net"); // the email where manager change form is sent.
	define(OBJECT_EMAIL,"object@network.net"); // the email where replies to password changes are sent.
	define(ABUSE_GLOBAL_EMAIL,"abuse@network.net"); // the email where abuse NOT REGARDING Channel Service should go (for complaints)

	define(FROM_NEWUSER,"cmaster@network.net"); // the From: email for a NEWUSER registration email
	define(FROM_NEWUSER_SUBJECT,"Your Channel Service Account"); // the subject of that mail.

	define(FROM_FPASS,"cmaster-recovery@network.net"); // the From: email for a FORGOTTEN PASSWORD email.
	define(FROM_FPASS_SUBJECT,"Your Channel Service Password for "); // the sujbect of that mail. 'username' is added at this string's end.

	/******************************/
	/* LOCAL DATABASE DEFINITIONS */
	/******************************/
LOCAL DATABASE (local_db)
The default should fit our whole example. gnuworld is the user having access to the PostgreSQL
on the local machine.

You need to add the password of gnuworld for LOCALDB_PASS if you use password with PostgreSQL.

	define(LOCALDB_NAME,"local_db"); // the local database that contains the gnuworld/doc/local_db.sql information.
	define(LOCALDB_USER,"gnuworld"); // the local user that has full access to LOCALDB_NAME.
	define(LOCALDB_PASS,""); // the password, use blank if you dont use passwords.

	/*******************************/
	/* REMOTE DATABASE DEFINITIONS */
	/*******************************/
REMOTE DATABASE (cservice)
The default should fit our whole example. gnuworld is the user having access to the PostgreSQL
on the local machine (which *can* be remote, but not forcibly like here..).

You need to add the password of gnuworld for REMOTEDB_PASS if you use password with PostgreSQL.

	define(REMOTEDB_NAME,"cservice"); // the remote databasr that contains cservice.sql, cservice.web.sql information.
	define(REMOTEDB_USER,"gnuworld"); // the user that has access remotely to that db
	define(REMOTEDB_PASS,""); // the password, use blank if you dont use passwords.
	define(REMOTEDB_HOST,"127.0.0.1"); // define to whatever host/IP of the "remote" db is.

	/*******************************/
	/* LOCAL WEBSITE CONFIGURATION */
	/*******************************/
	define(HOSTING_LOGO,""); // this image should go in website/docs/gnuworld/images and be maximum 250*33 pixels.
	define(HOSTING_URL,"");
	define(HOSTING_STATS,0); // 1: enable, 0: disable. If you enabled this you *NEED* to ensure that a file
				 // called 'hosting_stats' is WRITABLE by the httpd user in /tmp.
				 //
				 // This option enables/disables the page access to 901+ on the web as well.
				 // If the file is not found, or found not writable, it's disabled.

There's a link to CService Site in the site's left menu, define here where that link should go,
it will be sent to _top (the whole browser current window).
	define(CSERVICE_SITE_URL,"../");






	/*---------------------*/
	/*  WHAT YOU CAN EDIT  */
	/*---------------------*/

You should change all those variables to random salts you pick instead of 0123456789.
NOTE: the size of the SALT is not important, but a reasonable value like 10 chars give a certain amount of security.
	define(CRC_SALT_0001,"0123456789");
	define(CRC_SALT_0002,"0123456789");
	define(CRC_SALT_0003,"0123456789");
	define(CRC_SALT_0004,"0123456789");
	define(CRC_SALT_0005,"0123456789");
	define(CRC_SALT_0006,"0123456789");
	define(CRC_SALT_0007,"0123456789");
	define(CRC_SALT_0008,"0123456789");
	define(CRC_SALT_0009,"0123456789");
	define(CRC_SALT_0010,"0123456789");
	define(CRC_SALT_0011,"0123456789");
	define(CRC_SALT_0012,"0123456789");
	define(CRC_SALT_0013,"0123456789");
	define(CRC_SALT_0014,"0123456789");
	define(CRC_SALT_0015,"0123456789");
	define(CRC_SALT_0016,"0123456789");
	define(CRC_SALT_0017,"0123456789");
	define(CRC_SALT_0018,"0123456789");
	define(CRC_SALT_0019,"0123456789");
	define(CRC_SALT_0020,"0123456789");

	/* SALTs for external authentication capabilities (experimental) */
	define(CRC_SALT_EXT1,"0123456789");
	define(CRC_SALT_EXT2,"0123456789");
	define(CRC_SALT_EXT3,"0123456789");
	define(CRC_SALT_EXT4,"0123456789");
	define(CRC_SALT_EXT5,"0123456789");

	/*
	    those options are only used when using multiple mirrors of your CService website
	    if you dont do mirrors at all, just leave those options as they are, this wont affect anything.
	    if you do mirrors, the following options means that if the website is accessed with "ROUNDROBIN",
	    it will automatically redirect accesses to "LOCALMIRROR".
	*/
	define(ADMINONLY_MIRROR,0); // Define this to 1 if you want that only * person can login.
	define(CLIENT_MIRROR_URL,"http://cservice.network.net/live/"); // define this in case ADMINONLY_MIRROR is set to 1.

As stated above, do not modify this unless you have the use of it.
The purpose is, for example, if you plan to have http://cservice-live.undernet.org/
to point to a DNS Round Robin, with mirrors of the site.
Each mirror also has its cservice-live.xx.undernet.org DNS pointer,
for example depending on the country .. cservice-live.fr ... cservice-live.us....
Configuring the next parameters according to that will make that if you access a page from within
the URL http://cservice-live.undernet.org/, the site will automatically refresh it to
http://cservice-live.xx.undernet.org/, so you dont mess with multiple sites while browsing,
because this would just NOT work according to the current web authentication scheme that reads
a database locally for each mirror.

	define(LOCALMIRROR,"cservice-live.xx.network.net");
	define(ROUNDROBIN,"cservice-live.network.net");


Below is a brand new functionnality ... the site only comes with a single theme by default (called 'default')
and if you look in 'gnuworld/doc/update_themes.sql' and in the 'website/docs/gnuworld/themes/data' directory you'll see it is easy
to add other themes by yourself .. just copy the INSERT clause from the .sql file and change the first number '1' to '2', and so on...
Soon an interface will come up to modify and create themes when online as a 901+ level.
The AUTO_SWITCH_THEMES function will  permit for example for your site to automatically pick a different theme for a certain date or period you will decide,
this can be used to christmas, halloween, new year, and other various stuff at your convenience.
Unfortunately this function is not finished either at this time but will also work very shortly.

	/******************/
	/* THEMES OPTIONS */
	/******************/
ATTENTION: STD_THEME is case sensitive, check what was in the "INSERT" you eventually did.
	define(STD_THEME,"default");  // define this to your site Theme, this MUST be a valid sub-directory of 'website/docs/gnuworld/themes/data/'
				      // If you want more information on this new feature, please visit http://cservice.undernet.org/gnuworld-setup/
				      // or check the gnuworld/doc/idoc/ directory.
	define(AUTO_SWITCH_THEMES,0); // If you set this .. dated themes will appear when they should (latest 'created_ts' "wins" if periods cover each other)
				      // (not working at the moment... sorry)


	/*************************/
	/* VARIOUS CHECK OPTIONS */
	/*************************/
	define(ENABLE_NOTES,1); // set this to 1 to enable or 0 to disable the "Notes" link on the web
				// you *NEED* to have your X (mod.cservice) bot running with the code
				// supporting it to enable this, check out 'gnuworld/doc/notes.sql' too.
	define(NOTES_ADMIN_ONLY,1); // This applies if 'ENABLE_NOTES' is set to 1, when set to 0, everyone can use the feature
				    // when set to 1, only * persons can.
	define(NOTES_LIM_TOTAL,10); // Total number of notes a user can send to all users. (0 = unlimited)
	define(NOTES_LIM_PERUSR,3); // Total number of notes a user can send to a single user. (0 = unlimited)
	define(NOTES_LIM_INBOX,15); // Total number of notes a user can have in his 'notes box'. (0 = unlimited)
	// of course, if ENABLE_NOTES is defined to '0', above three values have no effect.

	define(COOKIE_DOMAIN,""); // Blank:default. Define this to ".yourdomain.com" or anything else at your own risks ;P

	define(BOFH_PASS_ADMIN,1); // set this to 0 to disable password complexity checking for * people.
	define(BOFH_PASS_USER,0); // set this to 1 to enable password complexity checking for all users (overriding BOFH_PASS_ADMIN=0).
	define(PW_MIN_CHARS,6); // minimum chars a password must contain.
	define(PW_MIN_CAPSL,1); // minimum upper case letters a password must contain.
	define(PW_MIN_MINSL,1); // minimum lower case letters a password must contain.
	define(PW_MIN_DIGIT,1); // minimum digits a password must contain.
	define(PW_MIN_OTHER,1); // minimum other chars a password must contain.

	define(IPCHK_MAXHITS,3); // Number of failed forgotten_pass/login attempts before IP_LOCK

	define(IPCHK_BANTIME,86400); // Time your IP/username is locked (seconds) when caught into IPCHK_MAXHITS+ failed attempts.

	define(ENABLE_COMPLAINTS_MODULE,0); // set this to 0 to disable , 1 to enable, the /complaints reporting module (for example if you dont use it ;P)

The next parameter, instead of the 0, if you have enabled the above complaint module,
has to be an existing user ID (number) on your database. This will be the user that will post the anonymous
objections (admin comments) to pending channels when a complaint is lodged for that.
	define(COMPLAINTS_ADMINCOMMENT_ID,0); // this is *MUST* be set to a PERMANENTLY VALID USERNAME ID, if COMPLAINTS MODULE is enabled.
					      // this will be the user that will post the anonymous objections under the form of an admin comment
					      // when a complaint of this type is sent.

	define(NEWUSERS_GFXCHECK,0);				// 1 = add a graphical code entry check to "newusers", 0 = disable the feature (or if no "libgd" is present)
	define(FONT_PATH,"/home/gnuworld/website/fonts/");	// ABSOLUTE PATH to the 'website/fonts/' directory (normally "/home/gnuworld/website/fonts/")
	define(SPECIFIC_FONT,"rans.ttf");			// if you let this empty, fonts will be randomly chosen into FONT_PATH (one single font used per code/image).
	define(JPEG_OUT_QUALITY,57);				// %Quality of the JPEG generated (the less you put this, the harder it will be to read/recognize, ranges 1 to 100).

	define(NEWUSERS_IPCHECK,0); // define this to 1, if you want to enable ONE IP = ONE USERNAME per 24h.

set the two following parameters to 0 to disable them.
	define(LREQ_TIME,600); // min time between forgotten password requests to avoid flooding, set this to 0 to disable.

	define(UNETUB_TIME,14400); // 4 hours before being able to create another user from the same IP. set to 0 to disable.

	define(REGPROC_IDLECHECK,1); // If this is set to 1, users that are idle more than 21 days will not be allowed to
				     // register a channel or be a channel supporter until they login to the bot on IRC.


	define(REGPROC_ALLOWMULTIPLE,0); // If this is set to 1, users will be allowed to register an unlimited amount
					 // of channels, but will still be allowed to have only ONE channel being applied at a time.


	define(DEFAULT_REQUIRED_SUPPORTERS,10); // this option defines number of default required supporters (see below).
	/*
	This feature needs you to update the schema as following if you are NOT making a new installation :
		ALTER TABLE variables ADD last_updated INT4;

	Current feature of REQUIRED_SUPPORTERS :
			0	set it to 0 to allow instant registration (no supporters)	[VERY SMALL NETWORKS]
			1-9	requiring 1 to 9 supporters for standard registration		[VARIOUS NETWORKS]
			10	requires 10 supporters to register a channel.			[WIDE NETWORKS]

	>>>>>>> IMPORTANT NOTICE <<<<<<<<
	The number of required supporters will be, if not existing in tables "variables" in the remote DB,
	updated to the number you set above (ie. first run), BUT, if there's already a definition for it in the DB,
	the DB one will be the one used by the interface.
	You can change the amount of required supporters using the website itself in 'ACL Manager'.
	You must be 901+ to view the [Modify] button next to number of required supporters, ensure
	the "New Regs" are LOCKED (at the top of the ACL Manager page) then click on the [Modify] button,
	One button there will allow you to reset to "config.inc"'s setting, or change to another number,
	after validating, re-open "New Regs" and see the changes.
	This requires to login with a user with an admin access of 901 or above (coder level only).
	>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<
	*/




	/* To show you read this whole file, please comment or remove the next line. */

add // at the begining of the following line :
	//die("<h2><b>Error</b>: Edit website/php_includes/config.inc file !</h2>");

	?>




Save the file !

Configuring and setting up 'THE JUDGE'


appjudge is a pgtclsh script that, ran by crontab, will check
for applications in Pending status to make them to Notification period,
or Reject applications that didnt passed Traffic Check, or put in
Ready for review state other applications that passed and are ready to be
reviewed by CService administrators for registration.

In other words, you need this for your Automatic Registration System to work.


	:/home/gnuworld/website/php_includes$ exit
	:/root# cd /home/gnuworld/gnuworld/doc/cmaster/
	:/home/gnuworld/gnuworld/doc/cmaster# cp -rp regproc/ /usr/local/pgsql/
	:/home/gnuworld/gnuworld/doc/cmaster# chown -R gnuworld /usr/local/pgsql/regproc/
	:/home/gnuworld/gnuworld/doc/cmaster# su - gnuworld
	:/home/gnuworld$

	:/home/gnuworld/website/php_includes$ cd ../../gnuworld/doc/cmaster/
	:/home/gnuworld/gnuworld/doc/cmaster$ cp -r regproc/ /home/gnuworld



Edit the /usr/local/pgsql/regproc/appjudge-config file, and set your preferences,

Edit the /home/gnuworld/regproc/appjudge-config file, and set your preferences,

the defaults at 99 are definetly not good.


	# Database name (duh)

Set this to the CService database, in our example, cservice
	set SQL_DB "cservice"

DO NOT MODIFY THIS heh!@#
	# Number of seconds in a day, I suggest you do not change this ;)
	set DAY                         86400

Tweak the following for your convenience
	# Number of days an application has to pass the activity test
	set MAX_DAYS                    99

	# Number of unique IP's that must visit a channel during the activity test
	set UNIQUE_JOINS                99

	# Number of supporters that must visit the channel during the activity test
	set MIN_SUPPORTERS              99

	# Duration of the notify period
	set NOTIFY_DAYS                 99

	# Number of days supporters have to confirm their support
	set SUPPORT_DAYS                99

You definetly need to change this 0 to an existing user ID (number) on your database,
for example, if you had activated the complaints module earlier (when editing 'config.inc') it is wise to pick,
here the same ID as in COMPLAINTS_ADMINCOMMENT_ID in 'config.inc'...
	# The Judge's Reviewer ID
	set REVIEWER_ID                 0

DO NOT MODIFY THIS EITHER
	# These are better left alone
	set AS_PENDING_SUPPORT          0
	set AS_TRAFFIC_CHECK            1
	set AS_NOTIFICATION             2
	set AS_COMPLETED                3
	set AS_CANCELLED                4
	set AS_PENDREVIEW               8
	set AS_REJECTED                 9


Save the file !


Ensure /usr/local/pgsql/regproc/appjudge is set executable :

	:/home/gnuworld$ chmod 755 /usr/local/pgsql/regproc/appjudge


Add the content of /usr/local/pgsql/regproc/cron-judge.in to gnuworld's crontab :

	:/home/gnuworld$ crontab /usr/local/pgsql/regproc/cron-judge.in

Ensure /home/gnuworld/regproc/appjudge is set executable :

	:/home/gnuworld/gnuworld/doc/cmaster$ chmod 755 /home/gnuworld/regproc/appjudge


Add the content of /home/gnuworld/regproc/cron-judge.in to gnuworld's crontab :

	:/home/gnuworld/gnuworld/doc/cmaster$ crontab /home/gnuworld/regproc/cron-judge.in


Getting Apache


To get the latest Apache server, go to ,
and take the latest 1.3.x.

Recommended version .

Put that, as root in your /root home directory.

Getting PHP


To get the latest version of PHP, go to .

Recommended version .

PHP also requires these programs if you plan to use the Graphical code check on 'New users' :
( compiling with libGD support )
Program Version Main Site
libPNG
libJPEG
FreeType2
zlib
Put these, as root in your /root home directory.

Building Apache with PHP and PostgreSQL support


Side note: of course it's always best to be up to date with php and apache version

if you have apache_ or php- .. don't hesitate, take it ;)

I will be a bit short on it because :
	- It should'nt need to be long ;)
	- Apache and PHP documentations are way more complete than that one.

	:/root# tar -xzf 
	:/root# tar -xzf 

	* EITHER YOU COMPILE IT WITH LIBGD SUPPORT (for the Graphical code for new users)
		:/root# tar -xzf 
		:/root# tar -xzf 
		:/root# tar -xzf 
		:/root# tar -xzf 
		:/root# cd apache_/
		:/root/apache_# ./configure --prefix=/usr/local/apache
		:/root/apache_# cd ../zlib-/
		:/root/zlib-# ./configure --prefix=/usr
		:/root/zlib-# make
		:/root/zlib-# make install
		:/root/zlib-# cd ../freetype-/
		:/root/freetype-# gmake
		:/root/freetype-# gmake		(yes twice)
		:/root/freetype-# gmake install
		:/root/freetype-# cd ../libpng-/
		:/root/libpng-# cd scripts
		:/root/libpng-# cp makefile. ../Makefile
		:/root/libpng-# cd ..
		:/root/libpng-# make
		:/root/libpng-# make install
		:/root/libpng-# cd ../jpeg-/
		:/root/jpeg-# ./configure
		:/root/jpeg-# make
		:/root/jpeg-# make install
		:/root/jpeg-# cd ../php-/
		:/root/php-# ./configure --with-pgsql=/usr/local/pgsql --enable-track-vars --with-apache=../apache_ \
					  --with-zlib --with-gd --enable-gd-native-ttf --with-ttf --enable-gd-imgstrttf \
					  --with-jpeg-dir=../jpeg- --with-png-dir=../libpng- \
					  --with-freetype-dir=/usr/include/freetype2/freetype

	* OR YOU COMPILE IT WITHOUT LIBGD SUPPORT (NO Graphical code for new users, simplier)
		:/root# cd apache_/
		:/root/apache_# ./configure --prefix=/usr/local/apache
		:/root/php-# ./configure --with-pgsql=/usr/local/pgsql --enable-track-vars --with-apache=../apache_

	Then you continue with ...

	:/root/php-# make
	:/root/php-# make install
	:/root/php-# cd ../apache_/
	:/root/apache_# ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
	:/root/apache_# make
	:/root/apache_# make install
	:/root/apache_# cd ../php-
	:/root/php-# cp php.ini-dist /usr/local/lib/php.ini

Make sure you edit /usr/local/lib/php.ini to set "register_globals" to "On"
otherwise the interface wont work. (before starting apache or you will have to restart)

	:/root/php-# cd /usr/local/apache/htdocs/
	:/usr/local/apache/htdocs# chmod 711 ~gnuworld
	:/usr/local/apache/htdocs# chmod 711 ~gnuworld/website
	:/usr/local/apache/htdocs# chmod 755 ~gnuworld/website/php_includes
	:/usr/local/apache/htdocs# chmod 644 ~gnuworld/website/php_includes/config.inc
	:/usr/local/apache/htdocs# chmod 755 ~gnuworld/website/docs/gnuworld/
	:/usr/local/apache/htdocs# ln -s /home/gnuworld/website/docs/gnuworld live

Edit the file /usr/local/apache/conf/httpd.conf...
	Find
		<IfModule mod_dir.c>
			DirectoryIndex index.html
		</IfModule>

	and replace by :
		<IfModule mod_dir.c>
			DirectoryIndex index.php index.html
		</IfModule>





	then find (look for example for 'AddType') :
		# And for PHP 4.x, use:
		#
		#AddType application/x-httpd-php .php
		#AddType application/x-httpd-php-source .phps

	and replace by : (if you haven't found the lines above, add them in the file then)
		# And for PHP 4.x, use:
		#
		AddType application/x-httpd-php .php
		AddType application/x-httpd-php-source .phps


Save the httpd.conf !


Now we can START apache :

	:/usr/local/apache/htdocs# ../bin/apachectl start

And you can go to :

	http://www.your-site.com/live/

and see if that works (that should if you dont mess with your URL ;)).


Short HOWTO on apache's <VirtualHost> directive


This may be not needed for most users if the previous step worked, but in case you wonder
how you could, if someone makes cservice.some-domain.com point to your machine
to put the GNUworld interface on it .. here is how it works :

Edit the /usr/local/apache/conf/httpd.conf file ..

Find the line :

	#NameVirtualHost *

and uncomment it, giving :

	NameVirtualHost *


Then, go to the end of the file and add the following :

	<VirtualHost *>
		ServerAdmin your@email.com
		DocumentRoot /home/gnuworld/website/docs/gnuworld
		ServerName cservice.some-domain.com
		ErrorLog logs/cservice.some-domain.com-error.log
		CustomLog logs/cservice.some-domain.com-access.log common
	</VirtualHost>


save httpd.conf,
then restart apache :

	:/root# /usr/local/apache/bin/apachectl restart

Change the following line in /home/gnuworld/website/php_includes/config.inc :

	define(LIVE_LOCATION,"/live");

replace by

	define(LIVE_LOCATION,"");


and go to http://cservice.some-domain.com/.

Installation Successfull


Congratulations, you have set up GNUworld on your machine.

You can go back to Home page,
or visit one of the following links for additionnal information :

	Coder-Comittee			http://coder-com.undernet.org/
	Undernet CService		http://cservice.undernet.org/
	Undernet CService Web Interface	http://cservice.undernet.org/live/

	GNUworld Home			http://www.gnuworld.org/


	Frequently Asked Questions (FAQs)
	Upgrading GNUworld
	Credits




How do I give myself admin access to X ?
First you have to edit the cservice.addme.sql script, you will find it in
the doc/ directory of the 'gnuworld' cvs repository.
What you have to do is edit the username who will be added:
e.g.:
	INSERT into users (user_name,password,language_id,last_updated) VALUES ('Admin','07d976a29bdb3ff42e19c102852151b28097bbad',1,now()::abstime::int4);
Change the "Admin" to your preferred username.
After that you run it with this command:
	psql cservice < cservice.addme.sql



Whats the full command to start GNUWorld ? After installation, the binary is contained in the gnuworld/bin directory. If you don't want to see debug output, the best way to run gnuworld is: cd gnuworld/bin ./gnuworld -c -f GNUWorld.conf >/dev/null 2>&1 & The -c option will however log debug output in debug.log and socket.log in the bin/ directory, if you don't want that, just don't use the -c option.

I get this error: PostgreSQL error message: connectDBStart() -- connect() failed: Connection refused Make sure you are starting the PostgreSQL server with the -i parameter (To listen on TCP sockets).

I get this error: checking for libpq++.h... configure: error: Unable to find PostGreSQL Are you sure you have installed PostgreSQL ? It can be downloaded from http://www.postgresql.org Also, ensure you read the PostgreSQL documentation and add the configuration flag --with-CXX to install the PostgreSQL C++ API. We recommend you read our current documentation about it used with GNUworld.

Were can i get the Website module for GNUWorld X ? You can obtain it from CVS: cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gnuworld login (There is no password, just press enter) and tand then type: cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gnuworld checkout website

How can i upgrade GNUWorld without install it again ? To upgrade your GNUWorld version, you go to the gnuworld/ directory and use the CVS command: cvs update -d

How can i have that documentation on my server ? You should find it in gnuworld/doc/idoc directory. Please read the README file first.

I changed number of required supporters in the config but the page doesnt take it This is because the config.inc value is only a "default" one you can restore when you want. When you *FIRST* run the website, and when no "number of supporters required" value is yet set in the database, it reads it from config.inc and stores it as "first default" in the databse, but then, if it exists and has a value in the database, it will NEVER re-read it from the config.inc file unless you specifically ask for it in the 'ACL Manager' page, this is also the place where you can, and should change that value when it has already been set once. To modify this you need a "coder" level (901 or above), go to 'ACL Manager' page, ensure that the "New Regs" are LOCKED, then click on the [Modify] button on the right of the "Required number of supporters", you can here, either reset database value to the current config.inc's one, or set it to something else between 0 and 10. When done, have the "New Regs" unlocked and you have it (dont forget to eventually reload the Channel Registration Page in order to correctly see the changes).

My website is doing errors complaining about 'tz_setting' and/or 'acl', how do i fix this ? Latest patch problem user may encouter is the "timezone" setting that has been moved to the database instead of being stored in a cookie, this implied changes about the database, added to that a new ACL system came up, replacing the WebAxs page, this also required some database schema modification ... For people upgrading from a version that still had the WebAxs link in the left menu, to the new website version, the one with ACL Manager... you need to : execute the two update_tzmove_r.sql and update_tzmove_l.sql files in gnuworld/doc directory, respectively to remote (cservice) and local (local_db) databases, psql cservice < update_tzmove_r.sql psql local_db < update_tzmove_l.sql then if you would examine the other cservice.sql or cservice.web.sql files you would notice the following changes are also required in the remote database (cservice): Run psql cservice and type the following at the cservice:=# prompt : CREATE TABLE acl ( acl_id SERIAL, user_id INT4 NOT NULL, isstaff INT2 NOT NULL, flags INT4 DEFAULT '0' NOT NULL, xtra INT4 NOT NULL, last_updated INT4 NOT NULL, last_updated_by INT4 NOT NULL, suspend_expire INT4 DEFAULT '0' NOT NULL, suspend_by INT4 DEFAULT '0' NOT NULL, deleted INT2 DEFAULT '0' NOT NULL ); ALTER TABLE pendingusers ADD poster_ip VARCHAR(15) DEFAULT ''; ALTER TABLE users ADD maxlogins INT4 DEFAULT 1;

I enabled 'NOTES' in my config.inc file and the page is doing errors about it This feature was added recently, in order to handle it properly you need the latest CVS version of GNUworld (mod.cservice) and of the website. If the errors are complaining about a "notes" thing missing somewhere, it's probably because that new table is not created in your remote database structure (cservice): Run psql cservice and type the following at the cservice:=# prompt : CREATE TABLE notes ( message_id SERIAL, user_id INT4 CONSTRAINT users_notes_ref REFERENCES users( id ), from_user_id INT4 CONSTRAINT users_notes_ref REFERENCES users( id ), message VARCHAR( 300 ), last_updated INT4 NOT NULL, PRIMARY KEY(message_id, user_id) );

Upgrading GNUworld or the website can be done easily if a few rules are followed, sometimes,
just in case you get a weird error, have a look at this page first, you may find very usefull
information here.

This page assumes that you have installed GNUworld using our guide.

Quite all the times, there's a problem after upgrading GNUworld and/or website,
the problem comes from the database schema that is outdated because you haven't updated it aside.

If any db schema occur, you will see that the files in gnuworld/doc directory, will have
some change (when you cvs update -d), if there's is any then you need to ensure your
database structure is correct by :
	- watching changed/added files in gnuworld/doc
	- watching gnuworld/mod.cservice/RELEASE.NOTES

and apply eventual patches or sql script you would need to.

Here are some links to FAQs regarding latest problems you may encounter in upgrading GNUworld :

CERT Security Advisory: you should upgrade to php-4.1.2 for security reasons :
	http://www.cert.org/advisories/CA-2002-05.html


If you have any questions please see home page and links to help URLs, emails or IRC Channels.


This help was built thanks to everyone in #coder-com on Undernet that contributed,
either in having problems thus making us think about how to explain better so these don't occur,
or in pointing bugs or mistakes.

Special thanks to A1kmm for pushing me in putting this "non-root setup guidelines".
Thanks to MrIron for providing support with the FAQs...
Thanks to d[a]aave for pointing out how to ensure PostgreSQL runs strictly locally secured.

This documentation is in no way perfect and will be modified from time to time according
to GNUworld evolutions and users problems.

Thanks to whoever pushed me to do it.


								nighty.