phpIPAM installation on debian 6.0.6

I have received a request for help on manual installation of phpIPAM on debian linux, so I decided to write a small how-to if anyone else has problems or is not so familiar with linux distributions and environment. I have used fresh default debian 6.0 as distribution because it is widely used, I believe on ubuntu linux procedure should be very similar, except maybe for locations of some config files.

I have used the following settings for installation:

  • Fresh debian installation
  • MySQL server not yet installed and no root pass configured
  • Apache not installed and configured
  • phpipam will be installed in default directory (no vhosts) under /phpipam/ folder

If you already have MySQL/apache set you can skip point 3.

Installation procedure:

1.) Preparing environment and installing required apps

Update your sources (apt-get update) and install Apache, php and mysql server:

apt-get install apache2 mysql-server php5 php5-gmp php-pear php5-mysql php5-ldap

After all is installed and the apache server is running, you need to decide weather you will be running it under vhost or in subdirectory or root directory. For this guide I will have it in subdirectory http://server/phpipam/, so do the following:

cd /var/www/
tar -xvf phpipam-0.7.tar
rm phpipam-0.7.tar
cd phpipam

At this point you should have all the files and applications installed for phpipam.

2.) Setting phpipam configuration

Edit config.php and select MySQL user/pass you wish to use for phpipam and set rewriteBase to /phpipam/,and set your database details (select user/pass you wish to have for phpipam and database name – you can also leave it as it is):

vi config.php
$db['host'] = “localhost”;
$db['user'] = “phpipam”;
$db['pass'] = “phpipamadmin”;
$db['name'] = “phpipam”;

also set rewrite base in config.php (If you have it under root directory of your webserver than you can skip it)

define(‘BASE’, “/phpipam/”);

and in .htaccess

RewriteBase /phpipam/

3.) Setting up database

Now you need to setup MySQL database, if this is the first time you installed it (if you already have mysql running with root pass then you can skip this):

mysqladmin -u root password NEWPASSWORD

4.) Mod rewrite settings

Make sure apache supports mod_rewrite for web server, if it does not you will get errors /install/ not found (http 404) and similar. This means that either apache is not set to use .htaccess rewrites, or that you did not specify the rewritebase in step2 correctly.

Search for Directory directive in default apache config and add/change it to

vi /etc/apache2/sites-enabled/000-default

Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all

On debian you have to manually enable rewrite mod for apache, you can do it manually or via a2enmod

ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
sudo a2enmod rewrite

And restart apache:

/etc/init.d/apache2 restart

5.) Database installation

Now point you web browser to http://server/phpipam/ and the install script will start that installs default schema for phpipam database. Use mysql root password that you created in step 3 and click install.

br, Miha

4 thoughts on “phpIPAM installation on debian 6.0.6

  1. Scott

    I must be not seeing something because I’m having a hell of a time getting the installation to work. The funny thing is I’m a systems administrator, and I’ve done hundreds of PHP installations!

    Here’s my Apache file:


    DocumentRoot /www/company/phpipam/htdocs

    ErrorLog /logs/apache2/ipam-error.log
    CustomLog /logs/ipam-access.log combined env=!dontlog
    SetEnvIf Request_URI “^/favicon\.ico$” dontlog

    AddDefaultCharset utf-8

    Options -Indexes
    Order allow,deny
    Allow from all

    Options -Indexes
    AllowOverride none
    Order deny,allow
    Deny from all

    Options FollowSymlinks
    AllowOverride all
    Order allow,deny
    Allow from all

    …and my .htaccess file (has 0664 permissions)
    RewriteEngine On
    RewriteBase /

    …and my base in config.php
    define(‘BASE’, “/”);

    Am I missing something?


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>