Installing Joomla! as a local server

Off the Beat: Bruce Byfield's Blog

May 21, 2010 GMT
Bruce Byfield

Recently, I installed Joomla! as a local web server so I could develop a site for a friend. Almost at once, I ran into the problems that plagues most free software documentation. The problem is not a lack of information, but too much information, much of it obsolete, and little of it covering the most common situations on a modern desktop. Nor was most of it succinct.

In fact, the process was not difficult. What was difficult was finding the relevant information. In the hopes of saving other people a few hours, here's my summary of the process:

Installing the environment

Running Joomla! requires a local web server (typically Apache), PHP, and a database (usually MySQL).

A popular way to set up this environment is to download and install XAMPP, which contains all the necessary packages. XAMPP contains everything you will need for a local web server, but, as the web page warns, it is configured to be as open as possible for convenience, and should not be used except as a local web server. It is simply too vulnerable to use in a live site.

To use XAMPP, download the latest version and uncompress the files to /opt while logged in as the root user. You can start XAMPP by running /opt/lampp/lampp start. A series of messages gives the progress of its start.

If you receive messages that another web server and instance of MySQL is running, you will have to close these down when before using XAMPP. Halt XAMPP with /opt/lampp/lampp stop and enter the commands apachectl stop (assuming you are using Apache) followed by /etc/init.d/mysql stop before restarting XAMPP. Note that these commands may interfer with other applications that are using Apache and MySQL.

However, because of the package systems used by most GNU/Linux distributions, it is not actually that much harder to install the pieces of the Joomla! environment separately than to use XAMPP. The only catch is that, in addition to Apache, PHP, and MySQL, you also need to install libapache2-mod-php5 and php5-mysql (to give the Ubuntu/Debian names for the packages) as well.

Whether you are using XAMPP or separate components, you can test that they are running properly by opening a web browser and going to the site http://localhost. If the page displays, then installation has been successful.

Creating the database

Before you can install Joomla!, you need to create a MySQL database. According to the information you can find online, this should be a simple matter on a new installation, since all you need to do is to log in to MySQL as the root user, with the password "root."

Unfortunately, if you have KDE installed, you already have MySQL installed -- and the user created for KDE's purposes may not be root. To find the user you need to log in, you need to look in /etc/mysql at the configuration files stored there. In Ubuntu and Debian, the file debian.cnf will contain the user and password information.

Armed with this information, you can type the command mysql --user= [user] --password=[password]. For the password, copy and paste to minimize the chances of error. When the mysql prompt appears, you may want to enter the command SHOW DATABASE; to see what other databases you have running so you don't interfer with any.

Then enter the command create database [database name];. When you receive a message that reads something like Query OK, I row affected (0.01 sec), you have created the database successfully. The database is blank, and will be populated by Joomla! as you work. Type exit to leave MySQL and continue.

Installing Joomla!

