Version 1 (modified by benoitg, 13 years ago)

Line-by-line instr. for RHES4, incl. PHP compile and postgres config


These are step by step instructions to install an auth server installation on a virgin Red Hat Enterprise Linux 4 installation.

Step-by-step instructions

Install prerequisites

up2date postgresql-client postgresql-server
up2date gcc flex libxml2-devel postgresql-devel httpd-devel libtool libpng-devel subversion

Install PHP5 from source

RHEL4 doesn't have a recent enough PHP to run the wifidog auth server. We will have to compile one from source

Download PHP5 sources

cd folder_where_you_downloaded
tar -jxvf php-5.1.6.tar.bz2

Compile PHP with the required options:

cd php-5.1.6
./configure --with-pgsql --with-apxs2 --with-gettext --with-zlib --with-gd --enable-mbstring --with-config-file-path=/etc 
sudo make install
sudo cp php.ini-dist /etc/php.ini

Install the auth server

svn checkout
sudo mv wifidog-auth/ /var/www/

Install auth server external dependencies

Install required PEAR modules:

sudo pear install --alldeps Image_Graph-alpha


tar -zxvf FCKeditor_2.3.1.tar.gz
cd FCKeditor
sudo mv * /var/www/wifidog-auth/wifidog/lib/FCKeditor/ 

Configure apache

In file /etc/httpd/conf/httpd.conf:

Add php to the DirectoryIndex? directive:

DirectoryIndex index.html index.html.var index.php

Add the following new directive:

AddType application/x-httpd-php .php

Change DocumentRoot? to

DocumentRoot "/var/www/wifidog-auth/wifidog/"

Optional: Setup a ssl self signed key

Make sure you don't already have a proper key, this will destroy it!

cd /etc/httpd/conf/
rm ssl.key/server.key
rm ssl.crt/server.crt
make genkey
cd /usr/share/ssl/certs
make testcert
cd /etc/httpd/conf/ssl.key
cp server.key server.key.encrypted
openssl rsa -in server.key.encrypted -out server.key
chmod 400 server.key

Configure postgresql

While Postgres 8+ would be much faster on modern machines, version 7.4 in RHEL4 is sufficient to run wifidog. Add the following line to /var/lib/pgsql/data/postresql.conf:

tcpip_socket = true

Add the following lines to /var/lib/pgsql/data/pg_hba.conf:

host wifidog wifidog            md5
local wifidog wifidog           md5

Setup cron jobs

Add the following lines to /etc/crontab:

#Send status emails every two minutes
*/2 * * * * apache /usr/local/bin/php
#Vacuum the database every hour
01 * * * * apache /usr/local/bin/php

Configure the auth server

Go to  http://your_server_adress_here/install.php and follow the instructions.