Cachet is a free and open source status page system. It is written in PHP using Laravel framework and it is a self-hosted status page system. One of the greatest things about it is that it's easy to customize its theme to fit your branding. It helps you to better communicate downtime and system outages to their customers and teams. Some of its features are listed below:
It is recommended to upgrade the system and all available packages before installing any new packages. Execute the following command to upgrade the available packages.
yum -y update
Once you have your system updated, you will need to install LAMP. So let's install Apache web server, MariaDB and git using the following command.
yum -y install httpd mod_rewrite mariadb-server mariadb git
You already know that Cachet is written in PHP so you will need to install PHP. Here we will install PHP 7 but PHP 7 is not available in default YUM repository, so we will first install the EPEL repository using the following command.
yum -y install epel-release
Now install the Webtatic repository using the following command.
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Finally, install PHP 7 with required packages for Cachet.
yum -y install php71w php71w-openssl php71w-mysql php71w-cli php71w-mbstring php71w-dom php71w-gd php71w-simplexml php71w-mcrypt php71w-xml php71w-tokenizer
You can verify installation of PHP by checking the version PHP using the following command.
You should see something similar to this on your terminal.
[root@Sajid ~]# php -v PHP 7.1.19 (cli) (built: Jul 1 2018 07:20:27) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Next, start the Apache web server and enable it to automatically launch at boot time. You can do so using the following command.
systemctl start httpd && systemctl enable httpd
You will have to install Memcached, which is a distributed memory object caching system. You can use the following command to install Memcached.
yum -y install memcached
Next, start Memcached and enable it just like we have done for apache before.
systemctl enable memcached && systemctl start memcached
You'll need to edit a configuration file to update the timezone according to your area. You can edit the file using any text editor, here we are using nano text editor.
Add the following line at the end of the file, change the timezone according to your region.
Save the file and exit from the text editor.
To start MariaDB and enable it to start at boot time using the following command.
systemctl start mariadb && systemctl enable mariadb
We recommend you to harden the security of the Cachet data and to do so run following command.
You'll be asked to provide a root password so enter an appropriate password and answer yes to all questions by pressing Y.
Set root password? [Y/n] Y Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y
Now you'll have to create a database for Cachet so please follow the instructions.
mysql -u root -p
You'll be asked to enter the password so simply enter a password and now execute the following queries to create a new database.
CREATE DATABASE cachet_data;
The above query will create a database named cachet_data. For the database, you can use any name you prefer in the place of cachet_data. Make sure that you use semicolon at the end of each query as a query always ends with a semicolon. Once the database is created you can create a new user and grant the required permissions to the user for the database.
CREATE USER 'cachet_user'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username cachet_user. You can use any preferred username instead of cachet_user. Replace StrongPassword with a strong password.
Now provide the appropriate privileges to your database user over the database you have created. Run the following query to do so.
GRANT ALL PRIVILEGES ON cachet_data.* TO 'cachet_user'@'localhost';
Now run the following query to immediately apply the changes on the database privileges.
Now you can exit from MariaDB prompt using the following command.
The composer is a dependency for PHP and you'll have to install it first before installing Cachet. Simply run below commands and they'll do the job for you.
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer
You have installed the LAMP stack and all other required dependencies to install Cachet. Now switch to web root directory and download Cachet from git, using the following command.
git clone https://github.com/cachethq/Cachet.git cachet
Now go to the cachet directory.
Next, look for the release of software and you can do so using the following command.
git tag -l
You should see something similar to this output.
[root@Sajid cachet]# git tag -l v0.1.0-alpha v1.0.0 v1.1.0 ... v2.3.8 v2.3.9
Let's check out the latest version of the cachet using the following command.
git checkout v2.3.9
Copy the example environment configuration file.
cp .env.example .env
Next, you'll need to edit the environment configuration file using any text editor.
Find these below-given lines in the file.
DB_DATABASE=cachet DB_USERNAME=homestead DB_PASSWORD=secret DB_PORT=null
Change the values of these lines according to your database for Cachet like this:
DB_DATABASE=cachet_data DB_USERNAME=cachet_user DB_PASSWORD=StrongPassword DB_PORT=3306
Save the file and exit from the text editor.
Execute the following the command to install required composer dependencies.
composer install --no-dev -o
You'll need to generate and update a unique app key in environment configuration and you can do so using the following commands.
php artisan migrate
You will be asked for confirmation so type Yes and hit Enter button.
php artisan key:generate
You should see your output similar to this:
Generating optimized class loader Compiling common classes > php artisan config:cache Configuration cache cleared! Configuration cached successfully! > php artisan route:cache Route cache cleared! Routes cached successfully!
Next, Run the Cachet installer. Execute the following command and it will do the job for you.
php artisan app:install
You will need to create a virtual host for your application to access it through the web. To create a virtual host use the following command.
Add the following content to the file and exit from the editor.
<VirtualHost *:80> ServerAdmin admin DocumentRoot "/var/www/cachet/public" ServerName YourDomain ServerAlias www.YourDomain <Directory "/var/www/cachet/public"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> ErrorLog "/var/log/httpd/status.yourdomain.com-error_log" CustomLog "/var/log/httpd/status.yourdomain.com-access_log" combined </VirtualHost>
YourDomain with the actual domain name that you want to use for Cachet and change the value of ServerAdmin according to you.
Restart your Apache web server to apply the changes that we just configured.
systemctl restart httpd
Next, change the ownership permissions using the following command.
chown -R apache:apache /var/www/cachet/public
You'll need to modify firewall rules to allow HTTP traffic on port 80. Simply execute the following commands one by one and they will do the job for you.
firewall-cmd --zone=public --permanent --add-service=http
Next, temporarily disable SELinux services using the following command.
Finally, execute the following commands one by one to finish this installation.
chmod -R gu+w storage
chmod -R guo+w storage
Open up your favorite web browser and visit http://YourDomainName/ and you'll see the following web page on the screen.
Choose Memcached as cache driver and session driver. Choose mail driver and other details according to your requirement and then click on Next button.
You will see the next interface like this:
Provide your basic information about your website and select a time zone according to your region. Click on Next button when done.
You will see the next interface like this:
You'll be asked to enter administrative account details like username, email address and password for the admin so simply enter all the details and then finally click on Complete Setup button.
You will be informed that Cachet has been configured successfully. You can now click on the Go the dashboard button to log in with your admin credentials and visit Cachet's dashboard page.
You can add service components API, websites, incidents, matrices and much more from the Cachet dashboard. You can also schedule maintenance of your application from there.
You can set up mechanism to update new incidents or update metric data for this status page.
In this tutorial, you have learned to install Cachet Status Page System on an Alibaba Cloud Elastic Compute Service (ECS) CentOS 7 server. You can now use the software to manage downtime and incidents. We hope now you have enough knowledge to work with Cachet.
Alibaba Clouder - January 4, 2019
Alibaba Clouder - February 11, 2019
Alibaba Clouder - July 25, 2018
Alibaba Cloud Storage - October 31, 2018
Alibaba Clouder - November 20, 2018
Alibaba Clouder - April 8, 2018