What is PHP Server Monitor?
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. - https://www.phpservermonitor.org/
Installation
- Log into the Linux device
- Run the following commands in a terminal:
# update software repositories
sudo apt update
# install software updates
sudo apt upgrade -y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb-server mariadb-client -y
# install PHP components
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-curl php7.3-common php7.3-json php7.3-mysql php7.3-xml
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- 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
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the database and database user
CREATE DATABASE server_monitor;
GRANT ALL ON server_monitor.* to 'servermon_rw'@'localhost' IDENTIFIED BY '$erv3rM0n!';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands to download and extract PHP Server Monitor in the Apache webroot
# download latest PHP Server Monitor
wget -O phpservermon.tar.gz https://github.com/phpservermon/phpservermon/releases/download/v3.5.2/phpservermon-3.5.2.tar.gz
# extract the tar.gz
sudo tar xzvf phpservermon.tar.gz --directory /var/www/html
# rename the extracted folder
sudo mv /var/www/html/phpservermon-3.5.2 /var/www/html/monitor
# create config.php placeholder
sudo touch /var/www/html/monitor/config.php
# set the owner of the new monitor directory to www-data
sudo chown -R www-data:www-data /var/www/html/monitor
# set the PHP timezone, change the timezone as needed before running
sudo sed -i "s/^;date.timezone =/\date.timezone = America\/New_York/" /etc/php/7.3/apache2/php.ini
# restart apache2 service for the changes to take effect
sudo systemctl restart apache2 - Open a web browser and navigate to http://DNSorIP/monitor/install.php
- The PHP Server Monitor setup screen should be displayed
- Click the Let's Go button
- Fill out the database connetion information as follows
Database host: localhost
Database port: 3306
Database name: server_monitor
Database user: servermon_rw
Database password: $erv3rM0n!
Table prefix: - Click Save configuration
- Refresh the page
- Create an administrator account by entering a username, password and email address > Click Install
- After the installation completes click Go to your monitor
- Login with the administator account created earlier
- Welcome to PHP Server Monitor