Difference between revisions of "Installing Joomla on Debian Linux"

From Joomla! Documentation

m
Line 1: Line 1:
 
== Preface ==
 
== Preface ==
  
This document guides you through the manual installation of Joomla! on '''Debian GNU Linux''' or one of its derivatives such as '''Ubuntu''', '''Knoppix''' or '''GRML'''. Note that this guide applies to Joomla! version 1.5.x, and should be considered as experimental. It has been successfully tested on Debian 4.0 [Etch], Debian 5.0 [Lenny] and Ubuntu 8.04 LTS [Hardy Heron]. It will work for all '''Debian''' based Linux distribution as well.
+
This document guides you through the manual installation of Joomla! on '''Debian GNU Linux''' or one of its derivatives such as '''Ubuntu''', '''Knoppix''' or '''GRML'''. Note that this guide applies to Joomla! version 1.5.x, and should be considered experimental. It has been successfully tested on Debian 4.0 [Etch], Debian 5.0 [Lenny] and Ubuntu 8.04 LTS [Hardy Heron]. It will work for all '''Debian''' based Linux distribution as well.
  
 
Also note that this guide assumes, you're installing Joomla! in a '''single hosting''' environment, running PHP as module. If you want to run multiple web sites as a web hosting service provider, for security reasons you should consider setting up an suPHP (php5-cgi, libapache2-mod-suphp) environment, where every virtual apache host runs under its own UID.
 
Also note that this guide assumes, you're installing Joomla! in a '''single hosting''' environment, running PHP as module. If you want to run multiple web sites as a web hosting service provider, for security reasons you should consider setting up an suPHP (php5-cgi, libapache2-mod-suphp) environment, where every virtual apache host runs under its own UID.

Revision as of 20:19, 26 March 2009

Preface[edit]

This document guides you through the manual installation of Joomla! on Debian GNU Linux or one of its derivatives such as Ubuntu, Knoppix or GRML. Note that this guide applies to Joomla! version 1.5.x, and should be considered experimental. It has been successfully tested on Debian 4.0 [Etch], Debian 5.0 [Lenny] and Ubuntu 8.04 LTS [Hardy Heron]. It will work for all Debian based Linux distribution as well.

Also note that this guide assumes, you're installing Joomla! in a single hosting environment, running PHP as module. If you want to run multiple web sites as a web hosting service provider, for security reasons you should consider setting up an suPHP (php5-cgi, libapache2-mod-suphp) environment, where every virtual apache host runs under its own UID.

Installing Joomla![edit]

Prerequisites[edit]

You will need to install apache2, mysql-server-5.0, mysql-client-5.0 and php5 in order to have a web-server for Joomla!. You will find instructions on wiki.debian.org. Make sure that you have installed bzip2 for extracting the downloaded Joomla! package.

You can check this by the following command:

$ dpkg -l  | awk '/^ii bzip2/ {print $1" "$2}'
ii bzip2

Note that the dollar sign '$' shell prompt is indicating you're a regular user. We will later see a hash mark (#) shell prompt, which indicates that you're the super user root after issuing an su or sudo. The first policy for a secure linux system administration on the command line (but under X also) is to issue commands with the lowest permission as possible.

If bzip2 is not installed, you won't get an output. Then you can quickly install it via aptitude:

$ su -c "aptitude install bzip2"

Here we see the first command executed with toot permissions, because a regular user is not allowed to install new software. The '-c' option passes the following command to su and hereafter it terminates instead of switching to a root shell.

Configure MySQL[edit]

It is time to create a database for Joomla! You can do this by the following commmands:

$ mysqladmin -u root -p create joomla

You may replace joomla with the name of choice for Joomla!'s database.

Now create a MySQL user different from root for Joomla!'s database

$ mysql -u root -p
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES \
    -> ON joomla.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';

Make sure you replace joomla with the name of Joomla!'s database from above. Replace yourusername with the user name you choose for the MySQL user accessing Joomla!'s database, and replace yourpassword with your password of choice for the MySQL user.

Activate the settings and quit :

mysql> FLUSH PRIVILEGES;
mysql> \q

After disconnecting from the database server, you should remove the login information of your just new created MySQL user by editing MySQL's history file.

$ vi ~/.mysql_history

You can use any editor of your choice such as nano, vi or emacs that is installed on your system.

Get Joomla! source[edit]

Now it is time to download the Joomla! sources. Currently you will find download links on the joomlacode.org download page. For version 1.5.9, you may do the following from command line, assuming your current working directory is your home folder /home/user:

$ wget http://joomlacode.org/gf/download/frsrelease/9294/34964/Joomla_1.5.9-Stable-Full_Package.tar.bz2
$ cd /var/www
$ su
# mkdir -m 0755 joomla
# cd joomla
# tar -xvjf /home/user/Joomla_1.5.9-Stable-Full_Package.tar.bz2

Here is the first time we this hash mark (#) shell prompt. We call su without any options, because we want to issue root commands more than only one time. Calling su that way will prompt us for the super user's password and then change the actual shell environment, repectively $UID and $EUID.

Set ownerships and permissions[edit]

If you want to allow writing in the entire joomla folder, simply do

# chown -R www-data:www-data /var/www/joomla

If you want a more restrictive approach, do this instead:

# chown -R root:root /var/www/joomla
# cd /var/www/joomla
# PLACES='
# administrator/backups
# administrator/components
# administrator/modules
# administrator/templates
# cache
# components
# images
# images/banners
# images/stories
# language
# mambots
# mambots/content
# mambots/editors
# mambots/editors-xtd
# mambots/search
# media
# modules
# templates
# '
# for i in $PLACES; do chown -R www-data:www-data $i; done

Now set file and directory permissions:

# find /var/www/joomla -type f -exec chmod 0644 {} \;
# find /var/www/joomla -type d -exec chmod 0755 {} \;

Configuration of Joomla![edit]

Open your favourite web-browser, and point it to the page http://localhost/joomla. Replace localhost with your servers IP or domain name if it you are installing on a remote system.

You will be guided through the final steps of setting up Joomla!, have your MySQL user, password and database name available.

When you reach the final screen with congratulations on installing Joomla!, you should remove the installation directory. From root terminal:

# rm -rf /var/www/joomla/installation/
# exit
$

And that's it! Now you can login into the admin interface of your fresh installed Joomla! 1.5.9.