{"id":57,"date":"2023-09-28T21:58:10","date_gmt":"2023-09-28T14:58:10","guid":{"rendered":"http:\/\/nitirat.ddns.net\/wordpress\/?p=57"},"modified":"2024-05-07T21:27:18","modified_gmt":"2024-05-07T14:27:18","slug":"how-to-install-phpipam-ip-address-management-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"http:\/\/nitirat.ddns.net\/wordpress\/?p=57","title":{"rendered":"How to install phpIPAM IP Address Management on Ubuntu 18.04 LTS"},"content":{"rendered":"\n<p>Before starting, you will need to update your system with the latest version. You can do this by running the following command:<\/p>\n\n\n\n<p><em>apt-get update -y<br>apt-get upgrade -y<\/em><\/p>\n\n\n\n<p>Once your server is updated, restart your server to apply the changes.<\/p>\n\n\n\n<p><strong>Install Apache, PHP and MariaDB<\/strong><\/p>\n\n\n\n<p>First, you will need to install Apache, MariaDB, PHP and other required packages to your system. You can install all of them with the following command:<\/p>\n\n\n\n<p><em>apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 php7.2-curl php7.2-mysql php7.2-curl php7.2-gd php7.2-intl php-pear php7.2-imap php-memcache php7.2-pspell php7.2-recode php7.2-tidy php7.2-xmlrpc php7.2-mbstring php-gettext php7.2-gmp php7.2-json php7.2-xml git wget -y<\/em><em><\/em><\/p>\n\n\n\n<p>Once all the required packages are installed, start Apache and MariaDB service and enable them to start on boot time with the following command:<\/p>\n\n\n\n<p><em>systemctl start apache2<br>&nbsp;systemctl start mariadb<br>&nbsp;systemctl enable apache2<br>&nbsp;systemctl enable mariadb<\/em><em><\/em><\/p>\n\n\n\n<p>Once you have finished, you can proceed to setup MariaDB database.<\/p>\n\n\n\n<p><strong>Configure MariaDB<\/strong><\/p>\n\n\n\n<p>By default, MariaDB is not secured. So you will need to secure it first. You can secure it by running the following script:<\/p>\n\n\n\n<p><em>mysql_secure_installation<\/em><em><\/em><\/p>\n\n\n\n<p>Answer all the questions as shown below:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Enter current password for root (enter for none):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Set root password? [Y\/n]: N<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Remove anonymous users? [Y\/n]: Y<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Disallow root login remotely? [Y\/n]: Y<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Remove test database and access to it? [Y\/n]:&nbsp; Y<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Reload privilege tables now? [Y\/n]:&nbsp; Y<\/p>\n\n\n\n<p>Once the MariaDB is secured, log in to MariaDB shell with the following command:<\/p>\n\n\n\n<p><em>mysql -u root -p<\/em><em><\/em><\/p>\n\n\n\n<p>Enter your root password when prompt, then create a database and user for PhpIPAM with the following command:<\/p>\n\n\n\n<p><em>MariaDB [(none)]&gt; create database phpipamdb;<br>&nbsp;MariaDB [(none)]&gt; grant all on phpipamdb.* to phpipam@localhost identified by \u2018password\u2019;<\/em><em><\/em><\/p>\n\n\n\n<p>Next, flush the privileges with the following command:<\/p>\n\n\n\n<p><em>MariaDB [(none)]&gt; FLUSH PRIVILEGES;<br>&nbsp;MariaDB [(none)]&gt; EXIT;<\/em><em><\/em><\/p>\n\n\n\n<p>Once your database configured properly, you can proceed to install PhpIPAM.<\/p>\n\n\n\n<p><strong>Install PhpIPAM<\/strong><\/p>\n\n\n\n<p>First, you will need to download the latest version of PhpIPAM from Git repository. You can download it with the following command:<\/p>\n\n\n\n<p><em>git clone \u2013recursive https:\/\/github.com\/phpipam\/phpipam.git \/var\/www\/html\/phpipam<\/em><em><\/em><\/p>\n\n\n\n<p>Next, change the directory to the phpipam and copy config.dist.php to config.php:<\/p>\n\n\n\n<p><em>cd \/var\/www\/html\/phpipam<br>&nbsp;cp config.dist.php config.php<\/em><em><\/em><\/p>\n\n\n\n<p>Next, open config.php file and define your database settings:<\/p>\n\n\n\n<p><em>nano config.php<\/em><em><\/em><\/p>\n\n\n\n<p>Make the following changes:<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>* database connection details<\/p>\n\n\n\n<p>******************************\/<\/p>\n\n\n\n<p>$db[\u2018host\u2019] = \u2018localhost\u2019;<\/p>\n\n\n\n<p>$db[\u2018user\u2019] = \u2018phpipam\u2019;<\/p>\n\n\n\n<p>$db[\u2018pass\u2019] = \u2018password\u2019;<\/p>\n\n\n\n<p>$db[\u2018name\u2019] = \u2018phpipamdb\u2019;<\/p>\n\n\n\n<p>$db[\u2018port\u2019] = 3306;<\/p>\n\n\n\n<p>Save and close the file. Then, import the SQL file with the following command:<\/p>\n\n\n\n<p><em>mysql -u root -p phpipamdb &lt; db\/SCHEMA.sql<\/em><em><\/em><\/p>\n\n\n\n<p>Next, give proper permissions to the phpipam directory with the following command:<\/p>\n\n\n\n<p><em>chown -R www-data:www-data \/var\/www\/html\/phpipam<br>&nbsp;chmod -R 755 \/var\/www\/html\/phpipam<\/em><em><\/em><\/p>\n\n\n\n<p>Once you are done, you can proceed to configure Apache for PhpIPAM.<\/p>\n\n\n\n<p><strong>Configure Apache for PhpIPAM<\/strong><\/p>\n\n\n\n<p>Next, you will need to create an Apache virtual host file for PhpIPAM. You can do this with the following command:<\/p>\n\n\n\n<p><em>nano \/etc\/apache2\/sites-available\/phpipam.conf<\/em><em><\/em><\/p>\n\n\n\n<p>Add the following lines:<\/p>\n\n\n\n<p>&lt;VirtualHost *:80&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ServerAdmin admin@example.com<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; DocumentRoot \u201c\/var\/www\/html\/phpipam\u201d<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ServerName example.com&nbsp;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; &lt;Directory \u201c\/var\/www\/html\/phpipam\u201d&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options Indexes FollowSymLinks<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride All<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require all granted<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; &lt;\/Directory&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ErrorLog \u201c\/var\/log\/phpipam-error_log\u201d<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; CustomLog \u201c\/var\/log\/phpipam-access_log\u201d combined<\/p>\n\n\n\n<p>&lt;\/VirtualHost&gt;<\/p>\n\n\n\n<p>Save and close the file, when you are finished. Then, enable Apache virtual host file with the following command:<\/p>\n\n\n\n<p><em>a2ensite phpipam<\/em><em><\/em><\/p>\n\n\n\n<p>Next, enable Apache rewrite module and restart Apache service to apply all the changes with the following command:<\/p>\n\n\n\n<p><em>a2enmod rewrite<br>&nbsp;systemctl restart apache2<\/em><em><\/em><\/p>\n\n\n\n<p>You can now check the status of Apache with the following command:<\/p>\n\n\n\n<p><em>systemctl status apache2<\/em><em><\/em><\/p>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<p>? apache2.service \u2013 The Apache HTTP Server<\/p>\n\n\n\n<p>&nbsp;&nbsp; Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)<\/p>\n\n\n\n<p>&nbsp; Drop-In: \/lib\/systemd\/system\/apache2.service.d<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??apache2-systemd.conf<\/p>\n\n\n\n<p>&nbsp;&nbsp; Active: active (running) since Sun 2019-03-17 06:29:39 UTC; 9min ago<\/p>\n\n\n\n<p>&nbsp; Process: 31397 ExecStop=\/usr\/sbin\/apachectl stop (code=exited, status=0\/SUCCESS)<\/p>\n\n\n\n<p>&nbsp; Process: 31402 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=0\/SUCCESS)<\/p>\n\n\n\n<p>&nbsp;Main PID: 31418 (apache2)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; Tasks: 11 (limit: 1113)<\/p>\n\n\n\n<p>&nbsp;&nbsp; CGroup: \/system.slice\/apache2.service<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31418 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31440 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31441 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;??31442 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31443 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31449 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31454 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31456 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31491 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31494 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ??31504 \/usr\/sbin\/apache2 -k start<\/p>\n\n\n\n<p>Mar 17 06:29:39 ubuntu1804 systemd[1]: Starting The Apache HTTP Server\u2026<\/p>\n\n\n\n<p>Mar 17 06:29:39 ubuntu1804 apachectl[31402]: AH00558: apache2: Could not reliably determine the server\u2019s fully qualified domain name, using 192<\/p>\n\n\n\n<p>Mar 17 06:29:39 ubuntu1804 systemd[1]: Started The Apache HTTP Server.<\/p>\n\n\n\n<p><strong>Access PhpIPAM Web Inetrface<\/strong><\/p>\n\n\n\n<p>Open your web browser and type the URL http:\/\/example.com. You will be redirected to the following page:<\/p>\n\n\n\n<p>Now, click on the New&nbsp;<strong>phpipam<\/strong>&nbsp;<strong>installation<\/strong>, you should see the following page:<\/p>\n\n\n\n<p>Now, click on the&nbsp;<strong>MySQL<\/strong>&nbsp;<strong>import<\/strong>&nbsp;<strong>instructions<\/strong>, you should see the following page:<\/p>\n\n\n\n<p>Now, click on the&nbsp;<strong>Login<\/strong>&nbsp;button, you should see the following page:<\/p>\n\n\n\n<p>Provide your admin username \/ password as Admin \/ ipamadmin and click on the&nbsp;<strong>Login<\/strong>&nbsp;button. You should see the following page:<\/p>\n\n\n\n<p>Now, change the default password as you wish and click on the&nbsp;<strong>Save<\/strong>&nbsp;<strong>password<\/strong>&nbsp;button. You should see the following page:<\/p>\n\n\n\n<p>Now, click on the&nbsp;<strong>Dashboard<\/strong>&nbsp;button. You will be redirected to the PhpIPAM dashboard in the following page:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before starting, you will need to update your system with the latest version. You can do this by running the following command: apt-get update -yapt-get upgrade -y Once your server is updated, restart your server to apply the changes. Install Apache, PHP and MariaDB First, you will need to install Apache, MariaDB, PHP and other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[6],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":1,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":58,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions\/58"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/119"}],"wp:attachment":[{"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nitirat.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}