3.2. Configure Joomla!

Now it's time to configure Joomla!

3.2.1. Create and Configure the MySQL Database

To create the MySQL database run the following as the "root" user.

    [root@t1 tmp]# mysqladmin -u root -p create Joomla
    Enter password: 
    [root@t1 tmp]#

Now we need to create a MySQL user for Joomla! Here is a sample session. First you need to log in to MySQL as "root" and then create the user with all priviliges for the Joomla! database. In this example I created the user "joomla_admin" with the password "lockbox".

    [root@t1 tmp]# mysql -u root -p 
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 60 to server version: 5.0.17-standard
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>  GRANT ALL PRIVILEGES ON Joomla.* TO joomla_admin@localhost IDENTIFIED BY 'lockbox';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> quit
    Bye
    [root@t1 tmp]# 

3.2.2. Configure Joomla! via the Web Site

At this point you should be able to access Joomla! by directing your browser to the your new Joomla! site where you will be greeted with a "Pre-Installation Check" page.

3.2.2.1. Pre-Installation Check

The text here will mention that values marked in red might need to be changed for proper installation. You only need to be concerned if "Directory and File Permissions" section lists anything in red as having write access to these files is necessary. If any items are listed in red here it most likely means that the steps in Ch.3 sec.1 were unsuccessful or not completed. If this is the case go back and repeat those steps and then click on the "Check Again" button at the top right of the Joomla! web page. If this is taken care of click on the "Next" button.

3.2.2.2. License

Here you can review the licensing of Joomla!. When complete click on "Next".

3.2.2.3. Step 1

Here you are prompted for some data.

  • Host Name: enter "localhost"

  • MySQL User Name: enter the MySQL user name that was created in sub-section 2.1 Create and Configure the MySQL Database.

  • MySQL Password: enter the MySQL password for the user that was created in sub-section 2.1 Create and Configure the MySQL Database.

  • MySQL Database: enter "Joomla".

  • MySQL Table Prefix: I used the default "jos_".

  • Drop Existing Tables: leave unchecked.

  • Backup Old Tables: leave unchecked.

  • Install Sample Data: check this item.

Click on the "Next" button.

3.2.2.4. Step 2

You are prompted for a site name which will be used in email messages. I used the suggested "The Home of Joomla" but use a name that suits you.

3.2.2.5. Step 3

Here you are prompted for the Joomla! URL, path to files, an administrative email address and a password. The default values were fine for me except for the password. I chose one that I found easier to type and to remember. I also chose the default file and directory permissions. Once you have completed this click on the "Next" button.

3.2.2.6. Step 4

This step will display some PHP code in a text area. Up to this point no configuration.php file has been created but it necessary. Highlight this code and create the file configuration.php in the DocumentRoot directory and paste this code into the file. Once that is done change the owner and group to be the same as all of the other files in this directory (except the files that were changed inCh.3 sec.1 ). You do listing of the directory to determine the owner and group. Here the owner is "pete" and the group is "www" as shown by the listing.

    # ls -l
    total 276
    -rw-r--r--   1 pete www  33858 Dec 23 12:07 CHANGELOG.php
    -rw-r--r--   1 pete www   3417 Dec 23 12:07 COPYRIGHT.php
    -rw-r--r--   1 pete www   4374 Dec 23 12:07 INSTALL.php
    -rw-r--r--   1 pete www  17977 Dec 23 12:08 LICENSE.php
    drwxr-xr-x   9 pete www   4096 Dec 23 12:08 administrator
    drwxrws---   2 pete webd  4096 Jan 12 16:52 cache
    drwxrws---  16 pete webd  4096 Dec 23 12:08 components
    -rw-r--r--   1 pete www   2412 Jan 12 09:00 configuration.php
    -rw-r--r--   1 pete www   4001 Dec 23 12:07 configuration.php-dist
    drwxr-xr-x   2 pete www   4096 Dec 23 12:08 editor
    -rw-r--r--   1 pete www   3053 Dec 23 12:07 globals.php
    drwxr-xr-x   3 pete www   4096 Dec 23 12:08 help
    -rw-r--r--   1 pete www    690 Dec 23 12:07 htaccess.txt
    drwxr-xr-x   6 pete www   4096 Dec 23 12:08 images
    drwxr-xr-x  10 pete www   4096 Dec 23 12:08 includes
    -rw-r--r--   1 pete www   6419 Dec 23 12:07 index.php
    -rw-r--r--   1 pete www   4353 Dec 23 12:07 index2.php
    -rw-r--r--   1 pete www   2405 Jan 12 16:37 configuration.php
    drwxr-xr-x   2 pete www   4096 Dec 23 12:09 language
    -rw-r--r--   1 pete www    710 Dec 23 12:08 mainbody.php
    drwxr-xr-x   7 pete www   4096 Dec 23 12:09 mambots
    drwxrws---   2 pete webd  4096 Dec 23 12:09 media
    drwxr-xr-x   2 pete www   4096 Dec 23 12:09 modules
    -rw-r--r--   1 pete www   3777 Dec 23 12:08 offline.php
    -rw-r--r--   1 pete www   2474 Dec 23 12:08 offlinebar.php
    -rw-r--r--   1 pete www    705 Dec 23 12:08 pathway.php
    -rw-r--r--   1 pete www    286 Dec 23 12:08 robots.txt
    drwxr-xr-x   5 pete www   4096 Dec 23 12:09 templates

Now change the group and permissions of configuration.php with the "chown" and "chgrp" commands as shown below. Replace "pete" and "www" with the appropriate owner and group that you have determined from the above listing for your server.

    [root@t1 html]# chown pete.www configuration.php
    [root@t1 html]# chmod 644 configuration.php
    [root@t1 html]# ls -l configuration.php
    -rw-r--r--  1 pete www 2405 Jan 12 16:37 configuration.php
    [root@t1 html]#

The initial configuration is now complete.

3.2.2.7. Installation File Removal

At this point there should be a "View Site" button at the top of the web page. Click on it and your browser will be directed to your Joomla! site. The new web page will instruct you to remove all of the files in the "installation" directory that is in the DocumentRoot directory. Make sure you are in the DocumentRoot directory where you installed the Joomla! code and remove the "installation" directories entire contents using the "rm -rf" command. Here is an example session where the "installation" directory is listed then removed and the second listing shows that it no longer exists.

    [root@t1 html]# ls -l | grep installation
    drwxr-xr-x   3 pete www  4096 Dec 23 12:09 installation
    [root@t1 html]# rm -rf installation
    [root@t1 html]# ls -l | grep installation
    [root@t1 html]#