Инструменты пользователя

Инструменты сайта


common_linux:phpipam

Установка phpIPAM

Клонирование кода phpIPAM из репозитория:

git clone --recursive https://github.com/phpipam/phpipam.git /var/www/html/phpipam
cd /var/www/html/phpipam
git checkout -b 1.5 origin/1.5

Скопировать файл конфигурации config.dist.php в config.php

cd /var/www/html/phpipam
cp config.dist.php config.php

Отредактировать параметры секции отвечающей за подключение к СУБД в config.php:

 * database connection details
 ******************************/
$db['host'] = 'db-sql.virtlab.local'; #адрес сервера СУБД
$db['user'] = 'phpipam';
$db['pass'] = 'securepassword';
$db['name'] = 'phpipam';
$db['port'] = 3306;

Настроить модули Apache2:

a2dissite 000-default.conf
a2enmod rewrite
systemctl restart apache2

Если используется версия PHP7.4++, то в нем отключен модуль PEAR. Его необходимо установить вручную:

wget http://pear.php.net/go-pear.phar
/usr/bin/php7.4 go-pear.phar

Отвечаем на вопросы:

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.
 
 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($php_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. System manual pages directory                 : /usr/man
11. Tests directory                               : /usr/tests
12. Name of configuration file                    : /etc/pear.conf
 
1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to /etc/pear.conf...
Initialized registry...
Preparing to install...
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
</usr/share/pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.
 
 
Would you like to alter php.ini </etc/php/7.4/cli/php.ini>? [Y/n] :
 
php.ini </etc/php/7.4/cli/php.ini> include_path updated.
 
Current include path           : .:/usr/share/php
Configured directory           : /usr/share/pear
Currently used php.ini (guess) : /etc/php/7.4/cli/php.ini

Прописываем в файл /etc/php/7.4/apache2/php.ini значение «Current include path» из листинга выше:

; UNIX: "/path1:/path2"
include_path = ".:/usr/share/pear"

Создать конфигурационный файл /etc/apache2/sites-available/phpipam.conf

| phpipam.conf
<VirtualHost *:80>
    ServerAdmin admin@virtlab.local
    DocumentRoot "/var/www/html/phpipam"
    ServerName ipam.virtlab.local
    ServerAlias ipam
    <Directory "/var/www/html/phpipam">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "/var/log/apache2/phpipam-error_log"
    CustomLog "/var/log/apache2/phpipam-access_log" combined
</VirtualHost>

Выдать разрешения на каталог:

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

Включить сайт и перезагрузить службу:

a2ensite phpipam
systemctl restart apache2

На узле с СУБД создать базу и пользователя:

mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
 
MariaDB [(none)]> create database phpipam;
MariaDB [(none)]> GRANT ALL on phpipam.* to phpipam@'%' identified by 'securepassword';
MariaDB [(none)]> exit

Перенести на узел СУБД файл db/SCHEMA.sql и выполнить заполнение базы:

mysql -u root -p phpipam < db/SCHEMA.sql
common_linux/phpipam.txt · Последнее изменение: 2024/12/21 19:00 — 127.0.0.1