0759.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install phpIPAM on Linux [Open-source IP Address Management System]</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Linux,Network Planning,IP Address Managment,IPAM,IP Address Manager,PHPIPAM,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Browser Based,Web Based Tools,Free Open Source Software,Free Software,Open Source Software,Open-Source,FOSS,Debian,IP Address Planning,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install phpIPAM on Linux [Open-source IP Address Management System]">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="07/08/2022 08:31:48 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install phpIPAM on Linux [Open-source IP Address Management System]</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is phpIPAM?</h2>
  26. <blockquote><em>phpIPAM is an open-source web IP address management application (IPAM). It&#39;s goal is to provide light, modern and useful IP address management. It is a php-based application with a MySQL database backend, using jQuery libraries, ajax and HTML5/CSS3 features. -<a href="https://phpipam.net/" target="_blank">https://phpipam.net/</a></em></blockquote>
  27. <h2>Installation</h2>
  28. <ol>
  29. <li>Log into the Linux device</li>
  30. <li>Run the following commands in a terminal window:
  31. <div class="codeBlock"># update software repositories<br />
  32. sudo apt update<br />
  33. # install available software updates<br />
  34. sudo apt upgrade -y<br />
  35. # install prerequisites<br />
  36. sudo apt install curl wget zip git -y<br />
  37. # install Apache HTTPD and MySQL<br />
  38. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  39. # install PHP components<br />
  40. sudo apt install php7.4 php7.4-curl php7.4-common php7.4-gmp php7.4-mbstring php7.4-gd php7.4-xml php7.4-mysql php7.4-ldap php-pear -y<br />
  41. # configure the MySQL database<br />
  42. sudo su<br />
  43. mysql_secure_installation</div>
  44. </li>
  45. <li>Press Enter to login as root</li>
  46. <li>Type N and press Enter to not switch to unix socket authentication</li>
  47. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  48. <li>Type Y and press Enter to remove anonymous users</li>
  49. <li>Type Y and press Enter to disallow root login remotely</li>
  50. <li>Type Y and press Enter to remove the test database</li>
  51. <li>Type Y and press Enter to reload privilege tables</li>
  52. <li>Run the following command to login into MySQL:
  53. <div class="codeBlock">mysql -u root -p</div>
  54. </li>
  55. <li>Authenticate with the root password set earlier</li>
  56. <li>Run the following commands to create the phpIPAM database and database user
  57. <div class="codeBlock">CREATE DATABASE php_ipam;<br />
  58. GRANT ALL ON php_ipam.* to &#39;php_ipam_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;P4P1p@m!!&#39;;<br />
  59. FLUSH PRIVILEGES;<br />
  60. EXIT;<br />
  61. exit</div>
  62. </li>
  63. <li>Continue with the following commands:
  64. <div class="codeBlock"># git clone phpipam to the webroot<br />
  65. sudo git clone https://github.com/phpipam/phpipam.git /var/www/html/phpipam<br />
  66. # cd into the new directory<br />
  67. cd /var/www/html/phpipam<br />
  68. # checkout the latest release<br />
  69. sudo git checkout &quot;$(git tag --sort=v:tag | tail -n1)&quot;<br />
  70. # set the owner of the phpipam directory<br />
  71. sudo chown -R www-data:www-data /var/www/html/phpipam<br />
  72. # copy sample config file<br />
  73. sudo cp /var/www/html/phpipam/config.dist.php /var/www/html/phpipam/config.php<br />
  74. # edit config.php<br />
  75. sudo nano /var/www/html/phpipam/config.php</div>
  76. </li>
  77. <li>Update the database connection details
  78. <p>$db[&#39;host&#39;] = &#39;127.0.0.1&#39;;<br />
  79. $db[&#39;user&#39;] = &#39;php_ipam_rw&#39;;<br />
  80. $db[&#39;pass&#39;] = &#39;P4P1p@m!!&#39;;<br />
  81. $db[&#39;name&#39;] = &#39;php_ipam&#39;;<br />
  82. $db[&#39;port&#39;] = 3306;</p>
  83. </li>
  84. <li>Below the database connection, add the following line to define the BASE variable
  85. <p>define(&#39;BASE&#39;, &quot;/phpipam/&quot;);</p>
  86. </li>
  87. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  88. <li>Continue with the following commands:
  89. <div class="codeBlock"># enable mod_rewrite<br />
  90. sudo a2enmod rewrite<br />
  91. # restart apache2 service<br />
  92. sudo systemctl restart apache2</div>
  93. </li>
  94. </ol>
  95. <h2>phpIPAM Web Installer</h2>
  96. <ol>
  97. <li>Open a web browser and navigate to http://DNSorIP/phpipam</li>
  98. <li>The phpipam Installation web installer should be load</li>
  99. <li>Click the New phpipam installation button</li>
  100. <li>Click the Automatic database installation button</li>
  101. <li>Complete the database form as follows
  102. <p>MySQL/MariaDB username: php_ipam_rw<br />
  103. MySQL/MariaDB password: P4P1p@m!!<br />
  104. MySQL/MariaDB database location: 127.0.0.1<br />
  105. MySQL/MariaDB database name: php_ipam</p>
  106. </li>
  107. <li>Click the Show advanced options button</li>
  108. <li>Uncheck Create new database and Set permissions to tables &gt; Click the Install phpipam database button</li>
  109. <li>Once the database is initialized, click the Continue button</li>
  110. <li>Enter and confirm an admin user password &gt; Click Save settings</li>
  111. <li>Click the Proceed to login button</li>
  112. <li>Login with the username admin and the admin password set earlier</li>
  113. <li>Welcome to phpIPAM</li>
  114. </ol>
  115. </div>
  116. </div>
  117. </body>
  118. </html>