How to Install phpIPAM on Void Linux
phpIPAM is an open-source IP address management (IPAM) tool that allows network administrators to keep track of their IP addresses, subnets, VLANs, DHCP, and DNS. It is easy to install and can be used to manage small to large networks.
In this tutorial, we will show you how to install phpIPAM on Void Linux.
Prerequisites
Before we begin, ensure that your system meets the following requirements:
- A server running Void Linux
- Apache or Nginx installed and running
- PHP 5.5 or higher installed
- MySQL or MariaDB database server installed
Step 1: Download phpIPAM
The first step is to download phpIPAM from the official website. You can either download the latest stable release or the development version. For this tutorial, we will download the stable release.
wget https://github.com/phpipam/phpipam/releases/download/1.4.1/phpipam-1.4.1.tar
Step 2: Install Required Packages
Before we can install phpIPAM, we need to install some required packages:
sudo xbps-install -S apache mysql php php-mysqli php-gd php-curl php-mbstring php-gettext
Step 3: Install and Configure MariaDB
Next, we need to install MariaDB and configure it for phpIPAM:
sudo xbps-install -S mariadb
sudo mysql_install_db
sudo /etc/rc.d/mysql start
sudo mysql_secure_installation
During the installation, you will be prompted to enter a root password for the database. Be sure to set a strong password and remember it.
Step 4: Configure Apache or Nginx
Now that we have installed MariaDB, we need to configure our web server. If you're using Apache, create a new virtual host for phpIPAM:
sudo vi /etc/httpd/conf/extra/httpd-phpipam.conf
Add the following configuration:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/phpipam"
ServerName phpipam.example.com
<Directory "/var/www/html/phpipam">
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/phpipam.example.com-error_log"
CustomLog "/var/log/httpd/phpipam.example.com-access_log" common
</VirtualHost>
If you're using Nginx, create a new server block:
sudo vi /etc/nginx/conf.d/phpipam.example.com.conf
Add the following configuration:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html/phpipam;
index index.php;
server_name phpipam.example.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
error_log /var/log/nginx/phpipam.example.com-error.log;
access_log /var/log/nginx/phpipam.example.com-access.log;
}
Step 5: Install phpIPAM
Extract the contents of the phpIPAM tar file:
sudo tar -xvf phpipam-1.4.1.tar -C /var/www/html/
Next, we need to configure the phpIPAM database. Start by creating a new database named 'phpipam':
sudo mysql -u root -p
CREATE DATABASE phpipam;
GRANT ALL PRIVILEGES ON phpipam.* TO 'phpipam'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
Replace 'password' with a strong password of your choice.
Next, import the phpIPAM database:
sudo mysql -u phpipam -p phpipam < /var/www/html/phpipam/db/SCHEMA.sql
Finally, rename the 'config.dist.php' file to 'config.php':
cd /var/www/html/phpipam
sudo mv config.dist.php config.php
Open 'config.php' and set the database credentials:
$c['db']['host'] = 'localhost';
$c['db']['user'] = 'phpipam';
$c['db']['pass'] = 'password';
$c['db']['name'] = 'phpipam';
Replace 'password' with the password you set earlier.
Step 6: Configure PHP
Open the 'php.ini' file and make the following changes:
sudo vi /etc/php/php.ini
date.timezone = "UTC"
max_execution_time = 300
max_input_time = 600
memory_limit = 512M
post_max_size = 50M
upload_max_filesize = 50M
Step 7: Access phpIPAM
Restart Apache or Nginx:
sudo /etc/rc.d/apache restart
or
sudo /etc/rc.d/nginx restart
Access phpIPAM by navigating to http://phpipam.example.com in your web browser.
Congratulations! You've successfully installed phpIPAM on Void Linux.