Cachet<\/strong><\/a>\u00a0is an open source status page system written in PHP. Cachet source code is hosted on this\u00a0Github repo<\/strong><\/a>. In this article we will go over the Cachet installation process on CentOS 7 using a PHP, MariaDB and Nginx software stack.<\/p>\n\n\n\n Check the CentOS version.<\/p>\n\n\n\n Create a new non-root<\/em> user account with NOTE<\/strong>: Replace Set up the timezone.<\/p>\n\n\n\n Ensure that your system is up to date.<\/p>\n\n\n\n Install necessary packages.<\/p>\n\n\n\n For simplicity, disable SELinux and Firewall.<\/p>\n\n\n\n Setup the Webtatic YUM repo.<\/p>\n\n\n\n Install PHP and required PHP extensions.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Start and enable PHP-FPM.<\/p>\n\n\n\n Setup the MariDB repo. Run Install MariaDB database server.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Start and enable MariaDB.<\/p>\n\n\n\n Run Connect to the MariaDB shell as the Create an empty MariaDB database and user for Cachet, and remember the credentials.<\/p>\n\n\n\n Install Nginx.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Start and enable Nginx.<\/p>\n\n\n\n Configure Nginx. Run Test the configuration.<\/p>\n\n\n\n Reload Nginx.<\/p>\n\n\n\n Install Composer globally.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Create a document root directory.<\/p>\n\n\n\nRequirements<\/h2>\n\n\n\n
\n
Before you begin<\/h2>\n\n\n\n
cat \/etc\/centos-release\n# CentOS Linux release 7.5.1804 (Core)<\/code><\/pre>\n\n\n\n
sudo<\/code> access and switch to it.<\/p>\n\n\n\n
useradd -c \"John Doe\" johndoe && passwd johndoe\nusermod -aG wheel johndoe\nsu - johndoe<\/code><\/pre>\n\n\n\n
johndoe<\/code> with your username<\/em>.<\/p>\n\n\n\n
timedatectl list-timezones\nsudo timedatectl set-timezone 'Region\/City'<\/code><\/pre>\n\n\n\n
sudo yum update -y<\/code><\/pre>\n\n\n\n
sudo yum install -y wget curl vim git<\/code><\/pre>\n\n\n\n
sudo setenforce 0\nsudo systemctl stop firewalld\nsudo systemctl disable firewalld<\/code><\/pre>\n\n\n\n
Install PHP and required PHP extensions<\/h2>\n\n\n\n
sudo rpm -Uvh https:\/\/mirror.webtatic.com\/yum\/el7\/webtatic-release.rpm<\/code><\/pre>\n\n\n\n
sudo yum install -y php70w php70w-cli php70w-fpm php70w-common php70w-xml php70w-gd php70w-zip php70w-mbstring php70w-mysql php70w-pgsql php70w-sqlite3 php70w-mcrypt php70w-apc<\/code><\/pre>\n\n\n\n
php --version\n# PHP 7.0.30 (cli) (built: Apr 28 2018 08:14:08) ( NTS )<\/code><\/pre>\n\n\n\n
sudo systemctl start php-fpm.service\nsudo systemctl enable php-fpm.service<\/code><\/pre>\n\n\n\n
Install MariaDB and create a database<\/h2>\n\n\n\n
sudo vi \/etc\/yum.repos.d\/MariaDB.repo<\/code> and populate it with the following.<\/p>\n\n\n\n
[mariadb]\nname = MariaDB\nbaseurl = https:\/\/yum.mariadb.org\/10.2\/centos7-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1<\/code><\/pre>\n\n\n\n
sudo yum install -y MariaDB-server MariaDB-client<\/code><\/pre>\n\n\n\n
mysql --version\n# mysql Ver 15.1 Distrib 10.2.16-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n\n\n\n
sudo systemctl start mariadb.service\nsudo systemctl enable mariadb.service<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code> to improve security and set the password for the MariaDB
root<\/code> user.<\/p>\n\n\n\n
sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n
root<\/code> user.<\/p>\n\n\n\n
mysql -u root -p\n# Enter password:<\/code><\/pre>\n\n\n\n
CREATE DATABASE dbname;\nGRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';\nFLUSH PRIVILEGES;\nEXIT<\/code><\/pre>\n\n\n\n
Install and configure Nginx<\/h2>\n\n\n\n
sudo yum install -y nginx<\/code><\/pre>\n\n\n\n
nginx -v\n# nginx version: nginx\/1.12.2<\/code><\/pre>\n\n\n\n
sudo systemctl start nginx.service\nsudo systemctl enable nginx.service<\/code><\/pre>\n\n\n\n
sudo vim \/etc\/nginx\/conf.d\/cachet.conf<\/code> and populate the file with the following configuration.<\/p>\n\n\n\n
server {\n listen 80;\n listen [::]:80;\n\n server_name status.example.com; # Check this\n root \/var\/www\/cachet\/public; # Check this\n\n index index.php;\n\n location \/ {\n try_files $uri \/index.php$is_args$args;\n }\n\n location ~ \\.php$ {\n include fastcgi_params;\n fastcgi_pass 127.0.0.1:9000; # Check this\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_index index.php;\n fastcgi_keep_conn on;\n }\n}<\/code><\/pre>\n\n\n\n
sudo nginx -t<\/code><\/pre>\n\n\n\n
sudo systemctl reload nginx.service<\/code><\/pre>\n\n\n\n
Install Composer<\/h2>\n\n\n\n
php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\"\nphp -r \"if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;\"\nphp composer-setup.php\nphp -r \"unlink('composer-setup.php');\"\nsudo mv composer.phar \/usr\/local\/bin\/composer<\/code><\/pre>\n\n\n\n
composer --version\n# Composer version 1.6.5 2018-05-04 11:44:59<\/code><\/pre>\n\n\n\n
Install Cachet<\/h2>\n\n\n\n
sudo mkdir -p \/var\/www\/cachet<\/code><\/pre>\n\n\n\n