안녕하세요.
오늘은 phpIPAM를 설치해보겠습니다.
1. PC에서 putty 또는 crt를 사용해서 ubuntu 서버에 접속합니다.
2. 필요한 utility를 설치 합니다.
sudo apt install curl wget zip git -y |
3. Apache httpd랑 mysql를 설치 합니다.
sudo apt install apache2 mariadb-server mariadb-client -y |
4. PHP Components를 설치 합니다.
sudo apt install php php-curl php-common php-gmp php-mbstring php-gd php-xml php-mysql php-ldap php-pear -y |
5. MySQL Database를 설치 합니다
sudo su mysql_secure_installation |
Press Enter to login as root - password를 입력 합니다.
Type N and press Enter to not switch to unix socket authentication
Type Y and press Enter to set a root password, type the password twice to confirm
Type Y and press Enter to remove anonymous users
Type Y and press Enter to disallow root login remotely
Type Y and press Enter to remove the test database
Type Y and press Enter to reload privilege tables
아래는 결과값 입니다.
kevin@kevin-virtual-machine:~$ sudo su root@kevin-virtual-machine:/home/kevin# 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 haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] New password: Re-enter new password: Sorry, passwords do not match. 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] y ... Success! 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! root@kevin-virtual-machine:/home/kevin# |
6. MySQL Table를 생성합니다.
mysql -u root -p CREATE DATABASE php_ipam; GRANT ALL ON php_ipam.* to 'php_ipam_rw'@'localhost' IDENTIFIED BY 'P4P1p@m!!'; FLUSH PRIVILEGES; EXIT; exit |
아래는 결과값입니다. 패스워드를 위와 같이 사용 하겠습니다.
root@kevin-virtual-machine:/home/kevin# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 39 Server version: 10.6.18-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> CREATE DATABASE php_ipam; Query OK, 1 row affected (0,001 sec) MariaDB [(none)]> GRANT ALL ON php_ipam.* to 'php_ipam_rw'@'localhost' IDENTIFIED BY 'P4P1p@m!!'; Query OK, 0 rows affected (0,002 sec) MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0,001 sec) MariaDB [(none)]> EXIT; Bye root@kevin-virtual-machine:/home/kevin# exit~ exit~: command not found |
7. 나머지 설정을 하겠습니다.
git를 사용해서 phpipam를 다운로드 받습니다.
sudo git clone https://github.com/phpipam/phpipam.git /var/www/html/phpipam |
root@kevin-virtual-machine:/home/kevin# sudo git clone https://github.com/phpipam/phpipam.git /var/www/html/phpipam Cloning into '/var/www/html/phpipam'... remote: Enumerating objects: 35088, done. remote: Counting objects: 100% (1427/1427), done. remote: Compressing objects: 100% (425/425), done. remote: Total 35088 (delta 1243), reused 1002 (delta 1002), pack-reused 33661 (from 3) Receiving objects: 100% (35088/35088), 28.16 MiB | 1.12 MiB/s, done. Resolving deltas: 100% (25403/25403), done. root@kevin-virtual-machine:/home/kevin# |
8. /var/www/html/phpipam 폴더에 이동합니다.
cd /var/www/html/phpipam |
9. 최신버전을 확인합니다.
sudo git checkout "$(git tag --sort=v:tag | tail -n1)" |
아래는 결과값입니다.
root@kevin-virtual-machine:/var/www/html/phpipam# sudo git checkout "$(git tag --sort=v:tag | tail -n1)" Note: switching to 'v1.7.3'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c <new-branch-name> Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 602d8122 Bugfix: PDNS PHP8 compatibility cleanup. Fixes #4337 root@kevin-virtual-machine:/var/www/html/phpipam# |
10. phpipam 폴더 onwer를 설정 합니다.
sudo chown -R www-data:www-data /var/www/html/phpipam |
11. sample config file를 복사합니다
sudo cp /var/www/html/phpipam/config.dist.php /var/www/html/phpipam/config.php |
12. config.php 파일을 수정하기 위해서 vim를 설치 합니다
sudo apt-get install vim |
13. config.php 파일을 수정합니다.
sudo vim /var/www/html/phpipam/config.php |
아래처럼 주석처리 하고 새로운 설정값을 생성하고 저장합니다.
#$db['host'] = '127.0.0.1'; #$db['user'] = 'phpipam'; #$db['pass'] = 'phpipamadmin'; #$db['name'] = 'phpipam'; #$db['port'] = 3306; $db['host'] = '127.0.0.1'; $db['user'] = 'php_ipam_rw'; $db['pass'] = 'P4P1p@m!!'; $db['name'] = 'php_ipam'; $db['port'] = 3306; define('BASE', "/phpipam/"); |
14. 서비스를 시작 합니다.
sudo a2enmod rewrite sudo systemctl restart apache2 |
15. 이제 실제로 phpIPAM를 설치 하기 위해서 아래처럼 입력합니다
http://192.168.10.117/phpipam
admin페이지 password를 입력합니다.
'IPAM Tools > phpIPAM' 카테고리의 다른 글
[phpIPAM][#7]- basic administration Setting (0) | 2024.12.22 |
---|---|
[phpIPAM][#6]-fping and snmp install for scan (0) | 2024.12.22 |
[phpIPAM][#4]-ssh server install (0) | 2024.12.22 |
[phpIPAM][#3]-Ubuntu update and upgrade (1) | 2024.12.22 |
[phpIPAM][#2]-Ubuntu 22.04.5 install (0) | 2024.12.22 |