On Debian 13:
sudo apt update
sudo apt install -y apache2 mariadb-server php php-cli php-mysql php-gd php-curl php-mbstring php-xml php-zip php-bcmath unzip wget
On RHEL 10:
sudo dnf install -y httpd mariadb-server php php-cli php-mysqlnd php-gd php-curl php-mbstring php-xml php-zip php-bcmath unzip wget
On Debian 13:
sudo systemctl enable --now mariadb
On RHEL 10:
sudo systemctl enable --now mariadb
Secure and create the database:
sudo mysql_secure_installation
sudo mysql -e "CREATE DATABASE phpservermon DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -e "CREATE USER 'phpservermon'@'localhost' IDENTIFIED BY 'StrongPassword123!';"
sudo mysql -e "GRANT ALL PRIVILEGES ON phpservermon.* TO 'phpservermon'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
cd /tmp
wget https://github.com/phpservermon/phpservermon/releases/download/v3.7.0/phpservermon-3.7.0.zip
sudo apt install -y unzip # Debian if not installed
unzip phpservermon-3.7.0.zip
sudo mv phpservermon /var/www/html/phpservermon
On Debian 13:
sudo chown -R www-data:www-data /var/www/html/phpservermon
sudo chmod -R 755 /var/www/html/phpservermon
On RHEL 10:
sudo chown -R apache:apache /var/www/html/phpservermon
sudo chmod -R 755 /var/www/html/phpservermon
Copy configuration file:
cd /var/www/html/phpservermon
sudo cp config/sample.inc.php config/config.inc.php
sudo nano config/config.inc.php
Key settings to configure:
<?php
define('PSM_DB_HOST', 'localhost');
define('PSM_DB_NAME', 'phpservermon');
define('PSM_DB_USER', 'phpservermon');
define('PSM_DB_PASS', 'StrongPassword123!');
define('PSM_DB_PREFIX', 'psm_');
define('PSM_BASE_URL', 'http://phpservermon.example.com');
define('PSM_EMAIL_FROM', 'noreply@example.com');
define('PSM_EMAIL_SMTP_HOST', 'smtp.example.com');
define('PSM_EMAIL_SMTP_PORT', '587');
define('PSM_EMAIL_SMTP_USER', 'smtp-user');
define('PSM_EMAIL_SMTP_PASS', 'smtp-password');
?>
Open browser and navigate to http://SERVER_IP/phpservermon
The installation wizard will:
Or run CLI installation:
cd /var/www/html/phpservermon
sudo php install/upgrade.php
On Debian 13:
sudo tee /etc/apache2/sites-available/phpservermon.conf >/dev/null <<'EOF'
<VirtualHost *:80>
ServerName phpservermon.example.com
DocumentRoot /var/www/html/phpservermon
<Directory /var/www/html/phpservermon>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
sudo a2ensite phpservermon
sudo a2enmod rewrite
sudo systemctl restart apache2
On RHEL 10:
sudo systemctl restart httpd
PHP Server Monitor requires cron for periodic checks:
sudo crontab -e
Add the following line:
*/1 * * * * /usr/bin/php /var/www/html/phpservermon/cron/cron.php >> /var/log/phpservermon.log 2>&1
On UFW:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
On firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Open http://SERVER_IP/phpservermon or http://phpservermon.example.com and log in with the admin credentials created during installation.
Enable API access in Settings > API:
define('PSM_API_ENABLED', true);
define('PSM_API_KEY', 'your-api-key-here');
Use API to:
See PHP Server Monitor Hardening.
Need professional assistance with your monitoring infrastructure? Our team provides:
Get in touch: office@linux-server-admin.com | Contact Page
Prefer automation? See PHP Server Monitor Ansible Setup for an example playbook.
Prefer containers? See PHP Server Monitor Docker Setup.
See PHP Server Monitor Configuration for configuration guidance.
See PHP Server Monitor Security for hardening guidance.