0558.html 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Running PHP Server Monitor in Docker on Linux</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Container,Containerize,Docker,Docker Container,Docker How To,Docker Installation Tutorial,Docker Made Easy,Docker Simplified,Docker Made Simple,PHP,Ubuntu,Linux,Homelab,Getting Started With Docker,PHP Server Monitor,PHPServerMonitor,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Running PHP Server Monitor in Docker on Linux">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="10/27/2023 02:18:06 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>Running PHP Server Monitor in Docker on Linux</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is PHP Server Monitor</h2>
  26. <blockquote><em>PHP Server Monitor is a script that checks whether your websites and servers are up and running. It comes with a web based user interface where you can manage your services and websites, and you can manage users for each server with a mobile number and email address. -<a href="https://www.phpservermonitor.org/" target="_blank">https://www.phpservermonitor.org/</a></em></blockquote>
  27. <h2>Installing Docker</h2>
  28. <ol>
  29. <li>Log into the Linux based device</li>
  30. <li>Run the following commands in the terminal
  31. <div class="codeBlock"># install prerequisites<br />
  32. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  33. # add docker gpg key<br />
  34. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  35. # add docker software repository<br />
  36. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  37. # install docker<br />
  38. sudo apt install docker-ce docker-compose containerd.io -y<br />
  39. # enable and start docker service<br />
  40. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  41. # add the current user to the docker group<br />
  42. sudo usermod -aG docker $USER<br />
  43. # reauthenticate for the new group membership to take effect<br />
  44. su - $USER</div>
  45. </li>
  46. </ol>
  47. <h2>Running PHP Server Monitor</h2>
  48. <ol>
  49. <li>Now that Docker is installed, run the following commands to setup the PHP Server Monitor Docker container and run it
  50. <div class="codeBlock"># run the PHP Server Monitor docker container<br />
  51. # create working directories<br />
  52. mkdir /home/$USER/docker/mariadb -p<br />
  53. # set owner of working directories<br />
  54. sudo chown &quot;$USER&quot;:&quot;$USER&quot; /home/&quot;$USER&quot;/docker -R<br />
  55. # create phpServerMonitor network<br />
  56. docker network create phpServerMonitor<br />
  57. # run the php server monitor docker container<br />
  58. docker run -d --name phpservermonitor --network phpServerMonitor -p 8080:80 -e MYSQL_HOST=db -e MYSQL_USER=servermon_rw -e MYSQL_PASSWORD=Serv3rM0n! -e MYSQL_DATABASE=server_monitor -e MYSQL_DATABASE_PREFIX= -e TIME_ZONE=&#39;America/New_York&#39; -e PSM_REFRESH_RATE_SECONDS=60 -e PSM_AUTO_CONFIGURE=true -v /sessions --restart=unless-stopped phpservermonitor/phpservermon:latest<br />
  59. # run the mariadb docker container<br />
  60. docker run -d --name mariadb --network phpServerMonitor --network-alias db -e MYSQL_ROOT_PASSWORD=r00tp@ss -e MYSQL_USER=servermon_rw -e MYSQL_PASSWORD=Serv3rM0n! -e MYSQL_DATABASE=server_monitor -v /home/$USER/docker/mariadb:/var/lib/mysql --restart=unless-stopped mariadb:latest</div>
  61. </li>
  62. <li>Open a web browser and navigate to http://DNSorIP:8080/install.php</li>
  63. <li>The PHP Server Monitor setup screen should be displayed</li>
  64. <li>Click the Let&#39;s Go button</li>
  65. <li>Create an administrator account by entering a username, password and email address &gt; Click Install</li>
  66. <li>After the installation completes click Go to your monitor</li>
  67. <li>Login with the administator account created earlier</li>
  68. <li>Welcome to PHP Server Monitor</li>
  69. </ol>
  70. <p>Documentation: <a href="https://hub.docker.com/r/phpservermonitor/phpservermon" target="_blank">https://hub.docker.com/r/phpservermonitor/phpservermon</a></p> </div>
  71. </div>
  72. </body>
  73. </html>