kevin@kevin-virtual-machine:~$ sudo apt-get install fping [sudo] password for kevin: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: fping 0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded. Need to get 32,0 kB of archives. After this operation, 90,1 kB of additional disk space will be used. Get:1 http://id.archive.ubuntu.com/ubuntu jammy/universe amd64 fping amd64 5.1-1 [32,0 kB] Fetched 32,0 kB in 0s (201 kB/s) Selecting previously unselected package fping. (Reading database ... 171483 files and directories currently installed.) Preparing to unpack .../archives/fping_5.1-1_amd64.deb ... Unpacking fping (5.1-1) ... Setting up fping (5.1-1) ... Processing triggers for man-db (2.10.2-1) ... kevin@kevin-virtual-machine:~$ sudo apt-get install php-snmp Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: php8.1-snmp snmp The following NEW packages will be installed: php-snmp php8.1-snmp snmp 0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded. Need to get 201 kB of archives. After this operation, 810 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://id.archive.ubuntu.com/ubuntu jammy-updates/main amd64 php8.1-snmp amd64 8.1.2-1ubuntu2.20 [23,2 kB] Get:2 http://id.archive.ubuntu.com/ubuntu jammy/main amd64 php-snmp all 2:8.1+92ubuntu1 [1.836 B] Get:3 http://id.archive.ubuntu.com/ubuntu jammy-updates/main amd64 snmp amd64 5.9.1+dfsg-1ubuntu2.6 [176 kB] Fetched 201 kB in 0s (689 kB/s) Selecting previously unselected package php8.1-snmp. (Reading database ... 171493 files and directories currently installed.) Preparing to unpack .../php8.1-snmp_8.1.2-1ubuntu2.20_amd64.deb ... Unpacking php8.1-snmp (8.1.2-1ubuntu2.20) ... Selecting previously unselected package php-snmp. Preparing to unpack .../php-snmp_2%3a8.1+92ubuntu1_all.deb ... Unpacking php-snmp (2:8.1+92ubuntu1) ... Selecting previously unselected package snmp. Preparing to unpack .../snmp_5.9.1+dfsg-1ubuntu2.6_amd64.deb ... Unpacking snmp (5.9.1+dfsg-1ubuntu2.6) ... Setting up php8.1-snmp (8.1.2-1ubuntu2.20) ...
Creating config file /etc/php/8.1/mods-available/snmp.ini with new version Setting up snmp (5.9.1+dfsg-1ubuntu2.6) ... Setting up php-snmp (2:8.1+92ubuntu1) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libapache2-mod-php8.1 (8.1.2-1ubuntu2.20) ... Processing triggers for php8.1-cli (8.1.2-1ubuntu2.20) ...
그리고 /etc/apache2/apache2.conf 파일에 수정이 필요합니다.
vi /etc/apache2/apache2.conf
아래처럼 추가합니다.
<Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride all order allow,deny Allow from all #Require all granted </Directory>
apache를 새로 시작 합니다
sudo systemctl restart apache2
지금까지 [phpIPAM][#6]-fping and snmp install for scan 글을 읽어주셔서 감사합니다.
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.
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#
phpipam is an open-source web IP address management application (IPAM). Its goal is to provide light, modern and useful IP address management. It is php-based application with MySQL database backend, using jQuery libraries, ajax and HTML5/CSS3 features.
지원되는 기능은 아래와 같습니다.
192.168.10.0/24를 스캔을 하고 아래 처럼 사용중인 IP주소에 Description를 설정해서 관리 가능 합니다.
초록색이 현재 사용중인 IP주소를 표시 됩니다. 192.168.10.0/24 대역중에서 어떤 IP주소가 사용 중인지 확인 가능 합니다.