Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
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 installation screen:

  2. On the left there are a few checks to make sure that your web server meets all the requirements of concrete5. A few words about the required items:

    • PHP: Whenever possible, try to use the latest PHP version.

    • JavaScript and MySQL : At this point, concrete5 only works with MySQL and needs JavaScript because of its AJAX interface.

    • C5 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 and XML Support: These are PHP modules which are enabled by default and needed by concrete5.

    • Web Server Access to Files: Usually not a problem if you work with XAMPP on Windows. The webserver 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.

    • Version Comparison: This feature uses Python to show you the difference between page modifications. A nice feature but it doesn't work because XAMPP Lite doesn't install Python. But since it's optional we're not going to worry about it.

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

    • Name Your Site : Any name you want—can be changed in the dashboard later.

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

  4. 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 localhost.

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

  5. Sample Content: If you enable this, concrete5 will create a few sample 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.

  6. If you've entered all the necessary information, click Install Concrete >!

What just happened?

A few seconds after you've clicked Install Concrete you should see a screen with an automatically generated admin password. Make sure you don't lose it.

concrete5 is installed and ready to work with on your computer!

You should now be able to open the default concrete5 website, by entering http://localhost/ in your browser.

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', 'localhost');
define('DB_USERNAME', 'concrete5');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'concrete5');
define('BASE_URL', 'http://localhost');
define('DIR_REL', '');
define('PASSWORD_SALT', 'zc8tSsYQI0E2MifRwboxBq6K9UmbL4X7vrf3Tz1unNFVCPWkO5glHjZaGpADJ');
?>
  • 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.

  • BASE_URL is used by default to make sure that your website visitors use your primary domain. If your site is accessible by multiple domains, concrete5 will just forward them to the URL specified in BASE_URL.

  • DIR_REL is empty if you've installed your website in the root. It's only filled if your website is located in a subdirectory.

  • PASSWORD_SALT, this is a random string and is 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

  1. 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

Pretty URLs

When you browse to a subpage in your concrete5 site you'll notice an odd thing in every URL: there's index.php in it like this http://localhost/index.php/about/. Every request to a page in concrete5 is processed by index.php. This has several advantages: It's easier to check the permissions, there's a single point where the page rendering time can be improved, and a few more things.

However, even with these advantages you probably wouldn't like to see index.php in every URL. Luckily it's rather easy to change it if your web server supports rewrite rules. XAMPP does, and here's what we have to do.