Php-Ipam Setup Guide
Php-Ipam Setup Guide
Phpipam is an IP address and DNS management tool that is commonly deployed in large
IT departments.Often,it is used in conjunction with Vmware or other private clouds for ip
allocationa and de allocation.
Below are the steps to install phpipam server application,
Setting locale:
Add following to file /etc/environment for en_US coding, add your encoding if you will
Use different.
#add in the file :
LC_ALL=en_US.utf-8
LANG=en_US.utf-8
If you need crypt method for API you need to install also php-mcrypt php extension, which is
available on epel-release package:
yum install epel-release
yum install php-mcrypt
vi /etc/php.ini
#add at:
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Kolkata
1. We also need to set server name, for now we will use localhost, change it to your FQDN
ServerName locahost:80
Firewall rule is also needed to pass http/https traffic to webserver from external interfaces if
needed with following command:
yum install firewalld
systemctl start firewalld
systemctl enable firewalld
Check the firewall is running or not with below command
systemctl status firewalld
Add the ports in firewall, when the below commands has ran it should show as success.
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
Now start apache webserver, and also make sure it starts at boot:
1. Using github is preferred and easiest way to setup and maintain phpipam.
cd /var/www/html/
2. Clone the phpipam files in seperate folder, follow the below command to do that
3. Then we have to change the document root by opening the file /etc/httpd/conf/httpd.conf ,
DocumentRoot "/var/www/html/phpipam"
4. Then add one Directory in the same file,
<Directory "/var/www/html/phpipam">
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
All the files are downloaded in /var/www/html/phpipam folder as mentioned in the above
command.
I
phpipam code is now downloaded in /var/www/html, which is our document root.
1. To use latest phpipam development version leave out the "git checkout –b 1.4" command
2. Also make sure upload folders are accessible for xls/csv imports by opening the folder
phpipam and execute the below commands,
cd phpipam
git checkout -b 1.4 #To use latest phpipam development version
1. To do it we first need to copy over sample config file to config.php that phpipam uses:
cp config.dist.php config.php
2. Now open config.php file and set settings for database connection. Do not use root user/pass,
whatever you put here will be used for further connections to database and users from
config.php will be automatically created.
$db['host'] = 'localhost';
$db['user'] = 'phpipamadmin';
$db['pass'] = 'phpipampass';
$db['name'] = 'phpipamdata';
$db['port'] = 3306;
3. Restart httpd using below command,
systemctl restart httpd
Phpipam Installation
3. Then select Automatic database installation and login the database with "root user and
password " of mysql.
Then click on install pjpipam database, it will show Databse installed successfully then click
continue to next step.
After Installing the phpipam, first thing to do is to enable the required modules shown below,
1. API
2. Ip request module
3. Enable PowerDNS
4. Resolve DNS Names and the required modules as per your use.
3. To communicate with phpipam server through rest api, we need to create an api in the
phpipam server application.
1. Go to Api module on clicking the Api module from the right side phpipam settings
menu. Then click on create API Key.
2. Save the settings after creating the api,
3. To communicate with phpipam server application using the user token with http requests,
we need to change one paremeter in config.php file.
FLUSH PRIVILEGES;
5. create tables to store the data of domains, records and etc of created ip addresses in each subnet.
1. Change database:
USE powerdns;
2. Create following tables in power dns db,
7. In phpipam application select powerdns from the phpipam settings menu and configure the db
details and default settings for powerdns.
8. Then enable powerdns in subnets and refresh the threshold ttl.