Quick Setup of Apache, PHP, IMAP, pgSQL and TWIG ------------------------------------------------ This is the quick and dirty documentation, for complete details about the individual packages, please see the documentation included with the various packages. WARNING*WARNING*WARNING*WARNING*WARNING*WARNING*WARNING*WARNING* Building a server with a database on it that is publicly accessible to the Internet can be a LARGE security hole. This document takes no consideration of this and assumes that you know what your doing about the security on the server and database. WARNING*WARNING*WARNING*WARNING*WARNING*WARNING*WARNING*WARNING* This procedure was completed on a basic installation of RedHat Linux 5.2, other distributions of Linux may vary slightly. Assumptions: - you are logged in as root during the installation. - you have extracted your tar files in to /home/progs, however if you have them somewhere else you will need to replace /home/progs on the command lines with wherever you extracted the packages to. - You are using TWIG 2.4.0, if you are using a newer version you may need to change the archive and directory names. - you are using php 3.0.16, if you are using a newer version you may need to change the archive and directory names. - you are using apache 1.3.12, if you are using a newer version you may need to change the archive and directory names. - you are using the University of Washingtion's IMAP server version 4.7, if you are using a newer version you may need to change the archive and directory names. - you are using pgSQL version 7.02, if you are using a newer version you may need to change the archive and directory names. - all of the software (httpd, php, sql, etc.) are going to be running on the same system. Now on to the good stuff... --- 1 - download: ftp://ftp.php3.com/pub/php-3.0.16.tar.gz ftp://ftp.apache.org/dist/apache-1.3.12.tar.gz ftp://ftp.cac.washington.edu/imap/imap-4.7.tar.Z ftp://ftp.postgresql.org/pub/v7.0.2/postgresql-7.0.2.tar.gz http://twig.screwdriver.net/download/twig-2.4.0.tar.gz in to a directory that you can work in (i.e. /home/progs) 2 - decompress the above: gzip -d php-3.0.16.tar.gz gzip -d apache-1.3.12.tar.gz gzip -d imap-4.7.tar.Z gzip -d twig-2.4.0.tar.gz gzip -d postgresql-7.0.2.tar.gz 3 - untar the above tar -xvf php-3.0.16.tar tar -xvf apache-1.3.12.tar tar -xvf imap-4.7.tar tar -xvf twig-2.4.0.tar tar -xvf postgresql-7.0.2.tar 4 - build IMAP change in to imap-4.7 run make <system type> (where system type is slx for linux with shadow passwords) change in to c-client run ln -s /home/progs/imap-4.7/c-client lib run ln -s /home/progs/imap-4.7/c-client include (I'm not sure why the links are required but it's the only way I've been able to get php to compile...) 5 - build pgSQL change into postgresql-7.0.2 create a user for postgres to run as (typically postgres) run configure run gmake run gmake install run cd /usr/local/pgsql run mkdir data run chown data postgres run su - postgres run cd /usr/local/pgsql/bin run LD_LIBRARY_PATH=/usr/local/pgsql/lib;export LD_LIBRARY_PATH run initdb -D /usr/local/pgsql/data run postmaster -D /usr/local/pgsql/data -S At this time you may want to add pgsql to your startup scripts to autostart each time you restart your system, a sample line you could add is as follows: su - postgres -c /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data -S You may also want to add the LD_LIBRARY_PATH to your default login script. 6 - make pgSQL db's and table's and access rights This is where things get a little more complicated... First: decide on a name for the database (default is twig) henceforth referred to as <yourdbname>. Second: decide on a username (<username>) and password (<password>) that you want to have TWIG access the database as. Third: make sure that you can access the pgsql tools from the command line (i.e. they are in your path, or your in their home directory) NOTE: SQL names are case sensitive, so make sure you pay attention to the names you pick and type! Now, do the following as the postgres user: run createuser <username> (answer as you like for the permissions) edit /home/progs/twig-2.4.0/setup/twig.table.pgsql to use your <username> for the permissions at the bottom of the file run psql <yourdbname> < /home/progs/twig-2.4.0/setup/twig.table.pgsql 7 - configure apache change into ../apache-1.3.12 run ./configure 8 - configure and make php change into ../php-3.0.16 run ./configure --with-apache=../apache_1.3.12 --enable-track-vars --with-imap=/home/progs/imap-4.7/c-client --with-pgsql (note the full path in the --with-imap setting, it is REQUIRED to be the full path) run make run make install 9 - re-configure, build and install Apache change into ../apache-1.3.12 run ./configure --activate-module=src/modules/php3/libphp3.a run make run make install 10 - configure apache edit apache's httpd.conf file and change the following lines: Add index.php3 to the DirectoryIndex line In the <Directory rootdir> section change AllowOverride to All Add the following line: AddType application/x-httpd-php3 .php3 Add any other options you need for apache. At this time you may want to add apache to your startup scripts to autostart each time you restart your system. run apachectl start, to start apache 11 - install TWIG change into ../twig-2.4.0 run ./twig-install <doc root>/twig (or where ever you want twig installed) 12 - configure TWIG change to the directory you installed TWIG to. change to the config directory edit config.inc.php3, dbconfig.inc.php3, header.inc.php3, footer.inc.php4 and announcements (see TWIG's INSTALL file for details about other files you may want to edit) 13 - test TWIG start a web browser and go to your TWIG root directory and see if it works. 14 - done if you have any problems, take a look in TWIG's FAQ file for some common problems and solutions. Also try running the test page (test.php3).