doc/install/ubuntu/auth-server

Contributors: PascalCharest?, BenoitGregoire, Akasha Last update: 23th Nov 2011 Feel free to contribute and/or format better. This document is currently a draft and not completed!

Introduction

These are step by step instructions to install Wifidog auth-server on Ubuntu Linux (release 10.04)

Install the distro

Download the distro first cd, from :  Ubuntu: current release. Burn it and launch your computer with the cdrom in. This is a standard install: click on "install" on the desktop and follow the instructions. The default install will install a "lot" of un-needed things, if you don't have much disk space, you could try the Debian installation.

Ubuntu default software manager is apt, which make this guide very easy to write (almost a big cut-paste from the debian installation one)

On restart, enter your username / password in your gui ... and start Applications / Accessories / Terminal.

Install prerequisites

You will be logged on as a standard user, so we need to add sudo in front of every "root-runned" command. The bad way of doing it would be to log as root...so we don't do that ;-).

Before we install anything lets be sure we have access to internet and that our apt database is updated

sudo apt-get update

The authentification server require a webserver (apache2) and php (we install the latest version)

sudo apt-get install apache2 php5

If you are using a current/2011 debian/ubuntu, you have to enable long variable names in suhosin - otherwise php will not work as expected:

vi /etc/php5/apache2/conf.d/suhosin.ini
-> add:  suhosin.post.max_name_length = 100
-> add:  suhosin.request.max_varname_length = 100

Database server install

It also require a database server, so we will install PostgreSQL. It come fully configured (you might still want to check /etc/postgresql/8.3/main/postgresql.conf for customization).

sudo apt-get install postgresql

Install prerequisites - step2

We also need some specifics librairies

sudo apt-get install php5-cgi
sudo apt-get install php5-mhash php5-pgsql php-pear php5-xmlrpc php5-curl php5-mcrypt php5-dev
sudo apt-get install language-pack-en-base

To get the latest version of wifidog-auth we will need subversion:

sudo apt-get install subversion

Some more libs. On "sudo pear install Phlickr-0.2.5.tgz", you will receive an error like "/tmp/glibctestWTQG39:1:22: error: features.h no such file"... this isn't important, the install will continue without problem and FlickrPhotoStream? will be a valid content type.

sudo pear install XML_RPC
cd /tmp
wget http://ovh.dl.sourceforge.net/sourceforge/phlickr/Phlickr-0.2.5.tgz
sudo pear install Phlickr-0.2.5.tgz 
rm Phlickr-0.2.5.tgz

You might want to considere adding the openssh-server to your setup (easier to connect remotly). This is not a requierement for WIFIDOG-Auth.

sudo apt-get install openssh-server

Install the auth server

svn checkout https://dev.wifidog.org/svn/trunk/wifidog-auth
sudo mv wifidog-auth/ /var/www/

The file /var/www/wifidog-auth/wifidog/classes/Dependency.php needs to be edited or smarty installation will fail.

Change line 122 to the following:'website' => "http://www.smarty.net/",
Change line 123 to the following: 'installSourceUrl' => "http://www.smarty.net/files/Smarty-2.6.26.tar.gz",

Apache 2 configuration file

We need to change the document root. We take for granted that this server will be of no other "web" use... if it is, guess you'll have to learn how to configure apache2.

sudo nano /etc/apache2/sites-available/default

and change (at the fifth line):

        DocumentRoot /var/www/

to

        DocumentRoot /var/www/wifidog-auth/wifidog

restart apache2:

sudo /etc/init.d/apache2 restart

Configure locale in wifidog.conf

If you want translations in all the languages wifidog supports, you need to generate all the necessary locales. here are various manual ways to do that, but unless your disk space is at a premium, the simplest way to do that on ubuntu is to do the following:

  • sudo apt-get install language-pack-bg-base language-pack-de-base language-pack-el-base language-pack-es-base language-pack-fr-base language-pack-it-base language-pack-ja-base language-pack-pt-base language-pack-sv-base

You may also want to change the default language for the portal page in the file config.php

sudo nano /var/www/wifidog-auth/wifidog/config.php
define('DEFAULT_LANG', 'fr_CA');

by

define('DEFAULT_LANG', 'en_US');

(or whatever you want)

Configure mail server

You need to have a valid mailer in order to mail account confirmation!

Installing postfix

sudo apt-get install postfix

Select the "internet site with smart host" configuration option and answer the next series of questions.

Configure the auth server

Go to  http://your-domaine.com/install.php and follow the instructions. You can follow the following walk-though, under the install step: auth-server. It isn't updated though. Or you can follow the onscreen introduction ;-)

If you haven't configure you dns / domain redirection, you can get your ip-adress with the command "ifconfig". You can also connect from the system with  http://localhost/install.php

You must

cat /tmp/dog_cookie.txt

and click next in your browser (it will ask for the password in dog_cookie.txt)

They will ask to :

1) First screen

create a wifidog user in postgres

sudo su - postgres
createuser wifidog --pwprompt 

When it asks insert password

wifidogtest

IF you have PostgreSQL 8.1 : answer no to the three questions IF you have PostgreSQL 7.4 : answer no to the two questions

create a database owned by this new user

createdb wifidog --encoding=UTF-8 --owner=wifidog

2) Second screen:

You will have to copy-paste the big serie of command, click refresh and next. The easiest way of doing that is if you have a ssh connection to your box (this is why I proposed openssh-server package earlier)

sudo su -

then copy the whole pack of command

3) Third screen:

Verification of the installed software. If you followed this guide, you have the basic requierement for the install. Click install for simplepie, then next Click install for PHPMailer, then next Click install for feedpressreview, then next Click install for Smarty. (Phlickr is already installed, even if the system doesn't see it) Click NEXT.

4) Fourth screen

Fill out your db information.. ...

And a couple more "next" and everything will be working.

Remove installation files

Of course, the only one that should have access to the install.php file is you. You will need to move the file "install.php" out of public sight.

1) Go to your wifidog directory (/var/www/wifidog-auth/wifidog in our case).

cd /var/www/wifidog-auth/wifidog

2) Move "install.php" file to the parent directory which is not visible to the public:

mv install.php ../install.php

note that you can move it wherever you want, but make sure it's not public.

Getting stuck at last step of install.php, when you attempt to creat an admin user the script starts all over here is the fix:

Edit file install.php line 931 and remove "window.location.reload(true);"