About this Document

In my recent class on Content Management Systems I introduced MAMP and Concrete5. I believe these two tools are the best and simplest tools to enable anyone with the desire, basic web knowledge, and computer skills to locally install, configure, and manage a CMS-based web site.

This document describes how to install and configure both MAMP and Concrete5.

MAMP

MAMP is a set of web site programs that are controlled by a single application. The name stands for Macintosh (the operating system), Apache (the web server software), MySQL (the database software), and PHP (the software that interprets the PHP scripts). There are also LAMP (for Linux) and WAMP (for Windows). There are other programs that do similar things, but in my experience MAMP is the simplest and most bulletproof.

You can download the latest version of MAMP at: http://mamp.info/en/index.html

Once you've downloaded MAMP, open it and it will go through the standard application installation procedure (if you don't know how to do this maybe you shouldn't be messing around with a program such as MAMP ;-)

NOTE: If you already have a MAMP installation be sure to remove the existing htdocs and database folders if you have files you want to keep in it, as the fresh install of MAMP will overwrite the existing folder!

MAMP installs two folders in your Applications folder: MAMP and MAMP Pro. If you do not intend to use the advanced features of MAMP Pro you can safely delete it.

MAMP in Finder

Double-clicking the MAMP application in the MAMP folder launches MAMP, which in turn initializes both the Apache web server software and the MySQL database (you may have to enter an admin password).

MAMP-panel

The standard hostname for a locally-hosted web server is "localhost." However, MAMP uses a different port (8888) than the standard Macintosh hosting port (80) so as not to conflict with it. So if you open a browser window and enter "http://localhost:8888/" you should see whatever is in the htdocs directory.

A tutorial with additional instructions for downloading and installing MAMP can be found at: http://sawmac.com/mamp/

Setting up a database

When you launch MAMP, by default it will open a window in your browser. This window displays information about the programs that MAMP manages (Apache, MySQL, PHP). One of MAMP's helper programs, phpMyAdmin, is a set of scripts that enable you to easily administer your MySQL databases.

Click on the phpMyAdmin button. It will load the phpMyAdmin interface.

This is the home page for phpMyAdmin. You can add a new database from this page. Enter a name for your site's database at the bottom of this page.

NOTE: If you intend to upload this site to a server you should select your database name carefully. Although it is possible to rename a database, you will have to change some config files when you rename it. Shared hosts prepend your site's second level domain name and an underscore so that database names on a shared host all have unique names. For example, if your site domain is "mysite.com," the server will automatically prefix "mysite_" to the name. Therefore, I recommend you name your database now what it is likely to be named when you upload it. In this example, you could name it "mysite_c5" (or "mysite_db" or whatever).

phpMyAdmin should give you the message that the database was created. Now that you have created a database you will need to create a user to administer it. Click on the "Privileges" button. This will open the page with various functions related to adding or deleting users and assigning privileges. Click on "Add a new user."

In the page that opens, fill out the "User name: Use text field" with your desired user name. (I recommend "admin"). In the "Host" field, select "Local," and "localhost" should be automatically pasted into the field. In the "Password: Use text field" area place your desired password, and then repeat it in the "Re-type" field. You do not click on "Generate Password"--that dynamically creates a really secure password for you.

In the next area, select "Grant all privileges on database [name]" (Note: this option is not available if the database has not been selected. If you follow these directions, the database should be selected.)

To make this user an administrative user, click on "Check All" in the next area. This should select all user options, and thus give the user full administrative access to this database. Click "Go" and the user should be added to the database.

IMPORTANT: MAKE A NOTE OF THE FOLLOWING: The database name, the user name, and the user password. You will need these when you set up Concrete5.

Concrete5

Download the latest version of Concrete5 from http://www.concrete5.org/developers/downloads/

In the MAMP folder are a bunch of folders in addition to the MAMP application. The folder named "htdocs" is where you will put any files you want the web server to serve (this is the standard folder name for web pages on a web server).

Unzip the Concrete5 file. Move all of the folders in the Concrete5 folder into the htdocs folder within the MAMP folder. You are now ready to initialize your Concrete5 installation. (Note: do not move the Concrete5 folder itself into the htdocs folder, just all the folders in the Concrete5 folder).

Open a browser window and enter "localhost:8888." The install page of Concrete5 should appear.

Concrete5 performs various tests to be sure that the environment is set up properly to host it. If any of the tests fail, it may prevent Concrete5 from working properly. MAMP generally works fine out of the box, but nothing is guaranteed. Diagnosing failed tests is beyond the scope of this document, but if you run into problems I may be able to help. If all tests have passed you can go ahead and fill out the fields:

Enter the name of your site in the first field (this can have spaces and caps, e.g. "My Great Web Site.")

Enter your email address.

Enter "localhost" in the "Server" field.

Enter same user name, password, and database name you entered when you set up the database above.

Click "Install Concrete5" and cross your fingers…

If you have made a mistake in setting up the database or entering the information Concrete5 will return to this page immediately with "Unable to connect to database." displayed in red.

I suggest you take some time to poke around in phpMyAdmin to get a basic understanding of how to administer a database. Any mistakes you make at this point can be easily remedied. If you have done a lot of work on your site and then decide to mess with the database, you may lose your work.

If you have entered the info correctly Concrete5 will take several seconds while it runs the scripts to set up all the database tables. It will then bring you to a "Congratulations" page. This page will tell you " You have been logged in as admin with the password [password].

WRITE DOWN THE USER NAME (which defaults to "admin") AND THE PASSWORD. IF YOU LOSE YOUR PASSWORD YOU WILL NOT BE ABLE TO ACCESS YOUR SITE AND YOU WILL HAVE TO REINSTALL IT. And no, you can't use the email option unless you have set up a mail server on your Macintosh.

I recommend that you immediately change your password. (I like to have the same user name and password for both the MySQL database and Concrete5.) To change it go to the Dashboard, then click on "Users and Groups" and then click on the user "admin" (should be the only entry). This will open the entry for this user. Click on "Edit User," and then change the password in the page that comes up.

Congratulations! If you got this far, you have successfully installed both MAMP and Concrete5, and you now have a working Content Management System installed on your computer. Your Concrete5 installation should work as expected.

A wide variety of helpful topics can be found at: http://www.concrete5.org/documentation/

Migrating Your Site to a Host

If you wish to migrate your site to a host server you will have to upload the entire site and the database. phpMyAdmin provides functions for exporting and importing databases, and you can upload the htdocs folder's contents into your host's folder with an FTP client. However, you will have to make changes in the document that tells PHP where to look for the database and the username and password information. This file can be found in "htdocs>config> site.php." A complete description of how to move the site is beyond the scope of this document, but you can find documentation here: http://www.concrete5.org/documentation/installation/moving_a_site

Drop-Down Menu

A tutorial on adding a drop-down menu to Concrete5 can be found at: http://www.codeblog.ch/2009/04/concrete5-drop-down-menu/. To install, download the files provided in this tutorial and install them in your site (you only need the files in the "blocks" folder. Just drag the "autonav" folder in the "blocks" folder you just downloaded into your site's "block" folder. (The other folder is the author's theme).

The drop down menu can be easily edited; simply navigate through the "autonav" folder to the "view.css" file, and edit that as you wish. To apply this to your site, enter edit mode on the page, then click on the autonav block (which is installed by default at the bottom of the header block when Concrete5 installs) and select "Custom Template," and in the selector, choose "Drop Down Menu." This will apply the template to the menu.