I have a handful of servers and for years I’ve been wanting to get some sort of monitoring in place. Today I tried out php server monitor and found it was pretty easy to set up and use.
The installation process was pretty straightforward.
- Install PHP, mysql, and apache
- Create database, user, password, and access rights for mysql
- Download .tar.gz and extract to /var/www
- Configure Apache site file to point to phpservermonitor directory
- Navigate to the IP / URL of your apache server and run the installation script
The above process is documented fairly well on their website. I configured this to run on my Raspberry Pi 2. This was my process:
Install dependencies:
sudo apt-get install php5 php5-curl php5-mysql mysql-server
Configure mysql:
sudo mysql_secure_installation
Create database:
mysql -u root -p create database phpservermon; create user 'phpservermon'@'localhost' IDENTIFIED BY 'password'; grant all privileges on phpservermon.* TO 'phpservermon'@'localhost'; flush privileges;
Extract phpservermon to /var/www and grant permissions
tar zxvf <phpservermon_gzip_filename> -C /var/www sudo chown -R www-data /var/www/*
Configure php:
sudo vim /etc/php5/apache2/php.ini #uncomment date.timezone and set your timezone date.timezone = "America/Boise"
Configure apache:
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/phpservermon #Modify /etc/apache2/sites-available/phpservermon server root to point to directory above, also add a ServerName if desired sudo a2ensite phpservermon sudo service apache2 reload
Configure cron (I have it check every minute but you can configure whatever you like)
*/1 * * * * /usr/bin/php /var/www/phpservermon/cron/status.cron.php
Navigate to the web address you’ve configured in apache and follow the wizard.
It’s pretty simple but it works! A nice php application to monitor websites and services.