Building Websites with Joomla! 1.5 — Save 50%
The best-selling Joomla! tutorial guide updated for the latest 1.5 release
The installation of Joomla! is a matter of five minutes. If you have installed it before, you can do it in two minutes. In order to be able to even start the installation, your development environment must include a web server that supports PHP and a database that is supported by Joomla!. Joomla! is one piece of the puzzle in this so-called Client-Server System. This topic is very complex, since there is an unmanageable number of providers and an even more unmanageable combination of installed Apache, PHP, and MySQL versions and Webspace administration tools such as Visas and Plesk.
In this article by Hagen Graf, we focus on the following points:
- A PHP safe mode, possibly activated in the php.ini
- Prohibited conversion of URLs with Apache because of the non-activation of the so called rewrite engine
- Directory rights in Linux that are set differently than in Windows
In principle the simplest approach that actually always works is the following:
- Load the Joomla! 1.5 beta.zip file onto your local PC and unpack it in a temporary directory.
- Load the just unpacked files by means of FTP onto your rented server. The files must be installed in the publicly accessible directory. These directories are usually named htdocs, public_html, or simply html. You can specify a subdirectory within the directory into which you install your Joomla!. Many web hosts allow you to link your rented domain name to a directory. This name is necessary to call your website from a browser.
- You have to find out what your database is called. Usually one or several databases are included in your web-hosting package. Sometimes the user name, database name, and password are fixed; sometimes you have to set them up. There is usually a browser-based configuration interface at your disposal. You can see an example of such an interface in the following figure. You will need these access data for Joomla!'s web installer.
You can get going after you have loaded these data onto your server and are in possession of your access data.
To install Joomla!, you need the source code. Download the Joomla_1.5.0-Beta-Full_Package.zip package and save it on your system.
Selecting a Directory for Installation
You have to decide whether Joomla! needs to be installed directly into a document directory or a subdirectory. This is important, since many users prefer a short URL to their homepage.
If Joomla! is unzipped directly in /htdocs, the web page starts when the domain name http://www.myhomepage.com is accessed from its local computer http://localhost/ and/or from the server on the Internet. If subdirectories are created under /htdocs/, for example, /htdocs/Joomla150/ and we unzip the package there, we have to enter http://localhost/Joomla150/ in the browser. This isn't a problem locally, but doesn't look good on a production Internet page.
Some HTML files and subdirectories, however, are already in /htdocs in the local XAMPP Lite environment under Windows, which, for example, displays the start page of XAMPP Lite. In a local Linux environment, a starting page dependent on the distribution and the web server settings is also displayed.
I recommend that you create a subdirectory under the document directory named Joomla150 in Windows by using Windows Explorer. (With Linux, use the Shell, KDE Konqueror, or Midnight Commander.)
The directory tree in Windows Explorer should look like this:
An empty index appears in the XAMPP Lite version when the URL http://localhost/Joomla150 is entered in the browser:
With Linux or with another configuration it can happen that you get a message saying that you don't have access to this directory. This depends on the configuration of the web server. For security reasons, the automatic directory display is often deactivated in Apache's configuration. A potential hacker could draw many interesting conclusions about the directory structure and the files on your homepage and target your computer for an attack.
For security reasons, you are usually not allowed to access the appropriate configuration file of the Apache web server. Should you be able to, you should leave the content directories deactivated and/or only activated for those directories that contain files for downloading.
|The best-selling Joomla! tutorial guide updated for the latest 1.5 release|
eBook Price: £16.99
Book Price: £27.99
Now you can finally extract the package file Joomla_1.5.0-Beta-Full_Package.zip into the designated directory. The file package is a so-called compressed tarball. In Windows XP, this package can be directly extracted with the file explorer. In all other versions of Windows a separate extraction program is required, for example, the shareware program Filzip.
In Linux, use the following command from a shell:
$ tar -zxvf Joomla_1.5.0-Beta.tar.gz
After unpacking, the following directories and files will be seen in Windows Explorer:
This structure is the same on all operating systems; only the presentation differs. The following figure shows a presentation in an FTP client where the local PC is in the left window and the remote web server in the right one:
Joomla! Web Installer
From now on, everything is going to go lightning fast because the Joomla! web installer will be taking over command. Go to the URL http://localhost/Joomla150/.
Step 1: Choose Language
Choose Language is the first of seven installation steps. Select the desired language and click on the Next button.
Step 2: Pre-Installation Check
Next, you will see the Pre-Installation Check. This survey should help you determine whether your server environment is suited for a Joomla! installation.
A lot of green test results is a good sign. Depending on your configuration there can be differences here.
The web installer takes the configuration settings of the web server (in our case Apache), PHP, and the operating system into consideration. On Unix-based systems (Linux, Mac OS X) attention should be given to writing rights. This is in particular important for the configuration.php file. At the end of the installation, this file gets created with its individual values. If the installer does not have write rights, Joomla! cannot create this file and the installation will fail. If this happens, try to configure the rights appropriately and click on Check Again. If you are working with the XAMPP Lite solution under Windows, your screen will look like the previous screenshot.
Click on Next and you are in the licensing step.
Step 3: License
Every piece of software is licensed under certain conditions. Joomla! uses the GNU/GPL licence:
After you read this license click on Next.
Step 4: Database Configuration
In the fourth step, Database Configuration, your database parameters are queried. You can set up as many databases as required in an XAMPP Lite server environment and you have a MySQL user set up with the name root (without a password). The user root is the MySQL administrator and can do everything in the MySQL system. An installation without a password is a significant security risk. In the beginning, locally, in order to get the system up and running as quickly as possible, this is not a problem. But when you do the security check, you should absolutely provide your XAMPP Lite installation with passwords (http://localhost/security/).
Enter the following parameters in a local XAMPP Lite installation:
Host Name: localhost
User Name: root
Password: [leave this empty—but be aware of the security risk!!]
In the following figure you will see a button Get Privileges and another button Get Collations. After you click the first button, Joomla! checks whether the database user has the necessary rights and the second button establishes what UTF-8 support is possible with your database. This button only appears in version 4.1.x of MySQL and subsequent versions.
Now select a Database Name. An unlimited number of databases can be set up in a local XAMPP Lite environment since the user root has the right to do that. In an active environment with a provider, you presumably will have a set allocation of databases and the access data to the databases are usually predetermined. Here Joomla150 is the database name used.
|The best-selling Joomla! tutorial guide updated for the latest 1.5 release|
eBook Price: £16.99
Book Price: £27.99
By clicking the green triangle in front of Advanced Settings, you can activate additional options. You can select whether the tables of an existing Joomla! installation should be deleted or be provided with the prefix bak_.
The MySQL Table Prefix is very practical. The web installer writes the text that you enter into the respective field in front of every table that is created. The web installer recommends jos_ as the default
There is a simple reason for this. Sometimes you only get one MySQL database from an Internet provider. If you have to operate two Joomla! pages in this case, there would be a problem, since you cannot differentiate one table from the other. By means of a Table Name Prefix, it is possible to keep apart the tables of different Joomla! installations (jos_smith_ or jos_jones_). In this case you should accept the default jos_. This prefix is also used to mark secured data (bak_).
Step 5: FTP Configuration
In order to stop problems with access rights and a possibly activated PHP Safe Mode before they start, in Joomla! 1.5 you have the option of using FTP functions for uploading and handling of files. This is not necessary in the local XAMPP Lite installation. But if you install Joomla! on the virtual web server of a provider, enter the FTP data here that your provider has given to you.
In windows, FTP server is deactivated, but in Linux host it is activated.
Step 6: Configuration
This main step of the configuration is divided into three parts.
The first part of the configuration has to do with the name of your website. This name appears in the header of the browser window when someone accesses your website. This name is also used in other places, for example, with confirmation emails to registered users.
Select a meaningful name. For our example page, we have chosen the name Joomla! 1.5.0.
In the second part, you are asked to enter the administrator email address and the administrator password. A password is suggested in the left area; you can accept it or create your own—chose a similarly complicated one when installing on the Internet. You can use something simpler for a local installation. Best write the password on a piece of paper.
In the third part, you specify the data that your Joomla! installation is to contain.
- Install default sample data: The data is the most important part of your installation. Joomla! allows you to install sample data. You can get a feeling for the program that way and experiment without any worries.
- Load local Joomla! 1.5 SQL script: You may have created a local Joomla! website and now may want exactly this data in an online database. In this case you can specify the .sql file that holds your Joomla! data, which you have exported from the local version. Make sure that this file has the exact Joomla! 1.5 database schema and is UTF-8 coded. More about this topic is covered in the Appendix.
- Load Migration Script: This option ports a Joomla! 1.0.x installation into a Joomla! 1.5 version. You will find more about this conversion in the Appendix.
We will take a look at the first option, Install default sample data, during the course of the book.
Click on the Install default sample data button, and the installer will load the data into your database and change the display.
You should accept both suggested options with the file and directory rights. Joomla! automatically sets access rights for those parts of the system where files are uploaded and program parts are installed.
Now click on the Next button and your data are stored.
Step 7: Finish
The seventh and final step congratulates you on a successful installation—I congratulate you as well. There is a notice in bold text that prompts you to delete the installation directory. Take good heed of this notice, because your Joomla! website will not run if you don't delete the directory. You have installed your Joomla! and can now start to configure your website and enter content.
A file with the name configuration.php has been created in your document directory. If you need to repeat the installation you have to delete the configuration.php file before deleting the installation directory. The Joomla! Installer will then start again.
In addition, your login data will be displayed.
But make sure that Joomla! gives you a new password if you have go back from Step 7, for instance if you want to change a setting or if the installation did not work properly. If you have lost or forgotten the administrator password, there is a solution in the Appendix.
The installation is now complete and you have a choice between the buttons Site (to view your homepage) and Admin (administration interface).
To take a look at your newly created homepage, click on Site. If you haven't deleted the installation directory as of yet, you will get a friendly reminder to delete it and to check out your page after you've done that.
The result is pretty impressive. Look it over at your own pace, click on a few options and try to orient yourself. Lots of Joomla!'s functionalities are used on this homepage, which is loaded with sample data.
Further resources on this subject:
About the Author :
Hagen Graf was born in July 1964. Born and raised in Lower Saxony, Germany, his first contact with a computer was in the late seventies with a Radioshack TRS 80. As a salesperson, he organized his customers' data by programming suitable applications. This gave him a big advantage over other salesmen. With the intention of honing his skills, he joined evening courses in programming and became a programmer. Nowadays he works in his wife's consulting company as a trainer, consultant, and programmer (http://www.cocoate.com). Hagen Graf has published other books in German, about the Apache web server, about security problems in Windows XP, about Mambo, and about Drupal. Since 2001, he has been engaged in a nonprofit e-learning community called "machm-it.org e.V.", as well as in several national and international projects. All the projects are related to content management, community building, and harnessing the power of social software like wikis and weblogs. He chose Joomla! CMS because of its simplicity and easy-to-use administration. You can access and comment on his blog (http://www.bloghouse.org/en/hagen).
Books From Packt