{php}IPAM

{php}IPAM

phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application.

Here is a guide on how to install phpIPAM on CentOS 7.

  • Installing Apache, MySQL, PHP (LAMP) stack packages

Install all required packages for phpipam:

#yum install httpd mariadb-server php php-cli php-gd php-common php-ldap php-pdo php-pear php-snmp php-xml php-mysql php-mbstring git

  • Set correct timezone to php.ini to avoid php warnings:

grep timezone /etc/php.ini
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Africa/Johannesburg        

Configuring and running Apache webserver

Main apache configuration is in file /etc/httpd/conf/httpd.conf. Open it and change directory settings for /var/www/html to allow mod_rewrite URL rewrites:

<Directory "/var/www/html">
	Options FollowSymLinks
	AllowOverride all
	Order allow,deny
	Allow from all
</Directory>        

We also need to set server name, for now we will use localhost, change it to your FQDN:

ServerName locahost:80        

Save file and exit.

  • Start Apache and MariaDB

# systemctl start httpd

# systemctl enable httpd

# systemctl start mariadb

# systemctl enable mariadb

Firewall rule is also needed to pass http/https traffic to webserver from external interfaces if needed with following command:

# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --permanent --add-port=443/tcp
# firewall-cmd --reload        

  • Harden MariaDB server:

mysql_secure_installation

  • Download PHP installation files and set correct permissions

cd /var/www/html/

git clone https://github.com/phpipam/phpipam.git .

git checkout 1.4

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

find . -type f -exec chmod 0644 {} \;

find . -type d -exec chmod 0755 {} \;

  • Configuring database connection

Next we need to configure connection to database. To do it we first need to copy over sample config file to config.php that phpipam uses:

[root@localhost html]# cp config.dist.php config.php        

  • Installing phpIPAM

We are now ready to install phpipam. Open browser and go to http://ip_address/ to start with automatic database installation. For MySQL connection enter root username and password you created in point 1.4, this will only be used to create required databases, tables and grants. After installation is completed phpipam will used username/password entered in config.php file to access database, root password is not stored anywhere.

To view or add a comment, sign in

Others also viewed

Explore content categories