<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
<!-- $Id: installation.xml,v 1.142 2007/08/09 12:36:08 lpsolit%gmail.com Exp $ -->
<chapter id="installing-bugzilla">
<title>Installing Bugzilla</title>
<section id="installation">
<title>Installation</title>
<note>
<para>If you just want to <emphasis>use</emphasis> Bugzilla,
you do not need to install it. None of this chapter is relevant to
you. Ask your Bugzilla administrator for the URL to access it from
your web browser.
</para>
</note>
<para>The Bugzilla server software is usually installed on Linux or
Solaris.
If you are installing on another OS, check <xref linkend="os-specific"/>
before you start your installation to see if there are any special
instructions.
</para>
<para>
As an alternative to following these instructions, you may wish to
try Arne Schirmacher's unofficial and unsupported
<ulink url="http://www.softwaretesting.de/article/view/33/1/8/">Bugzilla
Installer</ulink>, which installs Bugzilla and all its prerequisites
on Linux or Solaris systems.
</para>
<para>This guide assumes that you have administrative access to the
Bugzilla machine. It not possible to
install and run Bugzilla itself without administrative access except
in the very unlikely event that every single prerequisite is
already installed.
</para>
<warning>
<para>The installation process may make your machine insecure for
short periods of time. Make sure there is a firewall between you
and the Internet.
</para>
</warning>
<para>
You are strongly recommended to make a backup of your system
before installing Bugzilla (and at regular intervals thereafter :-).
</para>
<para>In outline, the installation proceeds as follows:
</para>
<procedure>
<step>
<para><link linkend="install-perl">Install Perl</link>
(&min-perl-ver; or above)
</para>
</step>
<step>
<para><link linkend="install-database">Install a Database Engine</link>
</para>
</step>
<step>
<para><link linkend="install-webserver">Install a Webserver</link>
</para>
</step>
<step>
<para><link linkend="install-bzfiles">Install Bugzilla</link>
</para>
</step>
<step>
<para><link linkend="install-perlmodules">Install Perl modules</link>
</para>
</step>
<step>
<para>
<link linkend="install-MTA">Install a Mail Transfer Agent</link>
(Sendmail 8.7 or above, or an MTA that is Sendmail-compatible with at least this version)
</para>
</step>
<step>
<para>Configure all of the above.
</para>
</step>
</procedure>
<section id="install-perl">
<title>Perl</title>
<para>Installed Version Test: <filename>perl -v</filename></para>
<para>Any machine that doesn't have Perl on it is a sad machine indeed.
If you don't have it and your OS doesn't provide official packages,
visit <ulink url="http://www.perl.com"/>.
Although Bugzilla runs with Perl &min-perl-ver;,
it's a good idea to be using the latest stable version.
</para>
</section>
<section id="install-database">
<title>Database Engine</title>
<para>From Bugzilla 2.20, support is included for using both the MySQL and
PostgreSQL database servers. You only require one of these systems to make
use of Bugzilla.</para>
<section id="install-mysql">
<title>MySQL</title>
<para>Installed Version Test: <filename>mysql -V</filename></para>
<para>
If you don't have it and your OS doesn't provide official packages,
visit <ulink url="http://www.mysql.com"/>. You need MySQL version
&min-mysql-ver; or higher.
</para>
<note>
<para> Many of the binary
versions of MySQL store their data files in
<filename class="directory">/var</filename>.
On some Unix systems, this is part of a smaller root partition,
and may not have room for your bug database. To change the data
directory, you have to build MySQL from source yourself, and
set it as an option to <filename>configure</filename>.</para>
</note>
<para>If you install from something other than a packaging/installation
system, such as .rpm (Redhat Package), .deb (Debian Package), .exe
(Windows Executable), or .msi (Microsoft Installer), make sure the MySQL
server is started when the machine boots.
</para>
</section>
<section id="install-pg">
<title>PostgreSQL</title>
<para>Installed Version Test: <filename>psql -V</filename></para>
<para>
If you don't have it and your OS doesn't provide official packages,
visit <ulink url="http://www.postgresql.org/"/>. You need PostgreSQL
version &min-pg-ver; or higher.
</para>
<para>If you install from something other than a packaging/installation
system, such as .rpm (Redhat Package), .deb (Debian Package), .exe
(Windows Executable), or .msi (Microsoft Installer), make sure the
PostgreSQL server is started when the machine boots.
</para>
</section>
</section>
<section id="install-webserver">
<title>Web Server</title>
<para>Installed Version Test: view the default welcome page at
http://<your-machine>/</para>
<para>You have freedom of choice here, pretty much any web server that
is capable of running <glossterm linkend="gloss-cgi">CGI</glossterm>
scripts will work.
However, we strongly recommend using the Apache web server
(either 1.3.x or 2.x), and
the installation instructions usually assume you are
using it. If you have got Bugzilla working using another web server,
please share your experiences with us by filing a bug in &bzg-bugs;.
</para>
<para>
If you don't have Apache and your OS doesn't provide official packages,
visit <ulink url="http://httpd.apache.org/"/>.
</para>
</section>
<section id="install-bzfiles">
<title>Bugzilla</title>
<para>
Download a Bugzilla tarball (or check it out from CVS) and place
it in a suitable directory, accessible by the default web server user
(probably <quote>apache</quote> or <quote>www</quote>).
Good locations are either directly in the web server's document directories or
in <filename>/usr/local</filename> with a symbolic link to the web server's
document directories or an alias in the web server's configuration.
</para>
<caution>
<para>The default Bugzilla distribution is NOT designed to be placed
in a <filename class="directory">cgi-bin</filename> directory. This
includes any directory which is configured using the
<option>ScriptAlias</option> directive of Apache.
</para>
</caution>
<para>Once all the files are in a web accessible directory, make that
directory writable by your web server's user. This is a temporary step
until you run the
<filename>checksetup.pl</filename>
script, which locks down your installation.</para>
</section>
<section id="install-perlmodules">
<title>Perl Modules</title>
<para>Bugzilla's installation process is based
on a script called <filename>checksetup.pl</filename>.
The first thing it checks is whether you have appropriate
versions of all the required
Perl modules. The aim of this section is to pass this check.
When it passes, proceed to <xref linkend="configuration"/>.
</para>
<para>
At this point, you need to <filename>su</filename> to root. You should
remain as root until the end of the install. To check you have the
required modules, run:
</para>
<screen><prompt>bash#</prompt> ./checksetup.pl --check-modules</screen>
<para>
<filename>checksetup.pl</filename> will print out a list of the
required and optional Perl modules, together with the versions
(if any) installed on your machine.
The list of required modules is reasonably long; however, you
may already have several of them installed.
</para>
<para>
There is a meta-module called Bundle::Bugzilla,
which installs all the other
modules with a single command. You should use this if you are running
Perl 5.6.1 or above.
</para>
<para>
The preferred way of installing Perl modules is via CPAN on Unix,
or PPM on Windows (see <xref linkend="win32-perl-modules"/>). These
instructions assume you are using CPAN; if for some reason you need
to install the Perl modules manually, see
<xref linkend="install-perlmodules-manual"/>.
</para>
<screen><prompt>bash#</prompt> perl -MCPAN -e 'install "<modulename>"'</screen>
<para>
If you using Bundle::Bugzilla, invoke the magic CPAN command on it.
Otherwise, you need to work down the
list of modules that <filename>checksetup.pl</filename> says are
required, in the order given, invoking the command on each.
</para>
<tip>
<para>Many people complain that Perl modules will not install for
them. Most times, the error messages complain that they are missing a
file in
<quote>@INC</quote>.
Virtually every time, this error is due to permissions being set too
restrictively for you to compile Perl modules or not having the
necessary Perl development libraries installed on your system.
Consult your local UNIX systems administrator for help solving these
permissions issues; if you
<emphasis>are</emphasis>
the local UNIX sysadmin, please consult the newsgroup/mailing list
for further assistance or hire someone to help you out.</para>
</tip>
<note>
<para>If you are using a package-based system, and attempting to install the
Perl modules from CPAN, you may need to install the "development" packages for
MySQL and GD before attempting to install the related Perl modules. The names of
these packages will vary depending on the specific distribution you are using,
but are often called <filename><packagename>-devel</filename>.</para>
</note>
<para>
Here is a complete list of modules and their minimum versions.
Some modules have special installation notes, which follow.
</para>
<para>Required Perl modules:
<orderedlist>
<listitem>
<para>
CGI &min-cgi-ver; or CGI &min-mp-cgi-ver; if using mod_perl
</para>
</listitem>
<listitem>
<para>
Date::Format (&min-date-format-ver;)
</para>
</listitem>
<listitem>
<para>
DBI (&min-dbi-ver;)
</para>
</listitem>
<listitem>
<para>
<link linkend="install-modules-dbd-mysql">DBD::mysql</link>
(&min-dbd-mysql-ver;) if using MySQL
</para>
</listitem>
<listitem>
<para>
DBD::Pg (&min-dbd-pg-ver;) if using PostgreSQL
</para>
</listitem>
<listitem>
<para>
File::Spec (&min-file-spec-ver;)
</para>
</listitem>
<listitem>
<para>
<link linkend="install-modules-template">Template</link>
(&min-template-ver;)
</para>
</listitem>
<listitem>
<para>
Email::Send (&min-email-send-ver;)
|