mirror of https://github.com/tLDP/LDP
204 lines
6.7 KiB
Plaintext
204 lines
6.7 KiB
Plaintext
=======================================
|
|
Installation
|
|
=======================================
|
|
|
|
2002-08-04
|
|
2002-10-27 LAMPADAS_DB_USER and LAMPADAS_DB
|
|
|
|
Installation of lampadas is a bloody mess.
|
|
Report all problems, suggestions and flames to
|
|
|
|
alexander.bartolich@gmx.at
|
|
|
|
Tested with Red Hat 7.3, Debian 3.0r0 and SuSE 7.3.
|
|
|
|
Directory 'doc' holds some related plain text files.
|
|
'doc/INSTALL.ancient' are the original notes from David Merill.
|
|
'doc/INSTALL.mandrake' is ppadala's diary of a successful installation
|
|
on Mandrake 8.2.
|
|
'doc/INSTALL.redhat' are special steps required on Red Hat 7.x
|
|
|
|
A summary of the process:
|
|
|
|
0. Copy/extract lampadas files
|
|
1. Install a lot of tools, modules, packages
|
|
2. Build documentation in directory 'doc'
|
|
3. Install postgresql database
|
|
4. Install apache, python 2.x and mod_python
|
|
5. Configure Apache
|
|
|
|
=======================================
|
|
0. Copy/extract lampadas files
|
|
=======================================
|
|
|
|
Reading this file means you somehow accomplished this step.
|
|
Note that lampadas does not require compilation and copying of
|
|
resulting files to some destination directory. Move the whole
|
|
directory to the final location, e.g. /opt/lampadas.
|
|
This directory can be operated read-only after configuration.
|
|
|
|
=======================================
|
|
1. Install a lot of tools, modules, packages
|
|
=======================================
|
|
|
|
The preferred way to verify this step is with a bash script you'll
|
|
find in this directory:
|
|
|
|
./configure
|
|
|
|
The script is very dumb. It tries to identify your distribution
|
|
and then checks whether files exist in the usual places.
|
|
|
|
I don't like third-party RPMs and unstable DEBs. My philosophy
|
|
is to use as much standard packages as possible, and compile
|
|
everything else manually. In this case:
|
|
|
|
wt2db-0.5
|
|
pypgsql-2.1
|
|
mod_python-2.7.8 (only Red Hat)
|
|
|
|
Please contact me if your distribution is unusual or you prefer
|
|
to compile all things from scratch. And please read all of this
|
|
document before you install missing things.
|
|
|
|
If all tests are passed ./configure will patch a few text files
|
|
with correct path names. This is not fool proof. Please check at
|
|
least the files 'bin/setenv.sh' and 'conf/lampadas.conf'.
|
|
|
|
=======================================
|
|
2. Build documentation in directory 'doc'
|
|
=======================================
|
|
|
|
This step is very optional. First of all it's just documentation,
|
|
nothing vital. And then the installation kit (lampadas-*.tar.gz)
|
|
already contains all rendered output.
|
|
|
|
It's a nice way to test some tools from step #1, though.
|
|
And developers accessing CVS should really give it a try.
|
|
|
|
cd doc
|
|
make clean
|
|
make
|
|
|
|
Documentation includes some man-pages. You can view them like this:
|
|
|
|
nroff -man doc/lampadas.1 | less
|
|
|
|
If you prefer a more comfortable 'man lampadas' instead, FIXME
|
|
|
|
=======================================
|
|
3. Install postgresql database
|
|
=======================================
|
|
|
|
All major distributions provide pre-fabricated packages of postgresql.
|
|
You still need to create user accounts and configure authentication,
|
|
though. Local accounts are the easiest case since that requires no
|
|
passwords or network control.
|
|
|
|
Usually there is only one privileged account (called 'postgres')
|
|
with access to the postmaster. You will need two other accounts.
|
|
One for database management, one for the web server.
|
|
See 'bin/setenv.sh' for the value of LAMPADAS_WWW_USER.
|
|
It should have been set by ./configure.
|
|
|
|
To grant your installation account access, do the following (as root,
|
|
since user postgres has no password set):
|
|
|
|
su - postgres -c "createuser -A -d $LAMPADAS_DB_USER"
|
|
|
|
The web server requires less permissions:
|
|
|
|
su - postgres -c "createuser -A -D $LAMPADAS_WWW_USER"
|
|
|
|
You won't need root access again for the database. The default value
|
|
of LAMPADAS_DB_USER is 'lampadas'. This should be your postgres
|
|
account for installation and maintenance. If you create a UNIX account
|
|
of the same name on the machine running postgres then you should
|
|
have no further problems with authentication.
|
|
|
|
Create a database instance (default of LAMPADAS_DB is 'lampadas'):
|
|
|
|
createdb -E UNICODE -U $LAMPADAS_DB_USER $LAMPADAS_DB
|
|
|
|
Test the result:
|
|
|
|
psql $LAMPADAS_DB $LAMPADAS_DB_USER
|
|
|
|
To create tables and insert default values use 'bin/lampadasdb'.
|
|
This tool requires a lot of environment variables defined by
|
|
'bin/setenv.sh'. Please read the comments in that file.
|
|
|
|
. bin/setenv.sh
|
|
bin/lampadasdb create
|
|
bin/lampadasdb insert
|
|
|
|
You can revert 'create' with 'drop' and 'insert' with 'delete'.
|
|
The opposite of 'createdb' is 'dropdb'.
|
|
|
|
=======================================
|
|
4. Install apache, python 2.x and mod_python
|
|
=======================================
|
|
|
|
Lampadas requires Python 2.x. This is a problem On Red Hat 7.x, where
|
|
'/usr/bin/python' is a Python 1.x. Read 'doc/INSTALL.redhat' how to
|
|
roll your own.
|
|
|
|
On the other hand Red Hat has no problems with compilation of
|
|
pypgsql-2.1. My experience on both Debian 3.0r0 and SuSE 7.3
|
|
is that 'python setup.py build' breaks because of missing header
|
|
files. Add the result of
|
|
|
|
pg_config --includedir
|
|
|
|
to variable C_INCLUDE_PATH. In the simplest case this means
|
|
|
|
export C_INCLUDE_PATH=`pg_config --includedir`
|
|
|
|
On SuSE 7.3 another directory is required, i.e.
|
|
|
|
export C_INCLUDE_PATH=/usr/include/pgsql:/usr/lib/apache/include/python2.1
|
|
|
|
I also found that you can safely ignore the message
|
|
|
|
gcc: unrecognized option `-R/usr/local/pgsql/lib'
|
|
|
|
and just continue with 'python setup.py install'.
|
|
|
|
=======================================
|
|
5. Configure Apache
|
|
=======================================
|
|
|
|
./configure makes no guesses about Apache. You can use pre-fabricated
|
|
packages or roll your own. On the other hand you have to perform any
|
|
modification to 'httpd.conf' manually.
|
|
|
|
We need 'mod_python' (is described in the next chapter) and we need
|
|
the following standard modules:
|
|
|
|
mod_alias
|
|
mod_env
|
|
mod_rewrite
|
|
|
|
Go sure the corresponding 'LoadModule' line is active. If your
|
|
'httpd.conf' contains a 'ClearModuleList' statement you also need
|
|
a 'AddModule' for every module.
|
|
|
|
Directory 'conf' contains examples of virtual hosts. Probably the
|
|
easiest way to add such a configuration to your Apache is an include
|
|
statement in 'httpd.conf':
|
|
|
|
include /home/alba/cvs/LDP/lampadas/conf/test.httpd.conf
|
|
|
|
./configure patches the path names in directory 'conf', so this
|
|
part of the configuration should work (minus the mod_python stuff).
|
|
You can (and should) modify the value of statement 'ServerName', though.
|
|
|
|
You need to map the virtual server name to your local IP address.
|
|
If you don't have a DNS under your control a entry in /etc/hosts
|
|
should do:
|
|
|
|
127.0.0.1 test.lampadas.org
|
|
|
|
Before direct your web browser to 'http://test.lampadas.org' go sure
|
|
that you don't access a proxy for that domain or address '127.0.0.1'.
|