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.
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:
If you see "rewrite_module" in the list, you are fine. If not, use the following command to enable the module:
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:
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:
And in this file where you see the following line:
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
First thing we need to do is navigate into the web server root directory (/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/
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:
And change this line from this:
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.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
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!
Click below to sign up and get $200 of credit to try our products over 60 days!
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
Please add the following as a first step, otherwise package dependencies will be outdated:
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!
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?!