IP Management With PHPIP
Phpip is an IP Management tool which helps to manage your network with the detailed information of your client or network IP at the distributed point. This is basically useful for ISPs as well as large networks.
Now we are going to install this system with the following steps, here we go...
phpIP Management requires that the following software is installed on your system.
mySQL 4.0 or greater
PHP 4.4 or greater
Packages for RPM-based Operating Systems
Packages for DEB-based Operating Systems
• Php4 or php5
• Php4-mysql or php5-mysql
(In case of rpm based installation check whether the following additional packages are installed or not otherwise your install.php process won't be successfull.
php-pear-<ver>.rpm, php-ldap-<ver>.rpm, automake-<ver>.rpm,php-mysql-<ver>.rpm
Ports for FreeBSD
• lang/php4 (With MySQL Support)
- Package downloads
- Installation (RHEL4AS/Fedora/CentOS5.2/other linux flavour + Mysql 4x/5x+ Apache 2.x) In my installation I have used mainly (RHEL4AS + MySql 4.1.x + Apache/2.0.52)
- Configuration (PHPIP configuration on file includes/install.database.php + MySQL server)
1. Extract the distribution tarball. (default web root directory /var/www/html/)
# cd /var/www/html/
# wget http://jaist.dl.sourceforge.net/sourceforge/phpip/phpip-4.3.2-build-200611081420.tar.gz
# tar –xzvf phpip-version.tar.gz
2. Rename the directory.
# mv phpip-4.3.2-build-200611081420/ phpip/
3. Edit your Apache configuration:
# vi /etc/httpd/conf/httpd.conf
Add the following lines according to your settings in your httpd.conf:
<VirtualHost 192.168.10.100> ServerName ipmanager.ispexperts.com.np ServerAdmin [email protected]np DocumentRoot /var/www/html/ DirectoryIndex index.php <Directory /var/www/html/phpip> Order deny,allow Deny from all Allow from 192.168.10.20 192.168.10.20 192.168.30.0/24 </Directory> </VirtualHost>
# service mysqld restart
# mysqladmin -u root password testpassword
(Some time the following command may need to grant the useraddress to the database if previously created otherwise the web interface will perform it automatically.)
# mysql -u root -p
mysql>grant all privileges on phpip_managemnet.* to 'root'@'localhost' identified by 'mypassword';
mysql>grant all privileges on phpip_managemnet.* to 'phpip'@'localhost' identified by 'phpip';
Now access your web interface after restarting the httpd service:
# service httpd restart
Follow the step by step install instructions there might come some problem due to incomplete package installation that I have stated above like php-ldap,php-pear,php-mysql etc. Here you will create phpip admin user with database login access for phpip_management (database).
After successful installation you can rename the following file.
Follow the step by step install instructions.
4. Rename the following file: includes/install.database.php
#mv includes/install.database.php includes/database.php
<?php /* +-------------------------------------------------------------------------+ | Copyright (C) 2006 Michael Earls | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | +-------------------------------------------------------------------------+ | - phpIP - http://www.phpip.net/ | +-------------------------------------------------------------------------+ */ // Create database connection and select database mysql_select_db('ip_management', mysql_pconnect('localhost','root','mypassword')) or die (mysql_error()); ?>
Now check your mysql database there you can find a phpip_management database created by web based php interface.
NOTE:-This is all about the PHPip installation but it hurts when you are going to upgrade your previous phpip to the latest version of phpip which is not facilitated by the software vendor. Ok, let's follow the steps to upgrade:
- First take the backup of your MySql phpip_management database; eg.
# mysqladmin --add-drop-table -u mysqluser -pmypassword phpip_management > /backup/phpipmgmt.sql
- Install fresh/new PHPip ADD the individual CIDR that were created on older PHPip
- Now restore the backup but still the Actual IP detail doesn't display until you edit NetMenu and Adderess tables in phpip_management database. eg.
# mysql -u mysqluser -pmypassword phpip_management < /backup/phpipmgmt.sql
- You have to update the field NetID of Address table checking every records of Net_CIDR Net_IPs of NetMenu NetMenuID
# mysql> select * from NetMenu;
(list first 30 records)
# select * from Address limit 0,30;
mysql -dump addresses /backup/test.sql;
# update Address set NetID=3 where NetID=16;
update addresses set NetID=3 where NetID=16;
update addresses set NetID=13 where NetID=17;
update addresses set NetID=14 where NetID=18;
update addresses set NetID=15 where NetID=19;
update addresses set NetID=16 where NetID=20;
update addresses set NetID=18 where NetID=22;
update addresses set NetID=17 where NetID=21;
update addresses set NetID=12 where NetID=23;
update addresses set NetID=11 where NetID=24;
update addresses set NetID=10 where NetID=25;
update addresses set NetID=9 where NetID=26;
update addresses set NetID=8 where NetID=27;
update addresses set NetID=7 where NetID=28;
update addresses set NetID=6 where NetID=29;
update addresses set NetID=4 where NetID=31;
update addresses set NetID=24 where NetID=35;
update addresses set NetID=19 where NetID=44;
update addresses set NetID=20 where NetID=43;
update addresses set NetID=21 where NetID=42;
update addresses set NetID=26 where NetID=47;
update addresses set NetID=27 where NetID=48;
update addresses set NetID=28 where NetID=49;
(NetID=3 is from NetMenu cidr id and NetID=16 which is to be changed according to New NetMenu CIDR id. ). In previous versions of PHPip some table names are changed like (user changed to users in latest versions)
update addresses set NetID=30 where NetID=30;
- Restart your mysql server and httpd server.
service mysqld restartGood! Now CIDR value will be updated with the previous IP details.
service httpd restart
SNAPSHOTS:-Check URL below for my installation process.