一、IPAM管理系统简介
phpipam是一个开源Web IP地址管理应用程序(IPAM)。其目标是提供轻便,现代且有用的IP地址管理。它是基于PHP的应用程序,具有MySQL数据库后端,使用jQuery库,ajax和HTML5 / CSS3功能。
二、IPAM安装部署教程
2.1 环境准备
#安装依赖模块 Web server、Database 组件
[root@localhost ~]# 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 -y
#设置时区
[root@localhost ~]# vim /etc/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
# 修改下面语句
date.timezone =Asia/Shanghai
#启动 Apache Web Server 并设置开机启动
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
#启动 MySQL (MariaDB) database server
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
#配置 Apache Web Server
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
…………省略…………
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
######## 修改此处 ########
# AllowOverride none
AllowOverride all
Order allow,deny
Allow from all
#
…………省略…………
</Directory>
#初始化数据库设置
[root@localhost ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
2.2 安装phpIPAM
#从 git 下载 phpIPAM 文件
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# git clone https://github.com/phpipam/phpipam.git phpipam
正克隆到 'phpipam'...
remote: Enumerating objects: 30147, done.
remote: Counting objects: 100% (310/310), done.
remote: Compressing objects: 100% (164/164), done.
remote: Total 30147 (delta 153), reused 289 (delta 145), pack-reused 29837
接收对象中: 100% (30147/30147), 21.75 MiB | 11.88 MiB/s, done.
处理 delta 中: 100% (22244/22244), done.
#先cd 到phpipam确认下
git checkout 1.4
[root@localhost phpipam]# git checkout 1.4
分支 1.4 设置为跟踪来自 origin 的远程分支 1.4。
切换到一个新分支 '1.4'
#让 apache 用户有权限访问 phpipam
[root@localhost phpipam]# chown apache:apache -R /var/www/html/
[root@localhost phpipam]# cd /var/www/html/
[root@localhost html]# find . -type f -exec chmod 0644 {} \;
[root@localhost html]# find . -type d -exec chmod 0755 {} \;
#配置数据库链接
[root@localhost html]# cp /var/www/html/phpipam/config.dist.php /var/www/html/phpipam/config.dist.php.bak
[root@localhost html]# mv /var/www/html/phpipam/config.dist.php /var/www/html/phpipam/config.php
[root@localhost html]# vim /var/www//html/phpipam/config.php
/**
* database connection details
******************************/
$db['host'] = 'localhost';
$db['user'] = 'phpipam_user';
$db['pass'] = 'phpipam_Pass';
$db['name'] = 'phpipam_db';
$db['port'] = 3306;
# 还有一处需要替换
if(!defined('BASE'))
define('BASE', "/phpipam/");
#重启 http 服务
[root@localhost html]# systemctl restart httpd
2.3 phpIPAM web配置
http://x.x.x.x/phpipam/index.php?page=install x.x.x.x地址为服务器的地址
未完待续……
原文地址:https://www.cnblogs.com/zhaoqian0129/p/17232882.html
感谢大佬