How to Install PHP Server Monitor on Linux Mint
PHP Server Monitor is an open-source tool for monitoring your Linux server. It allows you to monitor your server's CPU, memory, disk usage, network traffic, and more. In this tutorial, we'll show you how to install PHP Server Monitor on Linux Mint.
Requirements
Before we proceed with the installation of PHP Server Monitor, you'll need to have the following:
- A running Linux Mint system
- Apache web server
- PHP version 7 or later
- MySQL or MariaDB database
Step 1: Install Required Packages
Open the terminal and run the following command to install the required packages:
sudo apt update
sudo apt install -y apache2 mysql-server php libapache2-mod-php php-mysql php-curl php-xml php-mbstring php-gd
Step 2: Install PHP Server Monitor
To install PHP Server Monitor on your Linux Mint system, follow the steps below:
- Download the latest version of PHP Server Monitor from their website https://www.phpservermonitor.org/.
- Extract the downloaded archive file to the
var/www/htmldirectory by running the following command:
sudo unzip ~/Downloads/psm-2.5.1.zip -d /var/www/html/
- Change the ownership of the extracted directory to the Apache user (www-data) by running the following command:
sudo chown -R www-data:www-data /var/www/html/phpservermon/
Step 3: Configure PHP Server Monitor
- Create a new MySQL database for PHP Server Monitor by running the following commands:
sudo mysql -u root -p
- Enter your MySQL root password when prompted, then run the following commands to create the database and the user:
CREATE DATABASE psm;
CREATE USER 'psmuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON psm.* TO 'psmuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
- Rename the
config.dist.phpfile toconfig.phpby running the following command:
cd /var/www/html/phpservermon/includes/
sudo cp config.dist.php config.php
- Open the
config.phpfile with your favorite text editor, then enter your database details under theDatabase Settingssection:
define('PSM_DB_HOST', 'localhost');
define('PSM_DB_USER', 'psmuser');
define('PSM_DB_PASS', 'yourpassword');
define('PSM_DB_NAME', 'psm');
Save and close the file.
Modify the
index.phpfile to set the correct date timezone for your system by adding the following line after the opening<?phptag:
date_default_timezone_set('Asia/Kolkata');
Note: Replace Asia/Kolkata with your own time zone.
Step 4: Access PHP Server Monitor
Open your web browser and navigate to http://localhost/phpservermon/ to access PHP Server Monitor. You should see the login page.
Enter the default username and password:
- Username: admin
- Password: admin
After logging in, you should set up the necessary monitoring options for your server.
Congratulations! You have successfully installed PHP Server Monitor on Linux Mint. You can now monitor your server's health and performance from a web interface.