Tutorial

How To Install Silverstripe on Your VPS

Published on September 14, 2013
How To Install Silverstripe on Your VPS

About Silverstripe

Silverstripe is an open source web content management system (CMS) that is both easy to develop and use by content editors and site administrators. It has a modern architecture which uses a PHP 5 based programming framework that makes it very flexible to customize.

In this tutorial, we will see how to install Silverstripe on our VPS running Ubuntu. If you want to follow along, you will need your own VPS set up with Ubuntu and the LAMP stack (Linux, Apache, MySQL and PHP), the preferred web server solution for Silverstripe.

Requirements

Silverstripe requires PHP 5.3.2+, a web server such as Apache, Lighttpd or IIS and MySQL 5.0+, PostgreSQL 8.3+ or SQL Server 2008+ for the database.

Before we get on with the installation, there are a couple of things we need to take care of. First, we have to make sure mod_rewrite is enabled in our Apache and that the virtual host allows .htaccess files to override Apache instructions. To check if the former is available, use the following command:

apache2ctl -M

If you see "rewrite_module" in the list, you are fine. If not, use the following command to enable the module:

a2enmod rewrite

Next, edit the Apache default virtual host file and make sure that Allow Overrides is set to All under the /var/www directory. Edit the file with the following command:

nano /etc/apache2/sites-available/default

And where you see this block, make the changes to correspond to the following.

<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
</Directory>

We’ll also have to set timezone for PHP. Edit the php.ini file:

nano /etc/php5/apache2/php.ini

And in this file where you see the following line:

;date.timezone =

Remove the preceding semi-colon and set a PHP type timezone in the following format:

date.timezone = America/Toronto

Save the file and exit.

Next up, let’s install the PHP-GD Graphics Library. You can quickly install it with the following commands:

apt-get update
apt-get install php5-gd

After all these steps, or after any individual one you had to perform, give Apache a restart so they take effect:

sudo service apache2 restart

Installation

First thing we need to do is navigate into the web server root directory (/var/www):

cd /var/www

Next thing we need to do is download the Silverstripe archive file. You can find the link to the stable release here: http://www.silverstripe.org/stable-download/ (CMS & Framework). Copy it and run the following command in the terminal:

wget http://www.silverstripe.org/assets/releases/SilverStripe-cms-v3.0.5.tar.gz

Make sure you replace the link with the one you found. This will download the tarball that you need to untag:

tar -zxvf SilverStripe-cms-v3.0.5.tar.gz

Confirm again that you replaced the name of the file with the one you downloaded. This command will unpack the archive and create a new folder that you can rename to something more friendly (let's say silver):

mv SilverStripe-cms-v3.0.5 silver

Now that the application is in the silver folder, it’s time to set some permissions so that the web installer can do its job. Run the following commands to make the www-data group the owner of the required files and folders (make sure you run these commands from the application root folder - /var/www/silver):

chown -R root:www-data assets
chown root:www-data .htaccess
chown root:www-data mysite/_config.php

Now we have to make sure the groups can write in these files and folders:

chmod 775 -R assets
chmod 775 .htaccess
chmod 775 mysite/_config.php

This takes care of the permissions issue. Finally, we’ll have to create an empty database for Silverstripe to use. So in your MySQL terminal, run the following command to create a database called silver (name is your choice):

create database silver;

Then quit the MySQL terminal and head to your browser and point it to the site folder: your-ip-address/silver. Don’t worry if you see a problem with the database connection. That is because you haven’t specified the relevant information yet and it's what we will do now. Provide the information and re-check the requirements to make sure all is fine and you can continue.

Now go ahead and create your admin account on this page before clicking on the big install button which should then run the installer and redirect you to a success message page from where you can then access the homepage of your new site (at your-ip-address/silver).

But what if you want the site to be available at your domain name which is set to point to your web server's root folder (/var/www)? You have three choices - One: you can move all the Silverstripe related files to this folder, Two: you can change the webserver's root directory to point to the /var/www/silver folder instead of the default one, or Three: you can create a new virtual host for the domain name with that directory as its document root. The choice depends on your setup.

If you want to create a virtual host for the domain name, follow the instructions in this tutorial. But if you want to quickly change the default web server document root, open up again the file you edited before to allow the .htaccess overrides:

nano /etc/apache2/sites-available/default

And change this line from this:

DocumentRoot /var/www/

To this:

DocumentRoot /var/www/silver/

This is assuming that your Silverstripe site is in the silver folder.

And now you should be able to access your new site straight from your domain name that is set to use your VPS' default virtual host.

Article Submitted by: Danny

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
6 Comments


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Please add the following as a first step, otherwise package dependencies will be outdated:

apt-get update

Maybe your try to installing silverstripe 3.x on nginx and mariadb ? Would be great if you will using centos or ubuntu versions. Thank you.

Thanks Andrew, GREAT suggestion : )

Checking out the logs I discovered the installer was looking for sapphire which was not even in the directory… mega duh!

SS used to give a complete download of the whole package until recent years, it is now distributed in separate modules for framework, cms, installer

I found this package for my legacy 2.4.7 site https://groups.google.com/forum/#!topic/silverstripe-announce/VkznPpzFXl8

And now it installs perfectly ok…

Oh, AND, for the migrated site I had to give 777 permissions to silverstripe-cache http://www.silverstripe.org/archive/show/4137

And now it loads as expected : )

Learned a lot in that lil excercise, and awesome tut, really it would have been 10 times longer without this detailed info, much appreciation!

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
April 23, 2014

Is there any relevant error output in “/var/log/apache/error_log”

Great info, though still having some trouble getting things working on my ubunu 12.04 LAMP

Its a legacy site that is using SS 2.4.7

Followed along with all of the above (I believe!), including changing rewrite to on in vhost setup too

navigating to dropletIP/silver

I just get a white screen, no action whatsoever…

Tried this both with fresh installer and with a site migration and mysql import, same white screen in both situations.

Maybe something obvious I’m overlooking?!

Great tutorial!!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.