• Get In Touch
April 24, 2017

How to Install SilverStripe on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

SilverStripe is a free and open source content management system. It is written in PHP and uses MySQL to store its data. SilverStripe is very flexible, extensible and easy to use application. It is easy to learn and optimized to produce high-quality reusable codes. It is responsive and available in many languages. It is a very secure platform as it is written from ground. It is a popular CMS and used by prominent companies like Lenovo and Forbes etc.

In this tutorial, we will be installing SilverStripe on CentOS 7 server.

Requirements

SilverStripe does not require any special hardware requirements. It can be installed on servers with a small amount of RAM. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.

Installing SilverStripe

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Now install Apache, Git, and MariaDB, which is a fork or MySQL using the following command.

yum -y install httpd mariadb-server mariadb git

SilverStripe requires PHP 5.3.3 or higher. In this tutorial, we will install PHP 5.6. Install EPEL repository using following commands.

yum -y install epel-release
yum -y update

Now install Webtatic repository using the following commands.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update

To install PHP 5.6 and all the required PHP modules, run the following command.

yum -y install php56w php56w-openssl php56w-dom php56w-mysqli php56w-cli php56w-mbstring php56w-gd php56w-fileinfo php56w-hash php56w-iconv php56w-simplexml php56w-session php56w-tokenizer php56w-xml php56w-tidy

Once you have PHP installed, you can check the version of PHP using the following command.

php -v

You should get output similar to this.

[root@liptan-pc ~]# php -v
PHP 5.6.30 (cli) (built: Jan 19 2017 22:31:39)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

You will need to edit the php.ini file to configure the timezone. Run the following command to open the file in nano editor.

nano /etc/php.ini

Now find the following line.

;date.timezone =

Uncomment the line and provide the timezone for your application. An example may be.

date.timezone = Asia/Kolkata

Now start Apache web server and enable it to start at boot time using the following command.

systemctl start httpd
systemctl enable httpd

To start MariaDB and enable it to start at boot time using the following commands.

systemctl start mariadb
systemctl enable mariadb

Now run the following commands to secure your MySQL or MariaDB installation.

mysql_secure_installation

It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. Set a root password for MySQL root user and answer y for all other questions asked.

Now you will need to create a database to store SilverStripe data.

To create a database we will need to login to MySQL command line first. Run the following command for same.

mysql -u root -p

This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your SilverStripe installation.

CREATE DATABASE ss_data;

To create a new database user, run the following query.

CREATE USER 'ss_user'@'localhost' IDENTIFIED BY 'StrongPassword';

Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command.

GRANT ALL PRIVILEGES ON ss_data.* TO 'ss_user'@'localhost';

Now run the following command to immediately apply the changes on the database privileges.

FLUSH PRIVILEGES;

Exit from MySQL prompt using exit command.

SilverStripe can be installed in two ways, either using composer or using the setup archive. In this tutorial both the methods are explained.

Using Composer

If you want to use Composer to install SilverStripe, you will need to install Composer. Composer is a dependency manager for PHP.

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer

Now switch to the webroot directory of Apache web server and download SilverStripe using following command.

cd /var/www
composer create-project silverstripe/installer silverstripe

Once the download finishes, go to the newly created SilverStripe directory and install the required Composer dependencies using the following commands.

cd silverstripe
composer install

SilverStripe files are now downloaded, you can now continue the tutorial from disabling SELinux.

Using Setup Archive

To install SilverStripe using the setup archive, run the following command to download the archive.

cd /var/www
wget https://silverstripe-ssorg-releases.s3.amazonaws.com/sssites-ssorg-prod/assets/releases/SilverStripe-cms-v3.5.3.zip -O silverstripe.zip

You can always check the SilverStripe download page to look for the link to the latest version of the archive.

Now extract the archive using the following command.

unzip silverstripe.zip -d silverstripe

If you do not have unzip installed, you can run yum -y install unzip.

Now you will need to disable your SELinux. To temporary disable SELinux, run the following command.

setenforce 0

To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

Find the following line:

SELINUX=enforcing

Change it to:

SELINUX=disabled

Now, you will need to provide the ownership of the application to web server user using the following command.

chown -R apache:apache /var/www/silverstripe

You may also need to allow HTTP traffic on port 80 through the firewall if you are running one. Run the following commands for same.

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --reload

Now create a virtual host for the SilverStripe application. Run the following command for same.

nano /etc/httpd/conf.d/cms.yourdomain.com.conf

Paste the following lines into the file.

<VirtualHost *:80>
    ServerAdmin me@liptanbiswas.com
    DocumentRoot "/var/www/silverstripe"
    ServerName cms.yourdomain.com
    ServerAlias www.cms.yourdomain.com
    <Directory "/var/www/silverstripe">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "/var/log/httpd/cms.yourdomain.com-error_log"
    CustomLog "/var/log/httpd/cms.yourdomain.com-access_log" combined
</VirtualHost>

Replace cms.yourdomain.com with any domain or subdomain you want to use to access the application. Save the file and exit from the editor. Run the following command to restart your Apache server.

systemctl restart httpd

Now complete the installation using a web browser, go to the following link using your favorite web browser.

http://cms.yourdomain.com

You will be welcomed by the following page.

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/1258417280.png” alt=”” />

If you have followed the tutorial correctly, you would have all the requirements for PHP configuration, file permission, and Web server configuration satisfied. Now scroll down to database configuration and fill out the details of the database we created earlier.

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/1215514856.png” alt=”” />

Once done, click on Re-check requirements button, you should get the success message here also. Now scroll down to CMS Admin account section, provide the admin email and password in this section.

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/140425600.png” alt=”” />

Now choose the theme you want to install and choose if you wish to send anonymous data about your web server to SilverStripe server.

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/818767904.png” alt=”” />

Click Install SilverStripe button and the installer will install the application to your server.

Once the installation finishes, you will be redirected to your site. You will need to delete the installation file now, Click on the Click here to delete all install files link on the homepage. You will need to login using the administrator credentials. Once done, you are ready to configure your website.

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/1711685320.png” alt=”” />

You can go to the following link to access administration dashboard.

http://cms.yourdomain.com/admin

HP_NO_IMG/data/uploads/users/12c8e597-946c-4ad9-a603-d40a6c894a40/1650140393.png” alt=”” />

Conclusion

In this tutorial, we have learned how to install SilverStripe content management system on CentOS 7. You can now install the CMS on your own server to easily create a website for your organization.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]