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.
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.
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.
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:
Now, copy the link to the .zip file of the latest release from http://www.concrete5.org/
wget --trust-server-names http://www.concrete5.org/
download_file/-/view/58379/-O concrete5.zip 8497/
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 concrete188.8.131.52 concrete5
Then navigate into the this folder:
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:
If you see "rewrite_module" in the list, you are fine. If not, use the following command to enable the module:
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:
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:
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/
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:
And change this line from this:
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!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.Sign up