Joomla! is not packaged by most distributions, so you need to download the zip file from the project site (http://www.joomla.org/download.html).

After you unzip the download, log in as root and move the resulting directory to the web server's root folder. If you are using XAMPP, the root folder is /opt/lampp/htdocs; if you are using a separate Apache web server, it is /var/www/. Either way, enter the command chown -R 777 [directorypath] to make it accessible, followed by mv [directorypath] [newname] to give it a unique name.

Some directions suggest that you install directly to the root directory, but that assumes that you will never have more than one site being developed at one time. Installing the unzipped Joomla! download to a sub-directory makes working with multiple sites possible, and also helps you to keep track of the project that you are working on.

Configuring Joomla!

You can tell whether you have installed correctly by entering in a web browser http://localhost/[sitename]. If installation is successful, you will see the first page of the Joomla! installation wizard -- and the start of the next part of the process.

The wizard is largely self-expanatory (as it should be). However, take special notice of the Pre-Installation check, which tells you what the settings should be, and what they actually are, dividing the settings into the ones you need if Joomla! is to work at all, and the ones that are not necessary but that you may want to edit at all. You are unlikely to have any problems, but, if any are indicated, correct them before continuing with configuration.

You should also pay attention to the database configuration. The host name will generally be localhost, the user name and password the ones you used to log in to MySQL. If you forget the name of the database you created to use with Joomla!, then you can enter MySQL and use the command SHOW DATABASE; to find it.

You can forget about the FTP configuration for now. The whole point of working on a local server is the convenience of ignoring such details. You will not be using FTP until the time comes to upload your site to a live server.

The last page of the wizard is Main Configuration. There, you enter a password for the admin user of the Joomla! site, and choose whether or not to install sample data to help you learn. The page also contains settings for migrating a site from older versions of Joomla!

Finally, open a terminal and remove the file INSTALL.php and the installation directory from the site's top level directory. Until you do, you will not be able to use Joomla!

Logging in to Joomla!

With these steps, you are ready to start working with your site. To login, type in a web browser http://localhost/[sitename]/administrator, and log in as the admin user, with the password you created while configuring the site.

Your first step should be to familiarize yourself with the Joomla! backend that appears when you log in with the admin account. Probably the first tools that you should browse is the Global Configuration. There, you can alter the time zone from the default of UTC, and alter anything set in the configuration wizard. You might also want to create some users that are more limited than admin so that you can experiment as you develop the site.

As you go deeper into Joomla!, you will have a new concept or two to learn, such as the relations between sections and categories and web pages. However, if you are momentarily baffled by how to do something, you can console yourself by the thought that Joomla! itself is relatively sane, and no problems are likely to cause you anything like the trouble that setting up Joomla! in the first place did.

Comments

  • Thanks

    Well, I have had similar problems when I tried to use Joomla as a local web server for the purpose of building a site. There were many problems <a href="http://portablegeneratorreviews.net">generator reviews</a> I had to overcome and the initial setup of Apache, PHP and MySQL itself was a major hurdle to pass. One of the many problems Joomla users complain about is the availability of too many options, as you said which often leads us confused as to what to do with it.
  • Tanks

    Thank you. Running Joomla in Windows was not difficult, but Linux it was a bit more complicated. This post helped me a lot. Although i encountered problems with error messages, but this post helped: http://forum.joomla.org/viewtopic.php?p=2560741. I'm running linux mint 10.

    Thanks a lot
  • I have always found Joomla to be overly

    I have always found Joomla to be overly complicated, particularly when it came to database set-up. This is why I have continued to use the simpler CMS products like WordPress. However your article was very helpful in clearing up a number of my beta-testing concerns, so maybe it's time to give Joomla another go.
    Paul - http://www.connetu.com
  • I have always found Joomla to be overly

    I have always found Joomla to be overly complicated, particularly when it came to database set-up. This is why I have continued to use the simpler CMS products like WordPress. However your article was very helpful in clearing up a number of my beta-testing concerns, so maybe it's time to give Joomla another go.
  • Well, I have had

    Well, I have had similar problems when I tried to use Joomla as a local web server for the purpose of building a site. There were many problems I had to overcome and the initial setup of Apache, PHP and MySQL itself was a major hurdle to pass. One of the many problems Joomla users complain about is the availability of too many options, as you said which often leads us confused as to what to do with it.

    http://www.shredmonkey.net/
  • Joomla! Ubuntu Documentation

    Bruce -

    Thanks for this reminder of the importance of keeping documentation current and organized and relevant. I put a call out to our developer community and there were four people who stepped up to help provide improved documentation. So, I am hopeful that we can get this situation under control before the 1.6 release, and then someone will be asking you for your input, to see if we hit the mark!

    http://www.alltogetherasawh...blogs/joomla-ubuntu-super-hero

    Thanks so much for helping your friend get started with J! and do not hesitate to contact us when you have questions or want to share feedback.

    Big fan of your work for some time.

    Amy happy

    http://AllTogetherAsAWhole.org - J! devs and site builders network

  • Not so common common sense

    Awesome. So much of the information out there has noise and as you say fails to state the most obvious points. Excellent work, man.
  • Related discussion on Joomla support forum

    FYI - I went through much the same process last year and posted a list of questions on the Joomla support forums,
    http://forum.joomla.org/viewtopic.php?p=1638275

    In response I got 'lectured' about how umask works, grrr, before I finally found a succinct how-to ... on the Ubuntu support site!
    https://help.ubuntu.com/com...la#Configure%20Access%20Rights
comments powered by Disqus

Issue 163/2014

Buy this issue as a PDF

Digital Issue: Price $9.99
(incl. VAT)

News