Book Image

concrete5: Beginner's Guide - Second Edition - Second Edition

Book Image

concrete5: Beginner's Guide - Second Edition - Second Edition

Overview of this book

concrete5 is an open source content management system (CMS) for publishing content on the World Wide Web and intranets. concrete5 is designed for ease of use, and for users with limited technical skills. It enables users to edit site content directly from the page. It provides version management for every page and allows users to edit images through an embedded editor on the page. concrete5 Beginner's Guide shows you everything you need to get your own site up and running in no time. You will then learn how to change the look of it before you find out all you need to add custom functionality to concrete5. concrete5 Beginner's Guide starts with installation, then you customize the look and feel and continue to add your own functionality. After you've installed and configured your own concrete5 site, we'll have a closer look at themes and integrate a simple layout into concrete5. Afterwards, we're going to build a block from scratch which you can use to manage a news section. We're also going to add a button to our site which can be used to create a PDF document on the fly. This book also covers some examples that show you how to integrate an existing jQuery plugin. concrete5 Beginner's Guide is a book for developers looking to get started with concrete5 in order to create great websites and applications.
Table of Contents (19 chapters)
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Pop Quiz Answers
Index

Time for action – installing Bitnami WAMP stack


concrete5 is a PHP application which uses PHP as its programming language in combination with a MySQL database. There are lots of possibilities to meet the requirements of concrete5. The preferred web server is Apache but IIS like any web server supporting PHP works as well, but only Apache is supported by the core team.

If you already have a server or a local Apache, PHP, and MySQL set up, you can skip this step and continue with the Downloading concrete5 section a few pages ahead. Otherwise, we are going to need to install Bitnami WAMP stack on your local computer by following these simple steps:

  1. Go to http://bitnami.org/stacks/ and select the MAMP stack for Mac OS, WAMP for Windows, and LAMP for Linux. On the next page, click on Installer and double-click the EXE as soon as it has been downloaded. You should see the following window or a dialog you have to confirm if files downloaded from the Internet aren't executed directly on your computer:

  2. Click on Next to get to the next installation screen. Here you'll see a screen with a number of preselected components. We don't need them, as we're going to install concrete5 as our Content Management System (CMS) and framework. phpMyAdmin can't be unselected, but that's okay.

  3. Click on Next once more and you'll be asked to specify the installation folder. You can keep the suggested value but feel free to change it if you prefer a different location. For this book, we used Version 5.4.10. Your version might be higher. Cause the WAMP folder will have the version number in the name, all follow-up.

  4. Click on Next again and you'll be asked to enter the MySQL password for the user root. It's important to keep it saved as this is the main user to access your database. You'll need this password later when we install concrete5.

  5. There are a few more screens; click on Next and you'll have to enter the port number for Apache as well as MySQL in the following screen. You can keep the port number 80 for Apache and 3306 for MySQL. However, it might be possible that another application is already using one or both of these ports, in which case you have to disable the existing application or use a different port number. It's not a problem if you change these numbers; just make sure that you remember the port numbers as you'll need them later when we install concrete5.

After you've clicked your way through all the screens and confirmed the launch process at the end, you should have a running MySQL server as well as a working Apache web server with all necessary components to run a concrete5 site on your local computer. Before we install concrete5, let's make a small change to the MySQL configuration. MySQL table names are not case sensitive on Windows. This will cause some problems if you want to move your site to a Linux server where MySQL is by default set up with case sensitive table names. If you don't feel comfortable with this change, it's not necessary, but recommended if you move your site to another server at some point.

To change this, if you work with concrete5, do the following:

  1. Go to the directory where you've installed Bitnami and open the folder mysql; it should look as follows:

  2. The my.ini file contains several settings related to MySQL. Open the file and insert the following line immediately after the mysqld section:

    lower_case_table_names = 0

    The mysql section should look like as follows:

  3. Now that MySQL is properly configured, locate the manager tool in your start menu. You should be able to find it in All Programs | Bitnami WAMP Stack | Manager tool and open it. You should see the following dialog:

  4. Select MySQL Database and click on the Restart button in the right pane. The buttons go gray. When the buttons return to their regular state the restart of MySQL is complete.

  5. If everything worked you should be able to open your browser and enter http://localhost/.

    Note

    If you had to change the port of your Apache service, make sure you append it to the hostname. Port number 80 is the default port to access websites and can be omitted. However, if you had to change to a different number like 8000, you have to use an address like this: http://localhost:8000/.

There's also one small change we have to make to the Apache configuration in order to make sure we can use a file called .htaccess, which allows concrete5 to change certain Apache configurations. Follow these steps:

  1. Go to the directory where you've installed Bitnami and open the folder apache2 and then conf.

  2. Within that directory, open the file called httpd.conf.

  3. Look for a section which starts with <Directory "C:/BitNami/wampstack-5.4.10-0/apache2/htdocs"> and then look after a property called AllowOverride. You'll have to change its value from None to All.

  4. The relevant part should look like as follows afterwards:

    DocumentRoot "C:/BitNami/wampstack-5.4.10-0/apache2/htdocs"
    <Directory "C:/BitNami/wampstack-5.4.10-0/apache2/htdocs">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatchExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        #
        Options Indexes FollowSymLinks
    
        #
        # AllowOverride controls what directives may be placed in.htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
        Require all granted
    </Directory>
  5. After you've saved the change, go to the Bitnami Manager tool, select the Apache Web Server process, and restart it.

What just happened?

The Bitnami WAMP Stack setup package installed a working web server, including PHP with the most commonly used modules and a MySQL database. This is what a lot of web applications need, and you can use this environment for other CMSs as well.

You've also had a quick look at one MySQL configuration file to avoid problems when moving your data to a Linux server. If you want to know more about this setting, the MySQL documentation is going to answer almost any question about table names: http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html.

We also enabled support for .htaccess files in Apache. We'll need it later in this chapter when we enable pretty URLs.

Pop quiz – requirements for concrete5

Like any other software, concrete5 needs certain things to run. Try to answer the following questions.

Q1. Which of the following server-side programming language(s) has been used to build concrete5?

  1. PHP

  2. Microsoft ASP

  3. Java

  4. All of the above

Q2. Which of the following database(s) can you use with concrete5?

  1. PostgreSQL

  2. MySQL

  3. Oracle

  4. All of the above

Q3. Which of the following operating system(s) can you use to run concrete5?

  1. Microsoft Windows

  2. Mac OS X

  3. Linux

  4. All of the above

Q4. Name the web server(s) you can use to run concrete5:

  1. Microsoft IIS

  2. Nginx

  3. Apache

  4. lighttpd