This is a small documentation to install the database and the web server with PHP5.

PostgreSQL installation

To install the database server

emerge -av dev-db/postgresql

To configure postgresql

emerge --config =postgresql-8.0.4

To automise startup on boot

rc-update add postgresql default

To start and test postgresql

/etc/init.d/postgresql start

Apache 2 installation

emerge -av net-www/apache

PHP 5 installation

During the writing of this doc, PHP5 and PEAR packages are masked. You need to unmask them to allow their installation with emerge.

Add the following lines to /etc/portage/package.keywords file


Note: If new packages version are available change them to the newest if you want.

I don't know which libraries are specified in your USE variable (on your server in /etc/make.conf file), so you need to add missing libraries in /etc/portage/package.use to make PHP5 work with the auth-server.

An example of line to add in package.use:

dev-lang/php apache2 postgres xml xmlrpc pear ssl mbstring mhash unicode

To install PHP5

# emerge -av dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] dev-lang/php-5.1.1  -adabas -apache +apache2 -bcmath +berkdb -birdstep +bzip2 
-calendar -cdb -cgi -cjk +cli +crypt -ctype -curl -curlwrappers -db2 +dba -dbase -dbmaker -debug
 -discard-path -doc -empress -empress-bcs -esoob +exif -fastbuild -fdftk -filepro -firebird 
-flatfile -force-cgi-redirect -frontbase -ftp +gd -gd-external +gdbm -gmp -hardenedphp 
-hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc +ipv6 -java-external -kerberos
 +ldap -libedit -mcve -memlimit +mhash -ming -msql -mssql -mysql -mysqli +ncurses +nls -oci8 
-oci8-instant-client -odbc -pcntl +pcre -pdo -pdo-external +pear -pic +posix +postgres -qdbm 
+readline -recode -sapdb -sasl +session -sharedext -sharedmem -simplexml -snmp -soap -sockets 
-solid +spell -spl -sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer +truetype
 -vm-goto -vm-switch -wddx +xml -xmlreader +xmlrpc -xpm -xsl -yaz -zip +zlib 0 kB
[ebuild  N    ] dev-php/PEAR-PEAR-1.3.6-r3  150 kB

Apache and PHP

Now, you need to tell apache that PHP is installed and to use it. In the file /etc/apache2/httpd.conf you need to add "-D PHP5" to APACHE2_OPTS variable. If SSL is not set you can also add "-D SSL".

To automise startup on boot

rc-update add apache2 default

Start Apache web server

/etc/init.d/apache2 start

Test PHP

Create a PHP file with phpinfo command to test if PHP is working (and by the way see full informations about your PHP installation)

In /var/www/localhost/htdocs/ directory, create phpinfo.php file and add this lines :


Open the page in you browser :

You should see tables formated informations. Delete the file you test PHP.

Auth-server installation

Go to Auth server Installation page to continue with Wifidog portal installation.