开源IP地址管理工具phpIPAM部署

  1. 安装必要的依赖:
sudo yum install -y httpd mariadb mariadb-server php php-mysql php-gd php-ldap php-xml php-mbstring
  1. 安装 phpIPAM:
cd /var/www/html
sudo git clone https://github.com/phpipam/phpipam.git
sudo chown -R apache:apache phpipam/
  1. 创建数据库和用户:
sudo systemctl start mariadb
sudo mysql -u root
CREATE DATABASE phpipam;
CREATE USER 'phpipam'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON phpipam.* TO 'phpipam'@'localhost';
FLUSH PRIVILEGES;
exit

请将 'password' 替换为您自己的密码。

  1. 导入数据库:
cd /var/www/html/phpipam/db/
sudo mysql -u phpipam -p phpipam < SCHEMA.sql
sudo mysql -u phpipam -p phpipam < FUNCTIONS.sql
  1. 配置 phpIPAM:
cd /var/www/html/phpipam/
cp config.dist.php config.php
sudo chown apache:apache config.php
sudo vi config.php

在这个文件中,您需要配置数据库连接信息和管理员账户信息。

  1. 为 Apache 配置虚拟主机:
sudo vi /etc/httpd/conf.d/phpipam.conf

在文件中添加以下内容:

<VirtualHost *:80>
    ServerName your.domain.name
    DocumentRoot /var/www/html/phpipam/
    <Directory /var/www/html/phpipam/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog /var/log/httpd/phpipam-error.log
    CustomLog /var/log/httpd/phpipam-access.log combined
</VirtualHost>

请将 your.domain.name 替换为您的域名或 IP 地址。

  1. 重启 Apache 服务:
sudo systemctl restart httpd

现在您可以在浏览器中访问您的 phpIPAM 网站了。默认管理员账户是 admin,密码是 ipamadmin。请登录后及时修改密码。

posted @ 2020-11-09 15:26  wanghongwei-dev  阅读(1031)  评论(0编辑  收藏  举报