IP Address Management (IPAM) is a coordinated set-up of devices to empower start to finish arranging,

conveying, overseeing and observing of your IP address framework, with a rich user experience.


The goal is to setup/install and configure IPAM on Ubuntu 20.04. IPAM(Ip Address Management) is an

open source web based ip address  management application. 


Pre-Requirements:

1. Mysql/Mariadb server

2 php

3. php Modules

4. Apache/nginx web server

5. php IPAM domain-- example.com(should be replaced with your domain or ip-address(for internal/local))


After 1st Login into system, set root login credentials for root login


sudo nano /etc/ssh/sshd_config

FROM:

#PermitRootLogin prohibit-password

TO:

PermitRootLogin yes

OR

sudo sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config

sudo systemctl restart ssh

sudo passwd


Login into system by root

ssh root@ip-addr


Update & Upgrade the system Packages

apt update && upgrade -y


Install MariaDB Server

apt install mariadb-server mariadb-client


Check MariaDB services is up and running

systemctl status mariadb

systemctl enable mariadb

systemctl start mariadb

Set a password for securing the database

mysql_secure_installation


Now, create database for ipam

mysql -u root -p       //enter password to login into mysql

CREATE DATABASE phpipam;

GRANT ALL ON phpipam.* TO phpipam@localhost IDENTIFIED BY 'STRONGPASSWORD';

//change strong password to req.password 

FLUSH PRIVILEGES;

QUIT;


Now, Install Git into system as we need to download/clone ipam code 

apt -y install git


Now, Install Php and the required modules for ipam

apt install software-properties-common

add-apt-repository ppa:ondrej/php

apt -y install php7.2

php -v

apt -y install php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-mcrypt php7.2-zip php7.2-fpm libapache2-mod-php php7.2-curl php7.2-xmlrpc php7.2-intl php7.2-gd php7.2-dev php-pear php7.2-gmp php7.2-dom php7.2-dev php-pear


Now, clone the IPAM code from GITHUB. It can be download in 2 ways.

git clone https://github.com/phpipam/phpipam/releases/download/v1.4.5/phpipam-v1.4.5.tgz

or

wget https://github.com/phpipam/phpipam/releases/download/v1.4.5/phpipam-v1.4.5.tgz


Now, unzip the downloaded file

tar zxvf phpipam-v1.4.5.tgz 

Now, copy the phpipam folder to /var/www/html/phpipam

cp -r phpipam /var/www/html/phpipam

Change the directory 

cd /var/www/html/phpipam

List out content of the folder

ls -al

Copy the config.dist.php as config.php

cp config.dist.php config.php




Now, Edit the file config.php, then change the password as per requirement

nano config.php

Change this lines

$db['host'] = 'localhost';

$db['user'] = 'phpipam';

$db['pass'] = 'ipam$890';///change/set password

$db['name'] = 'phpipam';

$db['port'] = 3306;


Now, Install Apache web service

apt -y install apache2


Now, run a2dissite command, which is used to enable or disable apache2 site

a2dissite 000-default.conf

Now, run a2enmod command, which is used to enable or disable apache2 module

a2enmod rewrite

Now, restart apache server

systemctl restart apache2

Now,edit apache phpipam configuration file and the content below

nano /etc/apache2/sites-available/phpipam.conf


#//ADD THIS LINES//#

<VirtualHost *:80>

    ServerAdmin admin@example.com

    DocumentRoot "/var/www/html/phpipam"

    ServerName ip-address //add ip-address here

    ServerAlias www.ipam.example.com

    <Directory "/var/www/html/phpipam">

        Options Indexes FollowSymLinks

        AllowOverride All

        Require all granted

    </Directory>

    ErrorLog "/var/log/apache2/phpipam-error_log"

    CustomLog "/var/log/apache2/phpipam-access_log" combined

</VirtualHost>

Set the permissions for directory

chown -R www-data:www-data /var/www/html

Now, enable the site by following command

a2ensite phpipam


Now, restart the apache server to apply the changes 

systemctl reload apache2


Hereby the ipam installation is completed. 

Now Open browser & type the IP-ADDRESS(example-192.168.0.101)




NOTE: If, unable to login use this commands and try again

  • mysql -u root

  • mysql> USE mysql;

  • mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';

  • mysql> FLUSH PRIVILEGES;

  • mysql> exit;

  • service mysql restart