We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

How To Install Concrete5 on Your VPS Running Ubuntu 12.04

PostedSeptember 4, 2013 15.8k views CMS Ubuntu

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.

About Concrete5

Concrete5 is an open source Content Management System (CMS) built in PHP that seeks to be very easy to understand and learn. It is created with the idea in mind that it should well serve for creating and deploying websites but also running and managing them in the long run by non-developer site owners.

In this tutorial we will look at how to install Concrete5 on a VPS running the Ubuntu 12.04 operating system. To be installed, it requires the LAMP stack (Linux, Apache, MySQL and PHP - 5.3 or higher is recommended), but can also work on a Windows IIS web server.

For this tutorial, we will go with the LAMP stack to run Concrete5, so make sure you have it installed before going forward. If not, consult this tutorial for step-by-step instructions on how to set it up. If you are interested in switching to MariaDB from MySQL, consult this tutorial for more information.

Installation

The first thing you’ll need to do is download the latest stable release of Concrete5 onto your VPS. So let’s navigate to the Apache web server root directory first:

cd /var/www

Now, copy the link to the .zip file of the latest release from http://www.concrete5.org/developers/downloads/ and run the following command to download the file to your VPS:

wget --trust-server-names http://www.concrete5.org/download_file/-/view/58379/8497/ -O concrete5.zip

Make sure you replace the link with the one for the latest stable release in your case. This command will download a .zip file called concrete5 that you now have to extract. Run the following command to do so:

sudo unzip concrete5.zip

If you don’t have unzip installed and you get an error, run the following command to install it:

sudo apt-get install unzip

Now try again unzipping the archive. You should get a new folder named after the release, feel free to rename it into whatever you want - for instance: concrete5:

mv concrete5.6.2.1 concrete5

Then navigate into the this folder:

cd concrete5

Now, if your Apache server already has mod_rewrite enabled and it allows .htaccess files to override its instructions, you can skip these next few steps. To check if mod_rewrite is already enabled, 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, again if this is not the case for you, 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>

This will make sure that .htaccess files can override the default Apache instructions.

In order for any of these two changes to take effect, you’ll need to restart your Apache server:

sudo service apache2 restart

Next up, let’s create an empty database for Concrete5 to use when installing. Quickly jump into your MySQL terminal and run the following command to create an empty database (choose whatever name you want for the database):

create database concrete5;
Then go ahead and quit the MySQL terminal. Now on the browser, go through the installation script that will guide you through the next steps:
www.example.com/concrete5

Here you will see a list of checks that your VPS must pass in order for Concrete5 to be able to install. For instance, it requires the GD PHP library for image manipulation so if you don’t already have it, you have to install it. Back in the terminal, run the following commands (the first one is just for updating the repositories):

sudo apt-get update
sudo apt-get install php5-gd

Then restart again Apache for the change to take effect:

sudo service apache2 restart

Next, you’ll need to set permissions for some files and folders in order to make them writable by the web server. For Apache, the user it uses to do this is called www-data and it resides in the www-data group. So let’s change the ownership of the necessary folders with the following commands:

chown -R root:www-data files/ 
chown -R root:www-data config/ 
chown -R root:www-data packages/ 

This will make the root user and the www-data group the owner of the folders and everything inside. What we have to do now is give permission to the users inside the www-data group to write in these folders:

chmod -R 775 files/
chmod -R 775 config/
chmod -R 775 packages/

Now, if you reload the checker and everything is okay, you can continue with the installation (the big blue button). The next screen is pretty self explanatory. You have to fill in some basic information about your site and the database information (since MySQL is running on the same machine, specify localhost in the server field). And as you are following this tutorial, it’s recommended to then go with the "Sample Content with Blog" option to see Concrete5 in action after it gets installed.

After the installation, you should get a message like this: Congratulations. concrete5 has been installed. You’ll be logged in with the username admin and the password you specified and you can continue to your new site.

You’ll notice that by default, the URLs are not the cleanest possible. You either get them with query strings or with the index.php URI segment included. To clean the URLs, navigate to www.example.com/concrete5/index.php/dashboard/system/seo/urls/ and check the box "Enable Pretty URLs". Then paste the given code into an .htaccess file in the Concrete5 root folder:

nano /var/www/concrete5/.htaccess

Save the file and now try navigating again on your site and you’ll notice the difference - you are now good to go.

To access the site so far, we've navigated directly to its folder in the browser (www.example.com/concrete5). But what if you want the site to be available at your domain name? You have three choices, One: you can move all the Concrete5 related files to the webserver's root directory; Two: you can change the webserver's root directory to point to the /var/www/concrete5 folder instead of /var/www; or Three: you 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/concrete5/

This is assuming that your Concrete5 site is in the concrete5 folder.

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

Good luck building your new Concrete5 website!

Article Submitted by: Danny

2 Comments

Creative Commons License