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 concrete5


To install concrete5 follow these steps:

  1. Open your favorite browser and enter http://localhost/. You should see the following installation screen:

  2. There are a number of checks that make sure your environment supports all the necessary functions needed for concrete5 before installing it. Our Bitnami stack contains everything and therefore only shows you green icons. A few words about the required items:

    • PHP: Whenever possible, try to use the latest PHP version but make sure you run at least 5.2.4.

    • JavaScript enabled: The concrete5 interface uses a lot of JavaScript to make things easy and smooth to use. It won't be possible to edit any content if you disable JavaScript in your browser.

    • MySQL available: concrete5 needs a MySQL database; no other databases are supported.

    • Supports concrete5 request URLs: By default you'll see index.php in each concrete5 URL you open. To get rid of this, you need to have the Apache module mod_rewrite, which we're going to deal with later in this chapter.

    • Image manipulation available: There are a number of functions such as the creating of thumbnails, which need image libraries in PHP.

    • XML support: In concrete5 you'll have some XML files to describe data structures, which is why XML support is mandatory.

    • Writable files and configuration directories: Usually not a problem if you work with a WAMP stack on Windows. The web server must be able to write some files in your website's installation directory. We'll discuss this issue later, when we move the site to the production server.

    • Cookies enabled: Cookies are used in the log in process and must be enabled in your browser.

  3. Once you've managed to get every icon to be green, click on Continue to Installation to get to this screen:

  4. To install concrete5 you have to enter the following information:

    • Name Your Site: You can enter any name you want, which can be changed in the dashboard later.

    • Email Address: This is the admin mail address. Make sure it exists; this is where you'll receive a link to change the eventually forgotten admin password.

    • Password: This is the password for the user admin; make sure it's not too easy since admin is the main user with access to everything in concrete5.

  5. You will also have to enter the following database information:

    • Server: Since the database is running on the same machine as the web server, just enter 127.0.0.1. If you changed the default MySQL port from 3306 to something else like 3307, use 127.0.0.1:3307.

    • MySQL Username, MySQL Password, and Database Name: concrete5 or whatever you used when you created the user in phpMyAdmin.

  6. Next is the Sample Content section. If you select Sample Content with Blog, concrete5 will create a few pages to play around with. Enable this; if you're new to concrete5, it will create some nice pages where you can see the different blocks you can use to build your website. You can remove those pages later.

  7. If you've entered all the necessary information, click on Install concrete5!

What just happened?

A few seconds after you've clicked on Install concrete5 you should see a screen with a confirmation that your site is up and running. Navigate to the actual site available at http://localhost/ and you should see the following screen:

You might wonder why we've used 127.0.0.1 and not localhost when connecting to the MySQL database. Both values would work, but it can happen that localhost is much slower because it resolves to an IPv6 address on Windows, in which case you'd run into a timeout first because MySQL doesn't support IPv6.

The configuration file

After you've successfully installed concrete5 you'll find a file called site.php in the config directory. This is where the installation process has saved the information you've entered during the process. Here's how it looks:

<?php 
define('DB_SERVER', '127.0.0.1');
define('DB_USERNAME', 'concrete5');
define('DB_PASSWORD', 'concrete5');
define('DB_DATABASE', 'concrete5');
define('PASSWORD_SALT', 'C8MKVa6UZveKlYxFGvmFFqspBAOR5hLjMf9Xsz');
  • DB_SERVER, DB_USERNAME, DB_PASSWORD, and DB_DATABASE are obviously just database related. If the credentials to access your MySQL database have changed, this is where you have to modify them to make sure concrete5 can access your database.

  • PASSWORD_SALT: This is a random string used in combination with the password to generate the password hashes found in the user table. Salts are used to complicate dictionary attacks and even if they are useless without a password, you should still not publish a real password salt to keep your site safe.

Pop quiz – the configuration file

Q1. You'll often have to check or modify a few lines in the configuration file, so where can you find it?

  1. <concrete5 installation directory>\config.php

  2. <concrete5 installation directory>\config\config.php

  3. <concrete5 installation directory>\config\site.php

Disabling caching

There are a few different caching functions in concrete5 which can improve the performance of your site but also make things difficult if you keep changing the files. If you change a file without telling concrete5 anything about it, it will keep using the old values in the cache and not reflect the changes you've made. It's therefore recommended to disable all caches while working on a new site.