Install PHP Server Monitor on Ubuntu 15.04 / CentOS 7 / Fedora 22

ADVERTISEMENT

Install PHP Server Monitor
Install PHP Server Monitor

PHP Server Monitor is a opensource web-based monitoring tool that checks whether your websites and servers are up and running, over the web interface you can manage your services and websites, and also you can you can manage users for each server with a mobile number and email address. This guide helps you to install PHP Server Monitor on Ubuntu 15.04 / CentOS 7 / Fedora 22, also this tutorial should work for Ubuntu 14.04 / 14.10.

Contents:

ADVERTISEMENT
Article will continue after the ad

1. Features
2. Requirements
3. Install PHP Server Monitor
4. Create Database
5. Download PHP Server Monitor
6. Configure PHP Server Monitor

Features:

  • Monitor services and websites.
  • Alerting over Email and SMS.
  • Uptime and latency history graphs.
  • User authentication with 2 levels (administrator and regular user).
  • Logs of connection errors, outgoing emails and text messages.
  • Configuring cron to automatically check your servers.

Requirements:

To install, your system must meet below requirements.

  • PHP 5.3.7+
  • PHP packages: cURL, MySQL
  • MySQL Database

Install PHP Server Monitor:

Before going ahead, lets install the required packages.

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo apt-get update

$ sudo apt-get install apache2 mysql-server php5 php5-curl php5-mysql php5-cli wget

### CentOS 7 / RHEL 7 / Fedora 22 ###

# yum install httpd mariadb-server php php-curl php-cli php-mysql php-pdo wget

# systemctl start  mariadb.service

# systemctl start  httpd.service

Create Database:

If you are setting up a MariaDB for the first time, here is the tutorial on Securing MariaDB. MariaDB server must be started before creating the database, login to MySQL server.

mysql -u root -p

Create a database for the PHP Server Monitor installation.

create database phpmonitordb;

Allow “phpmonitoruser” to access the “phpmonitordb” database on localhost with predefined password.

grant all on phpmonitordb.* to 'phpmonitoruser'@'localhost' identified by 'phpmonitorpassword';

Exit MySQL.

flush privileges;
exit

Download PHP Server Monitor:

Go to apache root directory and download the latest PHP server monitor package.

$ cd /var/www/html

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo wget http://nchc.dl.sourceforge.net/project/phpservermon/phpservermon/PHP%20Server%20Monitor%20v3.1.1/phpservermon-3.1.1.tar.gz

### CentOS 7 / RHEL 7 / Fedora 22 ###

# wget http://nchc.dl.sourceforge.net/project/phpservermon/phpservermon/PHP%20Server%20Monitor%20v3.1.1/phpservermon-3.1.1.tar.gz

Extract and rename it.

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo tar -zxvf phpservermon-3.1.1.tar.gz

$ sudo  mv phpservermon-3.1.1 phpservermon

### CentOS 7 / RHEL 7 / Fedora 22 ###

# tar -zxvf phpservermon-3.1.1.tar.gz

# mv phpservermon-3.1.1 phpservermon

Change ownership of the directory.

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo chown -R www-data:www-data /var/www/html/phpservermon

### CentOS 7 / RHEL 7 / Fedora 22 ###

# chown -R apache:apache /var/www/html/phpservermon

Configure PHP Server Monitor:

Open up your web browser and point to the URL http://ip-addr-ess/phpservermon

Ubuntu - Install PHP Server Monitor - Setup Page
Ubuntu – Install PHP Server Monitor – Setup Page

If you get any warning for timezone, set date.timezone in php.ini file. Change America/New_York with your time zone, find your timezone here.

date.timezone = America/New_York

Click on let’s go. Fill up your database and database user information.

Ubuntu - Install PHP Server Monitor - DB Setup
Ubuntu – Install PHP Server Monitor – DB Setup

Click on Save Configuration. If you come across below error,

Ubuntu - Install PHP Server Monitor - DB Setup Error
Ubuntu – Install PHP Server Monitor – DB Setup Error

Create a file name “config.php” in “phpservermon” directory.

$ cd /var/www/html/phpservermon

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo vi config.php

### CentOS 7 / RHEL 7 / Fedora 22 ###

# vi config.php

Paste the below content in to the file.

<?php
define('PSM_DB_HOST', 'localhost');
define('PSM_DB_NAME', 'phpmonitordb');
define('PSM_DB_USER', 'phpmonitoruser');
define('PSM_DB_PASS', 'phpmonitorpassword');
define('PSM_DB_PREFIX', 'psm_');

Change ownership of the created file or full directory.

### Ubuntu 15.04 / Ubuntu 14.04 ###

$ sudo chown -R www-data:www-data /var/www/html/phpservermon

### CentOS 7 / RHEL 7 / Fedora 22 ###

# chown -R apache:apache /var/www/html/phpservermon

And you will get the next page to install PHP Server Monitor, Fill up Username and Password for the installation.

Ubuntu - Install PHP Server Monitor - Account Creation
Ubuntu – Install PHP Server Monitor – Account Creation

And click Install.

Please check for any errors in installation page. if no errors have occurred, you are good to go.

Ubuntu - Install PHP Server Monitor -Home page
Ubuntu – Install PHP Server Monitor -Home page

Click on go to your monitor, you will be taken to login screen. Login with user name and password that we create earlier.

Ubuntu - Install PHP Server Monitor - Server Monitor
Ubuntu – Install PHP Server Monitor – Server Monitor

Add the server (website) to your monitoring, by going to Servers –> Add new.

Fill up your server information on this page, for demo, i have put my website in the domain field.

Ubuntu - Install PHP Server Monitor - New Server Monitoring
Ubuntu – Install PHP Server Monitor – New Server Monitoring

Click Save.

Click Update to get the latest service update.

Ubuntu - Install PHP Server Monitor - Servers List
Ubuntu – Install PHP Server Monitor – Servers List

Now, Go to status. You would get last online and latency information of your new server.

Ubuntu - Install PHP Server Monitor - ITzGeek Status
Ubuntu – Install PHP Server Monitor – ITzGeek Status

If  you want to monitor a lot of website for your customers, you can create an account for them , So they can login and check their own website status.

That’s All!!!, Happy weekend, and cheers.

ADVERTISEMENT

POSTS YOU MAY LIKE -:)

Share This Post

Shares