installation.xml 97.5 KB
Newer Older
1
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
2
<!-- $Id: installation.xml,v 1.172 2009/10/24 05:53:12 mkanat%bugzilla.org Exp $ -->
3 4 5 6 7 8 9 10 11
<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
12 13
      you. Ask your Bugzilla administrator for the URL to access it from
      your web browser.
14 15 16 17 18 19 20 21 22
      </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>
23

24 25 26 27 28 29
    <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>
30

31 32 33 34
    <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.
35
      </para>
36
    </warning>
37

38 39 40 41 42 43 44 45 46 47 48
    <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>
49
        (&min-perl-ver; or above)
50 51 52
        </para>
      </step>
      <step>
53
        <para><link linkend="install-database">Install a Database Engine</link>
54 55 56 57 58 59 60 61 62 63 64 65 66 67
        </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>
68
      <step>
69 70 71
        <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)
72 73
        </para>
      </step>
74 75 76 77 78
      <step>
        <para>Configure all of the above.
        </para>
      </step>
    </procedure>
79

80 81 82
    <section id="install-perl">
      <title>Perl</title>

83
      <para>Installed Version Test: <programlisting>perl -v</programlisting></para>
84
      
85
      <para>Any machine that doesn't have Perl on it is a sad machine indeed.
86 87 88
      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;,
89
      it's a good idea to be using the latest stable version.
90
      </para>
91 92
    </section>

93 94 95
    <section id="install-database">
      <title>Database Engine</title>
      
96 97 98 99
      <para>
        Bugzilla supports MySQL, PostgreSQL and Oracle as database servers.
        You only require one of these systems to make use of Bugzilla.
      </para>
100

101 102
      <section id="install-mysql">
          <title>MySQL</title>
103
          <para>Installed Version Test: <programlisting>mysql -V</programlisting></para>
104
      
105 106 107 108 109
          <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>
110
      
111 112 113 114 115 116 117 118 119
          <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> 
120
           
121 122 123 124 125 126 127 128 129
          <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>
130
          <para>Installed Version Test: <programlisting>psql -V</programlisting></para>
131 132 133 134 135 136 137 138 139 140 141 142 143
      
          <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>
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

      <section id="install-oracle">
        <title>Oracle</title>
        <para>
          Installed Version Test: <programlisting>select * from v$version</programlisting>
          (you first have to log in into your DB)
        </para>

        <para>
          If you don't have it and your OS doesn't provide official packages,
          visit <ulink url="http://www.oracle.com/"/>. You need Oracle
          version &min-oracle-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
          Oracle server is started when the machine boots.
        </para>
      </section>
165
    </section>
166
    
167
    <section id="install-webserver">
168
      <title>Web Server</title>
169

170 171 172
      <para>Installed Version Test: view the default welcome page at
      http://&lt;your-machine&gt;/</para>
      
173 174
      <para>You have freedom of choice here, pretty much any web server that
      is capable of running <glossterm linkend="gloss-cgi">CGI</glossterm>
175 176 177 178
      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
179
        using it. If you have got Bugzilla working using another web server,
180
        please share your experiences with us by filing a bug in &bzg-bugs;.
181 182 183 184 185 186
      </para>
      
      <para>
      If you don't have Apache and your OS doesn't provide official packages, 
      visit <ulink url="http://httpd.apache.org/"/>.
      </para>
187 188 189 190 191 192

    </section>

    <section id="install-bzfiles">
      <title>Bugzilla</title>

193
      <para>
194 195
        <ulink url="http://www.bugzilla.org/download/">Download a Bugzilla tarball</ulink>
        (or check it out from CVS) and place
196 197
        it in a suitable directory, accessible by the default web server user 
        (probably <quote>apache</quote> or <quote>www</quote>). 
198 199 200
        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.
201
      </para>
202 203

      <caution>
204
        <para>The default Bugzilla distribution is NOT designed to be placed
205
        in a <filename class="directory">cgi-bin</filename> directory. This
206
        includes any directory which is configured using the
207
        <option>ScriptAlias</option> directive of Apache.
208 209
        </para>
      </caution>
gerv%gerv.net's avatar
gerv%gerv.net committed
210 211
      
      <para>Once all the files are in a web accessible directory, make that
212
      directory writable by your web server's user. This is a temporary step
213
      until you run the 
gerv%gerv.net's avatar
gerv%gerv.net committed
214 215 216 217
      <filename>checksetup.pl</filename>
      script, which locks down your installation.</para>
    </section>

218 219 220 221 222 223 224 225
    <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. 
226
      When it passes, proceed to <xref linkend="configuration"/>.
gerv%gerv.net's avatar
gerv%gerv.net committed
227 228 229
      </para>
      
      <para>
230
      At this point, you need to <filename>su</filename> to root. You should
231 232
      remain as root until the end of the install. To check you have the
      required modules, run:
gerv%gerv.net's avatar
gerv%gerv.net committed
233 234
      </para>
      
235
      <screen><prompt>bash#</prompt> ./checksetup.pl --check-modules</screen>
236 237 238 239 240 241 242
 
      <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.
gerv%gerv.net's avatar
gerv%gerv.net committed
243
      </para>
244
      
245
      <para>
246 247 248 249 250
        The preferred way of installing Perl modules is to use the
        <filename>install-module.pl</filename> script on Unix,
        or PPM on Windows (see <xref linkend="win32-perl-modules"/>). If for
        some reason you need to install the Perl modules manually, see
        <xref linkend="install-perlmodules-manual"/>. For instance, on Unix:
251 252
      </para>  
        
253
      <screen><prompt>bash#</prompt> perl install-module.pl &lt;modulename&gt;</screen>
254 255 256 257 258

      <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 
259
        <quote>@INC</quote>.
260 261 262 263 264 265 266 267 268
        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>
269

270 271 272 273 274 275 276 277
      <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>&lt;packagename&gt;-devel</filename>.</para>
      </note>
 
278 279 280 281
      <para>
        Here is a complete list of modules and their minimum versions.
        Some modules have special installation notes, which follow.
      </para>
282

283
      <para>Required Perl modules:
284
      <orderedlist>
285

286 287
        <listitem>
          <para>
288
            CGI &min-cgi-ver;
289 290
          </para>
        </listitem>
291

292 293 294
        <listitem>
          <para>
            Date::Format (&min-date-format-ver;)
295 296 297 298 299
          </para>
        </listitem>
    
        <listitem>
          <para>
300
            DBI (&min-dbi-ver;)
301 302
          </para>
        </listitem>
303

304 305 306
        <listitem>
          <para>
            <link linkend="install-modules-dbd-mysql">DBD::mysql</link>
307 308 309 310 311 312 313
            (&min-dbd-mysql-ver;) if using MySQL
          </para>
        </listitem>
        
        <listitem>
          <para>
            DBD::Pg (&min-dbd-pg-ver;) if using PostgreSQL
314 315
          </para>
        </listitem>
316

317 318 319 320 321 322
        <listitem>
          <para>
            DBD::Oracle (&min-dbd-oracle-ver;) if using Oracle
          </para>
        </listitem>

323 324
        <listitem>
          <para>
325
            <link linkend="install-modules-template">Template</link>
326 327 328
            (&min-template-ver;)
          </para>
        </listitem>
329

330 331
        <listitem>
          <para>
332 333 334 335 336 337 338
            Email::Send (&min-email-send-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            Email::MIME::Modifier (&min-email-mime-modifier-ver;)
339 340
          </para>
        </listitem>
341
      </orderedlist>
342

343
      Optional Perl modules:
344
      <orderedlist>
345 346
        <listitem>
          <para>
347 348
            <link linkend="install-modules-gd">GD</link>
            (&min-gd-ver;) for bug charting
349 350
          </para>
        </listitem>
351

352 353 354 355 356 357 358
        <listitem>
          <para>
            Template::Plugin::GD::Image
            (&min-gd-ver;) for Graphical Reports
          </para>
        </listitem>

359 360
        <listitem>
          <para>
361 362
            <link linkend="install-modules-chart-lines">Chart::Lines</link>
            (&min-chart-lines-ver;) for bug charting
363 364
          </para>
        </listitem>
365

366 367 368 369 370 371
        <listitem>
          <para>
            <link linkend="install-modules-gd-graph">GD::Graph</link>
            (&min-gd-graph-ver;) for bug charting
          </para>
        </listitem>
372

373 374
        <listitem>
          <para>
375 376
            <link linkend="install-modules-gd-text">GD::Text</link>
            (&min-gd-text-ver;) for bug charting
377 378
          </para>
        </listitem>
379

380 381
        <listitem>
          <para>
382
            <link linkend="install-modules-xml-twig">XML::Twig</link>
383 384 385 386 387 388 389
            (&min-xml-twig-ver;) for bug import/export
          </para>
        </listitem>

        <listitem>
          <para>
            MIME::Parser (&min-mime-parser-ver;) for bug import/export
390 391
          </para>
        </listitem>
392

393 394
        <listitem>
          <para>
395 396
            LWP::UserAgent
            (&min-lwp-useragent-ver;) for Automatic Update Notifications
397 398 399
          </para>
        </listitem>

400 401 402 403 404 405
        <listitem>
          <para>
            <link linkend="install-modules-patchreader">PatchReader</link>
            (&min-patchreader-ver;) for pretty HTML view of patches
          </para>
        </listitem>
406

407 408 409 410 411 412 413
        <listitem>
          <para>
            Net::LDAP
            (&min-net-ldap-ver;) for LDAP Authentication
          </para>
        </listitem>

414 415 416 417 418 419 420
        <listitem>
          <para>
            Authen::Radius
            (&min-authen-radius-ver;) for RADIUS Authentication
          </para>
        </listitem>

421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
        <listitem>
          <para>
            <link linkend="install-modules-soap-lite">SOAP::Lite</link>
            (&min-soap-lite-ver;) for the web service interface
          </para>
        </listitem>

        <listitem>
          <para>
            HTML::Parser
            (&min-html-parser-ver;) for More HTML in Product/Group Descriptions
          </para>
        </listitem>

        <listitem>
          <para>
            HTML::Scrubber
            (&min-html-scrubber-ver;) for More HTML in Product/Group Descriptions
          </para>
        </listitem>

        <listitem>
          <para>
            Email::MIME::Attachment::Stripper
            (&min-email-mime-attachment-stripper-ver;) for Inbound Email
          </para>
        </listitem>

        <listitem>
          <para>
            Email::Reply
            (&min-email-reply-ver;) for Inbound Email
          </para>
        </listitem>

        <listitem>
          <para>
            mod_perl2
            (&min-mod_perl2-ver;) for mod_perl
          </para>
        </listitem>
      </orderedlist>
463
      </para>
464

465 466
      <section id="install-modules-dbd-mysql">
        <title>DBD::mysql</title>
467

468 469 470 471 472 473 474
        <para>The installation process will ask you a few questions about the
        desired compilation target and your MySQL installation. For most of the
        questions the provided default will be adequate, but when asked if your
        desired target is the MySQL or mSQL packages, you should
        select the MySQL-related ones. Later you will be asked if you wish to
        provide backwards compatibility with the older MySQL packages; you
        should answer YES to this question. The default is NO.</para>
475

476 477 478 479 480
        <para>A host of 'localhost' should be fine. A testing user of 'test',
        with a null password, should have sufficient access to run
        tests on the 'test' database which MySQL creates upon installation.
        </para>
      </section>
481

482 483
      <section id="install-modules-template">
        <title>Template Toolkit (&min-template-ver;)</title>
484

485 486 487 488 489 490
        <para>When you install Template Toolkit, you'll get asked various
        questions about features to enable. The defaults are fine, except
        that it is recommended you use the high speed XS Stash of the Template
        Toolkit, in order to achieve best performance.
        </para>
      </section> 
491

492 493
      <section id="install-modules-gd">
        <title>GD (&min-gd-ver;)</title>
494

495 496
        <para>The GD module is only required if you want graphical reports.
        </para>
497

498 499 500 501 502 503 504 505 506 507
        <note>
          <para>The Perl GD module requires some other libraries that may or
          may not be installed on your system, including 
          <classname>libpng</classname>
          and 
          <classname>libgd</classname>. 
          The full requirements are listed in the Perl GD module README.
          If compiling GD fails, it's probably because you're
          missing a required library.</para>
        </note>
508

509 510 511 512 513 514 515 516
        <tip>
          <para>The version of the GD module you need is very closely tied
          to the <classname>libgd</classname> version installed on your system.
          If you have a version 1.x of <classname>libgd</classname> the 2.x
          versions of the GD module won't work for you.
         </para>
       </tip>
      </section>
517

518 519
      <section id="install-modules-chart-lines">
        <title>Chart::Lines (&min-chart-lines-ver;)</title>
520

521
        <para>The Chart::Lines module is only required if you want graphical 
522 523 524 525
        reports. 
        Note that earlier versions that 0.99c used GIFs, which are no longer
        supported by the latest versions of GD.</para>
      </section>
526

527 528
      <section id="install-modules-gd-graph">
        <title>GD::Graph (&min-gd-graph-ver;)</title>
529

530 531 532 533
        <para>The GD::Graph module is only required if you want graphical 
        reports.
        </para>
      </section>
534

535 536
      <section id="install-modules-gd-text">
        <title>GD::Text (&min-gd-text-ver;)</title>
537

538
        <para>The GD::Text module is only required if you want graphical 
539 540 541
        reports.
        </para>
      </section>
542

543 544
      <section id="install-modules-xml-twig">
        <title>XML::Twig (&min-xml-twig-ver;)</title>
545

546
        <para>The XML::Twig module is only required if you want to import
547 548 549 550 551
        XML bugs using the <filename>importxml.pl</filename>
        script. This is required to use Bugzilla's "move bugs" feature;
        you may also want to use it for migrating from another bug database.
        </para>
      </section>
552

553
      <section id="install-modules-soap-lite">
554 555 556 557 558 559 560
        <title>SOAP::Lite (&min-soap-lite-ver;)</title>
        <para>Installing SOAP::Lite enables your Bugzilla installation to be
        accessible at a standardized Web Service interface (SOAP/XML-RPC)
        by third-party applications via HTTP(S).
        </para>
      </section>

561 562
      <section id="install-modules-patchreader">
        <title>PatchReader (&min-patchreader-ver;)</title>
563

564
        <para>The PatchReader module is only required if you want to use
565 566
        Patch Viewer, a
        Bugzilla feature to show code patches in your web browser in a more
567
        readable form.
568 569
        </para>
      </section>
570
    </section>
571 572 573
    <section id="install-MTA">
      <title>Mail Transfer Agent (MTA)</title>
    
574 575 576 577 578 579 580 581 582 583 584 585
      <para>
        Bugzilla is dependent on the availability of an e-mail system for its 
        user authentication and for other tasks.
      </para>

      <note>
        <para>
          This is not entirely true.  It is possible to completely disable 
          email sending, or to have Bugzilla store email messages in a 
          file instead of sending them.  However, this is mainly intended 
          for testing, as disabling or diverting email on a production 
          machine would mean that users could miss important events (such 
586
          as bug changes or the creation of new accounts).
587 588 589
        </para>

        <para>
590 591
          For more information, see the <quote>mail_delivery_method</quote> parameter
          in <xref linkend="parameters" />.
592 593
        </para>
      </note>
594
    
595 596 597 598 599 600 601 602
      <para>
        On Linux, any Sendmail-compatible MTA (Mail Transfer Agent) will 
        suffice.  Sendmail, Postfix, qmail and Exim are examples of common 
        MTAs. Sendmail is the original Unix MTA, but the others are easier to 
        configure, and therefore many people replace Sendmail with Postfix or 
        Exim. They are drop-in replacements, so Bugzilla will not 
        distinguish between them.
      </para>
603

604 605
      <para>
        If you are using Sendmail, version 8.7 or higher is required.
606 607
        If you are using a Sendmail-compatible MTA, it must be congruent with 
        at least version 8.7 of Sendmail.
608 609
      </para>

610 611 612 613 614 615 616 617 618 619 620 621 622
      <para>
        Consult the manual for the specific MTA you choose for detailed 
        installation instructions. Each of these programs will have their own 
        configuration files where you must configure certain parameters to 
        ensure that the mail is delivered properly. They are implemented 
        as services, and you should ensure that the MTA is in the auto-start 
        list of services for the machine.
      </para>

      <para>
        If a simple mail sent with the command-line 'mail' program 
        succeeds, then Bugzilla should also be fine.
      </para>
623 624

    </section>  
625 626 627 628 629 630 631 632
    <section id="using-mod_perl-with-bugzilla">
      <title>Installing Bugzilla on mod_perl</title>
      <para>It is now possible to run the Bugzilla software under <literal>mod_perl</literal> on
      Apache. <literal>mod_perl</literal> has some additional requirements to that of running
      Bugzilla under <literal>mod_cgi</literal> (the standard and previous way).</para>
      
      <para>Bugzilla requires <literal>mod_perl</literal> to be installed, which can be
      obtained from <ulink url="http://perl.apache.org"/> - Bugzilla requires
633
      version &min-mod_perl2-ver; (AKA 2.0.0-RC5) to be installed.</para>
634
    </section>
635 636 637 638
  </section>
  
  <section id="configuration">
    <title>Configuration</title>
639

640
    <warning>
641 642 643 644 645 646 647
      <para>
        Poorly-configured MySQL and Bugzilla installations have
        given attackers full access to systems in the past. Please take the
        security parts of these guidelines seriously, even for Bugzilla 
        machines hidden away behind your firewall. Be certain to read
        <xref linkend="security"/> for some important security tips.
      </para>      
648
    </warning>
649

650 651 652 653
    <section id="localconfig">
      <title>localconfig</title>
      
      <para>
654 655 656 657 658 659 660 661 662
        You should now run <filename>checksetup.pl</filename> again, this time
        without the <literal>--check-modules</literal> switch.
      </para>
      <screen><prompt>bash#</prompt> ./checksetup.pl</screen>
      <para>
        This time, <filename>checksetup.pl</filename> should tell you that all
        the correct modules are installed and will display a message about, and
        write out a  file called, <filename>localconfig</filename>. This file
        contains the default settings for a number of Bugzilla parameters.
663
      </para>
664
      
665
      <para>
666 667 668
        Load this file in your editor. The only two values you
        <emphasis>need</emphasis> to change are $db_driver and $db_pass,
        respectively the type of the database and the password for
669 670
        the user you will create for your database. Pick a strong
        password (for simplicity, it should not contain single quote
671 672
        characters) and put it here. $db_driver can be either 'mysql',
        'Pg' or 'oracle'.
673
      </para>
674

675 676 677 678 679 680 681
      <note>
        <para>
          In Oracle, <literal>$db_name</literal> should actually be 
          the SID name of your database (e.g. "XE" if you are using Oracle XE).
        </para>
      </note>

682 683 684 685 686 687 688 689 690
      <para>
        You may need to change the value of 
        <emphasis>webservergroup</emphasis> if your web server does not 
        run in the "apache" group.  On Debian, for example, Apache runs in 
        the "www-data" group.  If you are going to run Bugzilla on a 
        machine where you do not have root access (such as on a shared web 
        hosting account), you will need to leave
        <emphasis>webservergroup</emphasis> empty, ignoring the warnings 
        that <filename>checksetup.pl</filename> will subsequently display 
691
        every time it is run.
692
      </para>
693
      
694 695 696 697 698 699 700 701 702
      <caution>
        <para>
          If you are using suexec, you should use your own primary group
          for <emphasis>webservergroup</emphasis> rather than leaving it
          empty, and see the additional directions in the suexec section
          <xref linkend="suexec" />.
        </para>
      </caution>

703 704 705
      <para>
        The other options in the <filename>localconfig</filename> file
        are documented by their accompanying comments. If you have a slightly
706 707
        non-standard database setup, you may wish to change one or more of
        the other "$db_*" parameters.
gerv%gerv.net's avatar
gerv%gerv.net committed
708
      </para>
709
    </section>
710
    
711 712
    <section id="database-engine">
      <title>Database Server</title>
713 714
      <para>
        This section deals with configuring your database server for use
715 716 717
        with Bugzilla. Currently, MySQL (<xref linkend="mysql"/>),
        PostgreSQL (<xref linkend="postgresql"/>) and Oracle (<xref linkend="oracle"/>)
        are available.
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732
      </para>

      <section id="database-schema">
        <title>Bugzilla Database Schema</title>

        <para>
          The Bugzilla database schema is available at
          <ulink url="http://www.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/">Ravenbrook</ulink>.
          This very valuable tool can generate a written description of
          the Bugzilla database schema for any version of Bugzilla. It
          can also generate a diff between two versions to help someone
          see what has changed.
        </para>
      </section>

733 734
      <section id="mysql">
        <title>MySQL</title>
735

736 737
        <caution>
          <para>
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
            MySQL's default configuration is insecure.
            We highly recommend to run <filename>mysql_secure_installation</filename>
            on Linux or the MySQL installer on Windows, and follow the instructions.
            Important points to note are:
            <orderedlist>
              <listitem>
                <para>Be sure that the root account has a secure password set.</para>
              </listitem>
              <listitem>
                <para>Do not create an anonymous account, and if it exists, say "yes"
                to remove it.</para>
              </listitem>
              <listitem>
                <para>If your web server and MySQL server are on the same machine,
                you should disable the network access.</para>
              </listitem>
            </orderedlist>
755 756
          </para>
        </caution>
757 758 759 760 761
 
        <section id="mysql-max-allowed-packet">
          <title>Allow large attachments and many comments</title>
          
          <para>By default, MySQL will only allow you to insert things
762
          into the database that are smaller than 1MB. Attachments
763 764
          may be larger than this. Also, Bugzilla combines all comments
          on a single bug into one field for full-text searching, and the
765 766
          combination of all comments on a single bug could in some cases
          be larger than 1MB.</para>
767 768 769 770 771 772 773 774 775 776 777 778
          
          <para>To change MySQL's default, you need to edit your MySQL
          configuration file, which is usually <filename>/etc/my.cnf</filename>
          on Linux. We recommend that you allow at least 4MB packets by
          adding the "max_allowed_packet" parameter to your MySQL 
          configuration in the "[mysqld]" section, like this:</para>

          <screen>[mysqld]
# Allow packets up to 4MB
max_allowed_packet=4M
          </screen>
        </section>
779
        
780 781
        <section>
          <title>Allow small words in full-text indexes</title>
782

783 784 785 786
          <para>By default, words must be at least four characters in length
          in order to be indexed by MySQL's full-text indexes. This causes
          a lot of Bugzilla specific words to be missed, including "cc",
          "ftp" and "uri".</para>
787

788 789 790 791
          <para>MySQL can be configured to index those words by setting the
          ft_min_word_len param to the minimum size of the words to index.
          This can be done by modifying the <filename>/etc/my.cnf</filename>
          according to the example below:</para>
792

793
          <screen>  [mysqld]
794 795 796
  # Allow small words in full-text indexes
  ft_min_word_len=2</screen>

797 798 799 800 801 802 803
          <para>Rebuilding the indexes can be done based on documentation found at
          <ulink url="http://www.mysql.com/doc/en/Fulltext_Fine-tuning.html"/>.
          </para>
        </section>
        
        <section id="install-setupdatabase-adduser">
          <title>Add a user to MySQL</title>
804

805 806 807 808 809 810 811 812 813 814
          <para>
            You need to add a new MySQL user for Bugzilla to use.
            (It's not safe to have Bugzilla use the MySQL root account.)
            The following instructions assume the defaults in
            <filename>localconfig</filename>; if you changed those,
            you need to modify the SQL command appropriately. You will
            need the <replaceable>$db_pass</replaceable> password you
            set in <filename>localconfig</filename> in 
            <xref linkend="localconfig"/>.
          </para>
815 816

          <para>
817 818 819 820 821 822 823
            We use an SQL <command>GRANT</command> command to create
            a <quote>bugs</quote> user. This also restricts the 
            <quote>bugs</quote>user to operations within a database
            called <quote>bugs</quote>, and only allows the account
            to connect from <quote>localhost</quote>. Modify it to
            reflect your setup if you will be connecting from another
            machine or as a different user.
824
          </para>
825 826
        
          <para>
827
            Run the <filename>mysql</filename> command-line client and enter:
828 829
          </para>

830 831
          <screen>
    <prompt>mysql&gt;</prompt> GRANT SELECT, INSERT,
832 833 834
           UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
           CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
           TO bugs@localhost IDENTIFIED BY '<replaceable>$db_pass</replaceable>';
835 836 837
    <prompt>mysql&gt;</prompt> FLUSH PRIVILEGES;
          </screen>
        </section>
838

839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
        <section>
          <title>Permit attachments table to grow beyond 4GB</title>

          <para>
            By default, MySQL will limit the size of a table to 4GB.
            This limit is present even if the underlying filesystem
            has no such limit.  To set a higher limit, follow these
            instructions.
          </para>

          <para>
            After you have completed the rest of the installation (or at least the
            database setup parts), you should run the <filename>MySQL</filename>
            command-line client and enter the following, replacing <literal>$bugs_db</literal>
            with your Bugzilla database name (<emphasis>bugs</emphasis> by default):
          </para>

          <screen>
857 858 859
    <prompt>mysql&gt;</prompt> use <replaceable>$bugs_db</replaceable>
    <prompt>mysql&gt;</prompt> ALTER TABLE attachments
           AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874
          </screen>

          <para>
            The above command will change the limit to 20GB. Mysql will have 
            to make a temporary copy of your entire table to do this. Ideally, 
            you should do this when your attachments table is still small. 
          </para>

          <note>
            <para>
              This does not affect Big Files, attachments that are stored directly
              on disk instead of in the database.
            </para>
          </note>
        </section>
875
      </section>
876 877 878 879 880
      
      <section id="postgresql">
        <title>PostgreSQL</title>
        <section>
          <title>Add a User to PostgreSQL</title>
881

882 883 884 885
          <para>You need to add a new user to PostgreSQL for the Bugzilla
          application to use when accessing the database. The following instructions
          assume the defaults in <filename>localconfig</filename>; if you
          changed those, you need to modify the commands appropriately. You will
886 887
          need the <replaceable>$db_pass</replaceable> password you
          set in <filename>localconfig</filename> in 
888
          <xref linkend="localconfig"/>.</para>
889

890 891 892 893 894 895 896 897 898 899 900 901 902 903
          <para>On most systems, to create the user in PostgreSQL, you will need to
          login as the root user, and then</para>

          <screen> <prompt>bash#</prompt> su - postgres</screen>

          <para>As the postgres user, you then need to create a new user: </para>
            
          <screen> <prompt>bash$</prompt> createuser -U postgres -dAP bugs</screen>
 
          <para>When asked for a password, provide the password which will be set as
          <replaceable>$db_pass</replaceable> in <filename>localconfig</filename>.
          The created user will have the ability to create databases and will not be
          able to create new users.</para>
        </section>
904
        
905 906
        <section>
          <title>Configure PostgreSQL</title>
907

908 909 910
          <para>Now, you will need to edit <filename>pg_hba.conf</filename> which is
          usually located in <filename>/var/lib/pgsql/data/</filename>. In this file,
          you will need to add a new line to it as follows:</para>
911

912
          <para>
913
            <computeroutput>host   all    bugs   127.0.0.1    255.255.255.255  md5</computeroutput>
914
          </para>
915
          
916 917 918
          <para>This means that for TCP/IP (host) connections, allow connections from
          '127.0.0.1' to 'all' databases on this server from the 'bugs' user, and use
          password authentication (md5) for that user.</para>
919

920 921 922 923 924 925 926 927 928
          <para>Now, you will need to restart PostgreSQL, but you will need to fully
          stop and start the server rather than just restarting due to the possibility
          of a change to <filename>postgresql.conf</filename>. After the server has
          restarted, you will need to edit <filename>localconfig</filename>, finding
          the <literal>$db_driver</literal> variable and setting it to
          <literal>Pg</literal> and changing the password in <literal>$db_pass</literal>
          to the one you picked previously, while setting up the account.</para> 
        </section>
      </section>
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999

      <section id="oracle">
        <title>Oracle</title>
        <section>
          <title>Create a New Tablespace</title>

          <para>
            You can use the existing tablespace or create a new one for Bugzilla.
            To create a new tablespace, run the following command:
          </para>

          <programlisting>
    CREATE TABLESPACE bugs
    DATAFILE '<replaceable>$path_to_datafile</replaceable>' SIZE 500M
    AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED
          </programlisting>

          <para>
            Here, the name of the tablespace is 'bugs', but you can
            choose another name. <replaceable>$path_to_datafile</replaceable> is
            the path to the file containing your database, for instance
            <filename>/u01/oradata/bugzilla.dbf</filename>.
            The initial size of the database file is set in this example to 500 Mb,
            with an increment of 30 Mb everytime we reach the size limit of the file.
          </para>
        </section>

        <section>
          <title>Add a User to Oracle</title>

          <para>
            The user name and password must match what you set in
            <filename>localconfig</filename> (<literal>$db_user</literal>
            and <literal>$db_pass</literal>, respectively). Here, we assume that
            the user name is 'bugs' and the tablespace name is the same
            as above. 
          </para>

          <programlisting>
    CREATE USER bugs
    IDENTIFIED BY "<replaceable>$db_pass</replaceable>"
    DEFAULT TABLESPACE bugs
    TEMPORARY TABLESPACE TEMP
    PROFILE DEFAULT;
    -- GRANT/REVOKE ROLE PRIVILEGES
    GRANT CONNECT TO bugs;
    GRANT RESOURCE TO bugs;
    -- GRANT/REVOKE SYSTEM PRIVILEGES
    GRANT UNLIMITED TABLESPACE TO bugs;
    GRANT EXECUTE ON CTXSYS.CTX_DDL TO bugs;
          </programlisting>
        </section>

        <section>
          <title>Configure the Web Server</title>

          <para>
            If you use Apache, append these lines to <filename>httpd.conf</filename>
            to set ORACLE_HOME and LD_LIBRARY_PATH. For instance:
          </para>

          <programlisting>
    SetEnv ORACLE_HOME /u01/app/oracle/product/10.2.0/
    SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/10.2.0/lib/
          </programlisting>

          <para>
            When this is done, restart your web server.
          </para>
        </section>
      </section>
1000
    </section>  
1001

1002 1003
    <section>
      <title>checksetup.pl</title>
1004

1005 1006 1007 1008 1009 1010 1011 1012 1013
      <para>
        Next, rerun <filename>checksetup.pl</filename>. It reconfirms
        that all the modules are present, and notices the altered 
        localconfig file, which it assumes you have edited to your
        satisfaction. It compiles the UI templates,
        connects to the database using the 'bugs'
        user you created and the password you defined, and creates the 
        'bugs' database and the tables therein. 
      </para>
1014

1015
      <para>
1016 1017 1018 1019 1020
        After that, it asks for details of an administrator account. Bugzilla
        can have multiple administrators - you can create more later - but
        it needs one to start off with.
        Enter the email address of an administrator, his or her full name, 
        and a suitable Bugzilla password.
1021
      </para>
gerv%gerv.net's avatar
gerv%gerv.net committed
1022
      
1023
      <para>
1024 1025
        <filename>checksetup.pl</filename> will then finish. You may rerun
        <filename>checksetup.pl</filename> at any time if you wish.
1026 1027
      </para>
    </section>
1028 1029


1030 1031
    <section id="http">
      <title>Web server</title>
1032 1033 1034
      <para>
        Configure your web server according to the instructions in the
        appropriate section. (If it makes a difference in your choice,
1035 1036 1037 1038
        the Bugzilla Team recommends Apache.) To check whether your web server
	is correctly configured, try to access <filename>testagent.cgi</filename>
	from your web server. If "OK" is displayed, then your configuration
	is successful. Regardless of which web server
1039 1040
        you are using, however, ensure that sensitive information is
        not remotely available by properly applying the access controls in
1041 1042 1043
        <xref linkend="security-webserver-access"/>. You can run
        <filename>testserver.pl</filename> to check if your web server serves
        Bugzilla files as expected.
1044 1045
      </para>

1046
      <section id="http-apache">
1047 1048 1049 1050 1051
        <title>Bugzilla using Apache</title>
        <para>You have two options for running Bugzilla under Apache - 
          <link linkend="http-apache-mod_cgi">mod_cgi</link> (the default) and
          <link linkend="http-apache-mod_perl">mod_perl</link> (new in Bugzilla
          2.23)
1052
        </para>
1053 1054 1055
        <section id="http-apache-mod_cgi">
            <title>Apache <productname>httpd</productname> with mod_cgi</title>
    
1056
            <para>
1057 1058
            To configure your Apache web server to work with Bugzilla while using
            mod_cgi, do the following:
1059
            </para>
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110
            
            <procedure>
            <step>
                <para>
                Load <filename>httpd.conf</filename> in your editor.
                In Fedora and Red Hat Linux, this file is found in
                <filename class="directory">/etc/httpd/conf</filename>.
                </para>
            </step>
    
            <step>
                <para>
                Apache uses <computeroutput>&lt;Directory&gt;</computeroutput>
                directives to permit fine-grained permission setting. Add the
                following lines to a directive that applies to the location
                of your Bugzilla installation. (If such a section does not
                exist, you'll want to add one.) In this example, Bugzilla has
                been installed at 
                <filename class="directory">/var/www/html/bugzilla</filename>.
                </para>
    
                <programlisting>
    &lt;Directory /var/www/html/bugzilla&gt;
    AddHandler cgi-script .cgi
    Options +Indexes +ExecCGI
    DirectoryIndex index.cgi
    AllowOverride Limit
    &lt;/Directory&gt;
                </programlisting>
    
                <para>
                These instructions: allow apache to run .cgi files found
                within the bugzilla directory; instructs the server to look
                for a file called <filename>index.cgi</filename> if someone
                only types the directory name into the browser; and allows
                Bugzilla's <filename>.htaccess</filename> files to override
                global permissions.
                </para>
    
                <note>
                <para>
                    It is possible to make these changes globally, or to the
                    directive controlling Bugzilla's parent directory (e.g.
                    <computeroutput>&lt;Directory /var/www/html/&gt;</computeroutput>).
                    Such changes would also apply to the Bugzilla directory...
                    but they would also apply to many other places where they
                    may or may not be appropriate. In most cases, including
                    this one, it is better to be as restrictive as possible
                    when granting extra access.
                </para>
                </note>
1111 1112 1113 1114 1115 1116 1117 1118

                <note>
                <para>
                    On Windows, you may have to also add the
                    <computeroutput>ScriptInterpreterSource Registry-Strict</computeroutput>
                    line, see <link linkend="win32-http">Windows specific notes</link>.
                </para>
                </note>
1119 1120 1121 1122 1123 1124
            </step>                    
    
            <step>
                <para>
                <filename>checksetup.pl</filename> can set tighter permissions
                on Bugzilla's files and directories if it knows what group the
1125
                web server runs as. Find the <computeroutput>Group</computeroutput>
1126 1127 1128 1129 1130 1131
                line in <filename>httpd.conf</filename>, place the value found
                there in the <replaceable>$webservergroup</replaceable> variable
                in <filename>localconfig</filename>, then rerun
                <filename>checksetup.pl</filename>.
                </para>
            </step>
1132

1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
            <step>
                <para>
                Optional: If Bugzilla does not actually reside in the webspace
                directory, but instead has been symbolically linked there, you
                will need to add the following to the
                <computeroutput>Options</computeroutput> line of the Bugzilla 
                <computeroutput>&lt;Directory&gt;</computeroutput> directive
                (the same one as in the step above):
                </para>
    
                <programlisting>
    +FollowSymLinks
                </programlisting>
    
                <para>
                Without this directive, Apache will not follow symbolic links
                to places outside its own directory structure, and you will be
                unable to run Bugzilla.
                </para>
            </step>
            </procedure>
        </section>
        <section id="http-apache-mod_perl">
            <title>Apache <productname>httpd</productname> with mod_perl</title>
            
            <para>Some configuration is required to make Bugzilla work with Apache
            and mod_perl</para>
            
            <procedure>
            <step>
                <para>
                Load <filename>httpd.conf</filename> in your editor.
                In Fedora and Red Hat Linux, this file is found in
                <filename class="directory">/etc/httpd/conf</filename>.
                </para>
            </step>
            
            <step>
                <para>Add the following information to your httpd.conf file, substituting
                where appropriate with your own local paths.</para>
                
                <note>
                <para>This should be used instead of the &lt;Directory&gt; block
                shown above. This should also be above any other <literal>mod_perl</literal>
                directives within the <filename>httpd.conf</filename> and must be specified
                in the order as below.</para>
                </note>
                <warning>
                <para>You should also ensure that you have disabled <literal>KeepAlive</literal>
                support in your Apache install when utilizing Bugzilla under mod_perl</para>
                </warning> 
                
                <programlisting>
1186
    PerlSwitches -I/var/www/html/bugzilla -I/var/www/html/bugzilla/lib -w -T
1187 1188 1189 1190 1191 1192 1193 1194
    PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
                </programlisting>
            </step>
			
			<step>
				<para>
					<filename>checksetup.pl</filename> can set tighter permissions
					on Bugzilla's files and directories if it knows what group the
1195
					web server runs as. Find the <computeroutput>Group</computeroutput>
1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207
					line in <filename>httpd.conf</filename>, place the value found
					there in the <replaceable>$webservergroup</replaceable> variable
					in <filename>localconfig</filename>, then rerun
					<filename>checksetup.pl</filename>.
				</para>
            </step>
            </procedure>
            
            <para>On restarting Apache, Bugzilla should now be running within the
            mod_perl environment. Please ensure you have run checksetup.pl to set
		    permissions before you restart Apache.</para>
        
1208
            <note>
1209 1210 1211 1212 1213 1214
            <para>Please bear the following points in mind when looking at using 
                Bugzilla under mod_perl: 
            <itemizedlist>
                <listitem>
                <para>
                    mod_perl support in Bugzilla can take up a HUGE amount of RAM. You could be
1215
                    looking at 30MB per httpd child, easily. Basically, you just need a lot of RAM.
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
                    The more RAM you can get, the better. mod_perl is basically trading RAM for
                    speed. At least 2GB total system RAM is recommended for running Bugzilla under
                    mod_perl.
                </para>
                </listitem>
                <listitem>
                <para>
                    Under mod_perl, you have to restart Apache if you make any manual change to
                    any Bugzilla file. You can't just reload--you have to actually 
					<emphasis>restart</emphasis> the server (as in make sure it stops and starts 
					again). You <emphasis>can</emphasis> change localconfig and the params file 
					manually, if you want, because those are re-read every time you load a page.
                </para>
                </listitem>
                <listitem>
                <para>
                    You must run in Apache's Prefork MPM (this is the default). The Worker MPM
                    may not work--we haven't tested Bugzilla's mod_perl support under threads.
					(And, in fact, we're fairly sure it <emphasis>won't</emphasis> work.)
                </para>
                </listitem>
                <listitem>
                <para>
                    Bugzilla generally expects to be the only mod_perl application running on
                    your entire server. It may or may not work if there are other applications also
                    running under mod_perl. It does try its best to play nice with other mod_perl
                    applications, but it still may have conflicts.
                </para>
                </listitem>
                <listitem>
                <para>
                    It is recommended that you have one Bugzilla instance running under mod_perl
                    on your server. Bugzilla has not been tested with more than one instance running.
                </para>
                </listitem>
            </itemizedlist>
1252
            </para>
1253 1254
            </note>
        </section>
1255
      </section>
1256
      
1257 1258 1259
      <section id="http-iis">
        <title>Microsoft <productname>Internet Information Services</productname></title>

1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
        <para>
          If you are running Bugzilla on Windows and choose to use
          Microsoft's <productname>Internet Information Services</productname>
          or <productname>Personal Web Server</productname> you will need
          to perform a number of other configuration steps as explained below.
          You may also want to refer to the following Microsoft Knowledge
          Base articles: 
          <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;245225">245225</ulink> 
          <quote>HOW TO: Configure and Test a PERL Script with IIS 4.0,
          5.0, and 5.1</quote> (for <productname>Internet Information
          Services</productname>) and 
          <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;231998">231998</ulink>          
          <quote>HOW TO: FP2000: How to Use Perl with Microsoft Personal Web
          Server on Windows 95/98</quote> (for <productname>Personal Web
          Server</productname>).
        </para>

        <para>
          You will need to create a virtual directory for the Bugzilla
          install.  Put the Bugzilla files in a directory that is named
          something <emphasis>other</emphasis> than what you want your
          end-users accessing.  That is, if you want your users to access
          your Bugzilla installation through 
          <quote>http://&lt;yourdomainname&gt;/Bugzilla</quote>, then do
          <emphasis>not</emphasis> put your Bugzilla files in a directory
          named <quote>Bugzilla</quote>.  Instead, place them in a different
          location, and then use the IIS Administration tool to create a
          Virtual Directory named "Bugzilla" that acts as an alias for the
          actual location of the files.  When creating that virtual directory,
          make sure you add the <quote>Execute (such as ISAPI applications or
          CGI)</quote> access permission.
        </para>

        <para>
          You will also need to tell IIS how to handle Bugzilla's
          .cgi files. Using the IIS Administration tool again, open up
          the properties for the new virtual directory and select the
          Configuration option to access the Script Mappings. Create an
          entry mapping .cgi to:
        </para>

        <programlisting>
&lt;full path to perl.exe &gt;\perl.exe -x&lt;full path to Bugzilla&gt; -wT "%s" %s
        </programlisting>

        <para>
          For example:
        </para>

        <programlisting>
c:\perl\bin\perl.exe -xc:\bugzilla -wT "%s" %s
        </programlisting>

        <note>
          <para>
            The ActiveState install may have already created an entry for
            .pl files that is limited to <quote>GET,HEAD,POST</quote>. If
            so, this mapping should be <emphasis>removed</emphasis> as
1318
            Bugzilla's .pl files are not designed to be run via a web server.
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328
          </para>
        </note>

        <para>
          IIS will also need to know that the index.cgi should be treated
          as a default document.  On the Documents tab page of the virtual
          directory properties, you need to add index.cgi as a default
          document type.  If you  wish, you may remove the other default
          document types for this particular virtual directory, since Bugzilla 
          doesn't use any of them.
1329 1330
        </para>

1331 1332 1333 1334 1335
        <para>
          Also, and this can't be stressed enough, make sure that files
          such as <filename>localconfig</filename> and your
          <filename class="directory">data</filename> directory are
          secured as described in <xref linkend="security-webserver-access"/>.
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351
        </para>

      </section>

    </section>
    
    <section id="install-config-bugzilla">
      <title>Bugzilla</title>
      
      <para>
        Your Bugzilla should now be working. Access 
        <filename>http://&lt;your-bugzilla-server&gt;/</filename> - 
        you should see the Bugzilla
        front page. If not, consult the Troubleshooting section,
        <xref linkend="troubleshooting"/>.
      </para>
1352 1353 1354 1355 1356 1357 1358 1359

      <note>
        <para>
          The URL above may be incorrect if you installed Bugzilla into a 
          subdirectory or used a symbolic link from your web site root to 
          the Bugzilla directory.
        </para>
      </note>
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371
      
      <para>
        Log in with the administrator account you defined in the last 
        <filename>checksetup.pl</filename> run. You should go through 
        the parameters on the Edit Parameters page
        (see link in the footer) and see if there are any you wish to
        change. 
        They key parameters are documented in <xref linkend="parameters"/>;
        you should certainly alter 
        <command>maintainer</command> and <command>urlbase</command>; 
        you may also want to alter 
        <command>cookiepath</command> or <command>requirelogin</command>.
1372 1373
      </para>

1374 1375 1376 1377 1378 1379 1380
      <para>
        This would also be a good time to revisit the
        <filename>localconfig</filename> file and make sure that the 
        names of the priorities, severities, platforms and operating systems
        are those you wish to use when you start creating bugs. Remember
        to rerun <filename>checksetup.pl</filename> if you change it.
      </para>
1381

1382 1383 1384 1385 1386 1387
      <para>
        Bugzilla has several optional features which require extra 
        configuration. You can read about those in
        <xref linkend="extraconfig"/>.
      </para>
    </section> 
1388 1389
  </section>

1390 1391 1392
  <section id="extraconfig">
    <title>Optional Additional Configuration</title>

1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415
    <para>
      Bugzilla has a number of optional features. This section describes how
      to configure or enable them.
    </para>
    
    <section>
      <title>Bug Graphs</title>

      <para>If you have installed the necessary Perl modules you
      can start collecting statistics for the nifty Bugzilla 
      graphs.</para>

      <screen><prompt>bash#</prompt> <command>crontab -e</command></screen>

      <para>
        This should bring up the crontab file in your editor. 
        Add a cron entry like this to run 
        <filename>collectstats.pl</filename> 
        daily at 5 after midnight:
      </para>
      
      <programlisting>5 0 * * * cd &lt;your-bugzilla-directory&gt; ; ./collectstats.pl</programlisting>

1416 1417 1418 1419 1420
      <para>
        After two days have passed you'll be able to view bug graphs from
        the Reports page.
      </para>

1421 1422
      <note>
        <para>
1423 1424 1425 1426
          Windows does not have 'cron', but it does have the Task
          Scheduler, which performs the same duties. There are also
          third-party tools that can be used to implement cron, such as
          <ulink url="http://www.nncron.ru/">nncron</ulink>.
1427 1428
        </para>
      </note>
1429 1430
    </section>

1431
    <section id="installation-whining-cron">
1432 1433
      <title>The Whining Cron</title>

1434 1435
      <para>What good are
      bugs if they're not annoying? To help make them more so you
1436
      can set up Bugzilla's automatic whining system to complain at engineers
1437
      which leave their bugs in the NEW or REOPENED state without triaging them.
1438
      </para>
1439
      <para>
1440 1441 1442
        This can be done by adding the following command as a daily
        crontab entry, in the same manner as explained above for bug
        graphs. This example runs it at 12.55am. 
1443
      </para>
1444

1445
      <programlisting>55 0 * * * cd &lt;your-bugzilla-directory&gt; ; ./whineatnews.pl</programlisting>
1446

1447 1448
      <note>
        <para>
1449 1450
          Windows does not have 'cron', but it does have the Task
          Scheduler, which performs the same duties. There are also
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489
          third-party tools that can be used to implement cron, such as
          <ulink url="http://www.nncron.ru/">nncron</ulink>.
        </para>
      </note>
    </section>

    <section id="installation-whining">
      <title>Whining</title>

      <para>
        As of Bugzilla 2.20, users can configure Bugzilla to regularly annoy 
        them at regular intervals, by having Bugzilla execute saved searches
        at certain times and emailing the results to the user.  This is known
        as "Whining".  The process of configuring Whining is described 
        in <xref linkend="whining"/>, but for it to work a Perl script must be
        executed at regular intervals.
      </para>

      <para>
        This can be done by adding the following command as a daily
        crontab entry, in the same manner as explained above for bug
        graphs. This example runs it every 15 minutes. 
      </para>

      <programlisting>*/15 * * * * cd &lt;your-bugzilla-directory&gt; ; ./whine.pl</programlisting>

      <note>
        <para>
          Whines can be executed as often as every 15 minutes, so if you specify
          longer intervals between executions of whine.pl, some users may not 
          be whined at as often as they would expect.  Depending on the person,
          this can either be a very Good Thing or a very Bad Thing.
        </para>
      </note>

      <note>
        <para>
          Windows does not have 'cron', but it does have the Task
          Scheduler, which performs the same duties. There are also
1490 1491
          third-party tools that can be used to implement cron, such as
          <ulink url="http://www.nncron.ru/">nncron</ulink>.
1492 1493
        </para>
      </note>
1494
    </section>
1495
        
1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516
    <section id="apache-addtype">
      <title>Serving Alternate Formats with the right MIME type</title>

      <para>
        Some Bugzilla pages have alternate formats, other than just plain
        <acronym>HTML</acronym>. In particular, a few Bugzilla pages can 
        output their contents as either <acronym>XUL</acronym> (a special 
        Mozilla format, that looks like a program <acronym>GUI</acronym>) 
        or <acronym>RDF</acronym> (a type of structured <acronym>XML</acronym> 
        that can be read by various programs).
      </para>
      <para>
        In order for your users to see these pages correctly, Apache must 
        send them with the right <acronym>MIME</acronym> type. To do this, 
        add the following lines to your Apache configuration, either in the 
        <computeroutput>&lt;VirtualHost&gt;</computeroutput> section for your
        Bugzilla, or in the <computeroutput>&lt;Directory&gt;</computeroutput>
        section for your Bugzilla:
      </para>
      <para>
        <screen>AddType application/vnd.mozilla.xul+xml .xul
1517
AddType application/rdf+xml .rdf</screen>
1518
      </para>
1519
    </section>    
1520 1521
  </section>

1522
  <section id="multiple-bz-dbs">
1523 1524
    <title>Multiple Bugzilla databases with a single installation</title>

1525
    <para>The previous instructions referred to a standard installation, with
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561
      one unique Bugzilla database. However, you may want to host several
      distinct installations, without having several copies of the code. This is
      possible by using the PROJECT environment variable. When accessed,
      Bugzilla checks for the existence of this variable, and if present, uses
      its value to check for an alternative configuration file named
      <filename>localconfig.&lt;PROJECT&gt;</filename> in the same location as
      the default one (<filename>localconfig</filename>). It also checks for
      customized templates in a directory named
      <filename>&lt;PROJECT&gt;</filename> in the same location as the
      default one (<filename>template/&lt;langcode&gt;</filename>). By default
      this is <filename>template/en/default</filename> so PROJECT's templates
      would be located at <filename>template/en/PROJECT</filename>.</para> 

      <para>To set up an alternate installation, just export PROJECT=foo before
      running <command>checksetup.pl</command> for the first time. It will
      result in a file called <filename>localconfig.foo</filename> instead of
      <filename>localconfig</filename>. Edit this file as described above, with
      reference to a new database, and re-run <command>checksetup.pl</command>
      to populate it. That's all.</para>

    <para>Now you have to configure the web server to pass this environment
      variable when accessed via an alternate URL, such as virtual host for
      instance. The following is an example of how you could do it in Apache,
      other Webservers may differ.
<programlisting>
&lt;VirtualHost 212.85.153.228:80&gt;
    ServerName foo.bar.baz
    SetEnv PROJECT foo
    Alias /bugzilla /var/www/bugzilla
&lt;/VirtualHost&gt;
</programlisting>
    </para>

    <para>Don't forget to also export this variable before accessing Bugzilla
       by other means, such as cron tasks for instance.</para> 
  </section>
1562

1563
  <section id="os-specific">
1564
    <title>OS-Specific Installation Notes</title>
1565 1566

    <para>Many aspects of the Bugzilla installation can be affected by the
1567
    operating system you choose to install it on. Sometimes it can be made
1568 1569 1570
    easier and others more difficult. This section will attempt to help you
    understand both the difficulties of running on specific operating systems
    and the utilities available to make it easier.
1571 1572
    </para>

1573 1574 1575
    <para>If you have anything to add or notes for an operating system not
    covered, please file a bug in &bzg-bugs;. 
    </para>
1576

1577 1578
    <section id="os-win32">
      <title>Microsoft Windows</title>
1579 1580 1581 1582 1583
      <para>
        Making Bugzilla work on Windows is more difficult than making it
        work on Unix.  For that reason, we still recommend doing so on a Unix 
        based system such as GNU/Linux.  That said, if you do want to get
        Bugzilla running on Windows, you will need to make the following
1584
        adjustments. A detailed step-by-step
1585
        <ulink url="https://wiki.mozilla.org/Bugzilla:Win32Install">
1586 1587
        installation guide for Windows</ulink> is also available
        if you need more help with your installation.
1588
      </para>
1589

1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
      <section id="win32-perl">
        <title>Win32 Perl</title>
        <para>
          Perl for Windows can be obtained from 
          <ulink url="http://www.activestate.com/">ActiveState</ulink>.
           You should be able to find a compiled binary at <ulink 
           url="http://aspn.activestate.com/ASPN/Downloads/ActivePerl/" />.
           The following instructions assume that you are using version
           5.8.1 of ActiveState.
          </para>
1600 1601 1602 1603 1604 1605 1606 1607 1608

          <note>
            <para>
             These instructions are for 32-bit versions of Windows. If you are
             using a 64-bit version of Windows, you will need to install 32-bit
             Perl in order to install the 32-bit modules as described below.
            </para>
          </note>

1609 1610
        </section>
  
1611
      <section id="win32-perl-modules">
1612
        <title>Perl Modules on Win32</title>
1613

1614 1615 1616 1617
        <para>
          Bugzilla on Windows requires the same perl modules found in
          <xref linkend="install-perlmodules"/>. The main difference is that
          windows uses <glossterm linkend="gloss-ppm">PPM</glossterm> instead
1618 1619 1620
          of CPAN. ActiveState provides a GUI to manage Perl modules. We highly
          recommend that you use it. If you prefer to use ppm from the
          command-line, type:
1621
        </para>
1622

1623
        <programlisting>
1624
C:\perl&gt; <command>ppm install &lt;module name&gt;</command>
1625
        </programlisting>
1626

1627 1628
        <para>
          The best source for the Windows PPM modules needed for Bugzilla
1629 1630
          is probably the theory58S website, which you can add to your list
          of repositories as follows (for Perl 5.8.x):
1631
        </para>
1632

1633
        <programlisting>
1634
<command>ppm repo add theory58S http://theoryx5.uwinnipeg.ca/ppms/</command>
1635
        </programlisting>
1636 1637 1638 1639 1640 1641 1642 1643 1644 1645

        <para>
          If you are using Perl 5.10.x, you cannot use the same PPM modules as Perl
          5.8.x as they are incompatible. In this case, you should add the following
          repository:
        </para>
        <programlisting>
<command>ppm repo add theory58S http://cpan.uwinnipeg.ca/PPMPackages/10xx/</command>
        </programlisting>

1646 1647 1648 1649
        <note>
          <para>
            In versions prior to 5.8.8 build 819 of PPM the command is 
            <programlisting>
1650
<command>ppm repository add theory58S http://theoryx5.uwinnipeg.ca/ppms/</command>
1651 1652 1653
            </programlisting>
          </para>
        </note>
1654 1655 1656 1657 1658 1659 1660 1661
        <note>
          <para>
            The PPM repository stores modules in 'packages' that may have
            a slightly different name than the module.  If retrieving these
            modules from there, you will need to pay attention to the information
            provided when you run <command>checksetup.pl</command> as it will
            tell you what package you'll need to install.
          </para>
1662
        </note>
1663

1664 1665
        <tip>
          <para>
1666
            If you are behind a corporate firewall, you will need to let the
1667
            ActiveState PPM utility know how to get through it to access
1668 1669 1670
            the repositories by setting the HTTP_proxy system environmental
            variable. For more information on setting that variable, see
            the ActiveState documentation.
1671 1672
          </para>
        </tip>
1673 1674
      </section>
  
1675 1676
      <section id="win32-http">
        <title>Serving the web pages</title>
1677

1678 1679 1680 1681 1682 1683 1684 1685
        <para>
          As is the case on Unix based systems, any web server should
          be able to handle Bugzilla; however, the Bugzilla Team still
          recommends Apache whenever asked. No matter what web server
          you choose, be sure to pay attention to the security notes
          in <xref linkend="security-webserver-access"/>. More
          information on configuring specific web servers can be found
          in <xref linkend="http"/>.
1686
        </para>
1687

1688
        <note>
1689
          <para>
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699
            The web server looks at <filename>/usr/bin/perl</filename> to
            call Perl. If you are using Apache on windows, you can set the
            <ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</ulink>
            directive in your Apache config file to make it look at the
            right place: insert the line
            <programlisting>ScriptInterpreterSource Registry-Strict</programlisting>
            into your <filename>httpd.conf</filename> file, and create the key
            <programlisting>HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command</programlisting>
            with <option>C:\Perl\bin\perl.exe -T</option> as value (adapt to your
            path if needed) in the registry. When this is done, restart Apache.
1700
          </para>
1701
        </note>
1702

1703
      </section>
1704 1705 1706
      
      <section id="win32-email">
        <title>Sending Email</title>
1707

1708 1709 1710 1711 1712 1713
        <para>
          To enable Bugzilla to send email on Windows, the server running the
          Bugzilla code must be able to connect to, or act as, an SMTP server.
        </para>
        
      </section>
1714
    </section>
1715

1716 1717
    <section id="os-macosx">
      <title><productname>Mac OS X</productname></title>
1718

1719 1720
      <para>Making Bugzilla work on Mac OS X requires the following 
      adjustments.</para>
1721

1722 1723
      <section id="macosx-sendmail">
        <title>Sendmail</title>
1724

1725 1726 1727 1728 1729
        <para>In Mac OS X 10.3 and later, 
        <ulink url="http://www.postfix.org/">Postfix</ulink> 
        is used as the built-in email server.  Postfix provides an executable
        that mimics sendmail enough to fool Bugzilla, as long as Bugzilla can 
        find it.</para>
1730

1731 1732 1733 1734 1735
        <para>As of version 2.20, Bugzilla will be able to find the fake 
        sendmail executable without any assistance.  However, you will have 
        to turn on the sendmailnow parameter before you do anything that would 
        result in email being sent.  For more information, see the description 
        of the sendmailnow parameter in <xref linkend="parameters"/>.</para>
1736

1737 1738 1739 1740 1741
      </section>

      <section id="macosx-libraries">
        <title>Libraries &amp; Perl Modules on Mac OS X</title>

1742
        <para>Apple does not include the GD library with Mac OS X. Bugzilla
1743 1744
        needs this for bug graphs.</para>

1745 1746 1747 1748
        <para>You can use DarwinPorts (<ulink url="http://darwinports.com/"/>)
        or Fink (<ulink url="http://sourceforge.net/projects/fink/"/>), both
        of which are similar in nature to the CPAN installer, but install
        common unix programs.</para>
1749

1750 1751 1752
        <para>Follow the instructions for setting up DarwinPorts or Fink.
        Once you have one installed, you'll want to use it to install the
        <filename>gd2</filename> package.
1753
        </para>
1754

1755
        <para>Fink will prompt you for a number of dependencies, type 'y' and hit
1756 1757 1758 1759
        enter to install all of the dependencies and then watch it work. You will
        then be able to use <glossterm linkend="gloss-cpan">CPAN</glossterm> to
        install the GD Perl module.
        </para>
1760

1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775
        <note>
          <para>To prevent creating conflicts with the software that Apple
          installs by default, Fink creates its own directory tree at 
          <filename class="directory">/sw</filename> where it installs most of
          the software that it installs. This means your libraries and headers
          will be at <filename class="directory">/sw/lib</filename> and
          <filename class="directory">/sw/include</filename> instead of
          <filename class="directory">/usr/lib</filename> and
          <filename class="directory">/usr/include</filename>. When the
          Perl module config script asks where your <filename>libgd</filename>
          is, be sure to tell it
          <filename class="directory">/sw/lib</filename>.
          </para>
        </note>

1776 1777 1778 1779
        <para>Also available via DarwinPorts and Fink is
        <filename>expat</filename>. After installing the expat package, you
        will be able to install XML::Parser using CPAN. If you use fink, there
        is one caveat. Unlike recent versions of
1780 1781 1782 1783 1784 1785
        the GD module, XML::Parser doesn't prompt for the location of the
        required libraries. When using CPAN, you will need to use the following
        command sequence:
        </para>

        <screen>
1786 1787 1788 1789
# perl -MCPAN -e'look XML::Parser'        <co id="macosx-look"/>
# perl Makefile.PL EXPATLIBPATH=/sw/lib EXPATINCPATH=/sw/include
# make; make test; make install           <co id="macosx-make"/>
# exit                                    <co id="macosx-exit"/>
1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
        </screen>
        <calloutlist>
          <callout arearefs="macosx-look macosx-exit">
            <para>The look command will download the module and spawn a
            new shell with the extracted files as the current working directory.
            The exit command will return you to your original shell.
            </para>
          </callout>
          <callout arearefs="macosx-make">
            <para>You should watch the output from these make commands,
            especially <quote>make test</quote> as errors may prevent 
            XML::Parser from functioning correctly with Bugzilla.
            </para>
          </callout>
        </calloutlist>
      </section>
1806
    </section>
1807

1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825
    <section id="os-linux">
      <title>Linux Distributions</title>
            <para>Many Linux distributions include Bugzilla and its 
            dependencies in their native package management systems. 
            Installing Bugzilla with root access on any Linux system 
            should be as simple as finding the Bugzilla package in the 
            package management application and installing it using the 
            normal command syntax. Several distributions also perform 
            the proper web server configuration automatically on installation.
            </para>
            <para>Please consult the documentation of your Linux 
            distribution for instructions on how to install packages, 
            or for specific instructions on installing Bugzilla with 
            native package management tools. There is also a 
            <ulink url="http://wiki.mozilla.org/Bugzilla:Linux_Distro_Installation">
            Bugzilla Wiki Page</ulink> for distro-specific installation
            notes.
            </para>
1826
    </section>
1827
  </section>
1828 1829


1830 1831 1832 1833 1834 1835
  <section id="nonroot">
    <title>UNIX (non-root) Installation Notes</title>

    <section>
      <title>Introduction</title>

1836
      <para>If you are running a *NIX OS as non-root, either due
1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859
      to lack of access (web hosts, for example) or for security
      reasons, this will detail how to install Bugzilla on such
      a setup. It is recommended that you read through the
      <xref linkend="installation" />
      first to get an idea on the installation steps required.
      (These notes will reference to steps in that guide.)</para>

    </section>

    <section>
      <title>MySQL</title>

      <para>You may have MySQL installed as root. If you're
      setting up an account with a web host, a MySQL account
      needs to be set up for you. From there, you can create
      the bugs account, or use the account given to you.</para>

      <warning>
        <para>You may have problems trying to set up
        <command>GRANT</command> permissions to the database.
        If you're using a web host, chances are that you have a
        separate database which is already locked down (or one big
        database with limited/no access to the other areas), but you
1860
        may want to ask your system administrator what the security
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
        settings are set to, and/or run the <command>GRANT</command>
        command for you.</para>

        <para>Also, you will probably not be able to change the MySQL
        root user password (for obvious reasons), so skip that
        step.</para>
      </warning>

      <section>
        <title>Running MySQL as Non-Root</title>
          <section>
            <title>The Custom Configuration Method</title>
              <para>Create a file .my.cnf in your 
              home directory (using /home/foo in this example)
              as follows....</para>
              <programlisting>
[mysqld]
datadir=/home/foo/mymysql
socket=/home/foo/mymysql/thesock
port=8081

[mysql]
socket=/home/foo/mymysql/thesock
port=8081

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/home/foo/mymysql/the.log
pid-file=/home/foo/mymysql/the.pid
              </programlisting>
          </section>
          <section>
            <title>The Custom Built Method</title>
    
            <para>You can install MySQL as a not-root, if you really need to.
            Build it with PREFIX set to <filename class="directory">/home/foo/mysql</filename>,
            or use pre-installed executables, specifying that you want
            to put all of the data files in <filename class="directory">/home/foo/mysql/data</filename>.
            If there is another MySQL server running on the system that you
            do not own, use the -P option to specify a TCP port that is not
            in use.</para>
          </section>
    
          <section>
            <title>Starting the Server</title>
            <para>After your mysqld program is built and any .my.cnf file is 
            in place, you must initialize the databases (ONCE).</para>
            <screen>
              <prompt>bash$</prompt>
              <command>mysql_install_db</command>
            </screen>
            <para>Then start the daemon with</para>
            <screen>
              <prompt>bash$</prompt>
              <command>safe_mysql &amp;</command>
            </screen>
            <para>After you start mysqld the first time, you then connect to
            it as "root" and <command>GRANT</command> permissions to other
            users. (Again, the MySQL root account has nothing to do with
            the *NIX root account.)</para>
    
            <note>
              <para>You will need to start the daemons yourself. You can either
              ask your system administrator to add them to system startup files, or
              add a crontab entry that runs a script to check on these daemons
              and restart them if needed.</para>
            </note>
    
            <warning>
              <para>Do NOT run daemons or other services on a server without first
              consulting your system administrator! Daemons use up system resources
              and running one may be in violation of your terms of service for any
              machine on which you are a user!</para>
            </warning>
          </section>
      </section>

    </section>

    <section>
      <title>Perl</title>

1946 1947
      <para>
      On the extremely rare chance that you don't have Perl on
1948 1949
      the machine, you will have to build the sources
      yourself. The following commands should get your system
1950 1951
      installed with your own personal version of Perl:
      </para>
1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962

      <screen>
        <prompt>bash$</prompt>
        <command>wget http://perl.com/CPAN/src/stable.tar.gz</command>
        <prompt>bash$</prompt>
        <command>tar zvxf stable.tar.gz</command>
        <prompt>bash$</prompt>
        <command>cd perl-5.8.1</command> (or whatever the version of Perl is called)
        <prompt>bash$</prompt>
        <command>sh Configure -de -Dprefix=/home/foo/perl</command>
        <prompt>bash$</prompt>
1963
        <command>make &amp;&amp; make test &amp;&amp; make install</command>
1964 1965
      </screen>

1966 1967 1968 1969 1970
      <para>
      Once you have Perl installed into a directory (probably
      in <filename class="directory">~/perl/bin</filename>), you will need to
      install the Perl Modules, described below.
      </para>
1971 1972
    </section>

1973
    <section id="install-perlmodules-nonroot">
1974 1975
      <title>Perl Modules</title>

1976 1977 1978 1979
      <para>
      Installing the Perl modules as a non-root user is accomplished by
      running the <filename>install-module.pl</filename>
      script. For more details on this script, see 
1980 1981
      <ulink url="api/install-module.html"><filename>install-module.pl</filename>
      documentation</ulink>
1982
      </para>
1983 1984 1985 1986 1987 1988
    </section>

    <section>
      <title>HTTP Server</title>

      <para>Ideally, this also needs to be installed as root and
1989
      run under a special web server account. As long as
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027
      the web server will allow the running of *.cgi files outside of a
      cgi-bin, and a way of denying web access to certain files (such as a
      .htaccess file), you should be good in this department.</para>

      <section>
        <title>Running Apache as Non-Root</title>

        <para>You can run Apache as a non-root user, but the port will need
        to be set to one above 1024. If you type <command>httpd -V</command>,
        you will get a list of the variables that your system copy of httpd
        uses. One of those, namely HTTPD_ROOT, tells you where that
        installation looks for its config information.</para>

        <para>From there, you can copy the config files to your own home
        directory to start editing. When you edit those and then use the -d
        option to override the HTTPD_ROOT compiled into the web server, you
        get control of your own customized web server.</para>

        <note>
          <para>You will need to start the daemons yourself. You can either
          ask your system administrator to add them to system startup files, or
          add a crontab entry that runs a script to check on these daemons
          and restart them if needed.</para>
        </note>

        <warning>
          <para>Do NOT run daemons or other services on a server without first
          consulting your system administrator! Daemons use up system resources
          and running one may be in violation of your terms of service for any
          machine on which you are a user!</para>
        </warning>
      </section>
    </section>

    <section>
      <title>Bugzilla</title>

      <para>
2028
      When you run <command>./checksetup.pl</command> to create
2029 2030
      the <filename>localconfig</filename> file, it will list the Perl
      modules it finds. If one is missing, go back and double-check the
2031 2032 2033
      module installation from <xref linkend="install-perlmodules-nonroot"/>, 
      then delete the <filename>localconfig</filename> file and try again.
      </para>
2034 2035

      <warning>
2036
        <para>One option in <filename>localconfig</filename> you
2037
        might have problems with is the web server group. If you can't
2038
        successfully browse to the <filename>index.cgi</filename> (like
2039 2040 2041 2042 2043 2044
        a Forbidden error), you may have to relax your permissions,
        and blank out the web server group. Of course, this may pose
        as a security risk. Having a properly jailed shell and/or
        limited access to shell accounts may lessen the security risk,
        but use at your own risk.</para>
      </warning>
2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064

      <section id="suexec">
        <title>suexec or shared hosting</title>

        <para>If you are running on a system that uses suexec (most shared
        hosting environments do this), you will need to set the
        <emphasis>webservergroup</emphasis> value in <filename>localconfig</filename>
        to match <emphasis>your</emphasis> primary group, rather than the one
        the web server runs under.  You will need to run the following
        shell commands after running <command>./checksetup.pl</command>,
        every time you run it (or modify <filename>checksetup.pl</filename>
        to do them for you via the system() command).
        <programlisting>        for i in docs graphs images js skins; do find $i -type d -exec chmod o+rx {} \; ; done
        for i in jpg gif css js png html rdf xul; do find . -name \*.$i -exec chmod o+r {} \; ; done
        find . -name .htaccess -exec chmod o+r {} \;
        chmod o+x . data data/webdot</programlisting>
        Pay particular attention to the number of semicolons and dots.
        They are all important.  A future version of Bugzilla will
        hopefully be able to do this for you out of the box.</para>
      </section>
2065 2066 2067
    </section>
  </section>

2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485

  <section id="upgrade">
    <title>Upgrading to New Releases</title>
    
    <para>Upgrading to new Bugzilla releases is very simple. There is
      a script included with Bugzilla that will automatically
      do all of the database migration for you.</para>
    
    <para>The following sections explain how to upgrade from one
      version of Bugzilla to another. Whether you are upgrading
      from one bug-fix version to another (such as 3.0.1 to 3.0.2)
      or from one major version to another (such as from 3.0 to 3.2),
      the instructions are always the same.</para>

    <note>
      <para>
        Any examples in the following sections are written as though the
        user were updating to version 2.22.1, but the procedures are the
        same no matter what version you're updating to. Also, in the
        examples, the user's Bugzilla installation is found at
        <filename>/var/www/html/bugzilla</filename>. If that is not the
        same as the location of your Bugzilla installation, simply
        substitute the proper paths where appropriate.
      </para>
    </note>

    <section id="upgrade-before">
      <title>Before You Upgrade</title>
    
      <para>Before you start your upgrade, there are a few important
        steps to take:</para>

      <orderedlist>
        <listitem>
          <para>
            Read the <ulink url="http://www.bugzilla.org/releases/">Release
            Notes</ulink> of the version you're upgrading to,
            particularly the "Notes for Upgraders" section.
          </para>
        </listitem>
        
        <listitem>
          <para>
            View the Sanity Check (<xref linkend="sanitycheck"/>) page
            on your installation before upgrading. Attempt to fix all warnings
            that the page produces before you go any further, or you may
            experience problems  during your upgrade.
          </para>
        </listitem>
        
        <listitem>
          <para>
            Shut down your Bugzilla installation by putting some HTML or
            text in the shutdownhtml parameter
            (see <xref linkend="parameters"/>).
          </para>
        </listitem>
        
        <listitem>
          <para>
            Make a backup of the Bugzilla database.
            <emphasis>THIS IS VERY IMPORTANT</emphasis>. If
            anything goes wrong during the upgrade, your installation
            can be corrupted beyond recovery. Having a backup keeps you safe.
          </para>

          <warning>
            <para>
              Upgrading is a one-way process. You cannot "downgrade" an
              upgraded Bugzilla. If you wish to revert to the old Bugzilla
              version for any reason, you will have to restore your database
              from this backup.
            </para>
          </warning>

          <para>Here are some sample commands you could use to backup
            your database, depending on what database system you're
            using. You may have to modify these commands for your
            particular setup.</para>
          
          <variablelist>
            <varlistentry>
              <term>MySQL:</term>
              <listitem>
                <para>
                  <command>mysqldump --opt -u bugs -p bugs > bugs.sql</command>
                </para>
              </listitem>
            </varlistentry>
              
            <varlistentry>
              <term>PostgreSQL:</term>
              <listitem>
                <para>
                  <command>pg_dump --no-privileges --no-owner -h localhost -U bugs
                    > bugs.sql</command>
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </listitem>
      </orderedlist>
    </section>
      
    <section id="upgrade-files">
      <title>Getting The New Bugzilla</title>
      
      <para>There are three ways to get the new version of Bugzilla.
        We'll list them here briefly and then explain them
        more later.</para>
      
      <variablelist>
        <varlistentry>
          <term>CVS (<xref linkend="upgrade-cvs"/>)</term>
          <listitem>
            <para>
              If have <command>cvs</command> installed on your machine
              and you have Internet access, this is the easiest way to
              upgrade, particularly if you have made modifications
              to the code or templates of Bugzilla.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>Download the tarball (<xref linkend="upgrade-tarball"/>)</term>
          <listitem>
            <para>
              This is a very simple way to upgrade, and good if you
              haven't made many (or any) modifications to the code or
              templates of your Bugzilla.
            </para>
          </listitem>
        </varlistentry>
        
        <varlistentry>
          <term>Patches (<xref linkend="upgrade-patches"/>)</term>
          <listitem>
            <para>
              If you have made modifications to your Bugzilla, and
              you don't have Internet access or you don't want to use
              cvs, then this is the best way to upgrade.
            </para>
            
            <para>
              You can only do minor upgrades (such as 3.0 to 3.0.1 or
              3.0.1 to 3.0.2) with patches.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
        
      <section id="upgrade-modified">
        <title>If you have modified your Bugzilla</title>
      
        <para>
          If you have modified the code or templates of your Bugzilla,
          then upgrading requires a bit more thought and effort.
          A discussion of the various methods of updating compared with
          degree and methods of local customization can be found in
          <xref linkend="template-method"/>.
        </para>

        <para>
          The larger the jump you are trying to make, the more difficult it
          is going to be to upgrade if you have made local customizations.
          Upgrading from 3.0 to 3.0.1 should be fairly painless even if
          you are heavily customized, but going from 2.18 to 3.0 is going
          to mean a fair bit of work re-writing your local changes to use
          the new files, logic, templates, etc. If you have done no local
          changes at all, however, then upgrading should be approximately
          the same amount of work regardless of how long it has been since
          your version was released.
        </para>
      </section>

      <section id="upgrade-cvs">
        <title>Upgrading using CVS</title>

        <para>
          This requires that you have cvs installed (most Unix machines do),
          and requires that you are able to access cvs-mirror.mozilla.org
          on port 2401, which may not be an option if you are behind a
          highly restrictive firewall or don't have Internet access.
        </para>

        <para>
          The following shows the sequence of commands needed to update a
          Bugzilla installation via CVS, and a typical series of results.
        </para>

        <programlisting>
bash$ <command>cd /var/www/html/bugzilla</command>
bash$ <command>cvs login</command>
Logging in to :pserver:anonymous@cvs-mirror.mozilla.org:2401/cvsroot
CVS password: <emphasis>('anonymous', or just leave it blank)</emphasis>
bash$ <command>cvs -q update -r BUGZILLA-2_22_1 -dP</command>
P checksetup.pl
P collectstats.pl
P docs/rel_notes.txt
P template/en/default/list/quips.html.tmpl
<emphasis>(etc.)</emphasis>
        </programlisting>

        <caution>
          <para>
            If a line in the output from <command>cvs update</command> begins
            with a <computeroutput>C</computeroutput>, then that represents a
            file with local changes that CVS was unable to properly merge. You
            need to resolve these conflicts manually before Bugzilla (or at
            least the portion using that file) will be usable.
          </para>
        </caution>
      </section>

      <section id="upgrade-tarball">
        <title>Upgrading using the tarball</title>

        <para>
          If you are unable (or unwilling) to use CVS, another option that's
          always available is to obtain the latest tarball from the <ulink
          url="http://www.bugzilla.org/download/">Download Page</ulink> and 
          create a new Bugzilla installation from that.
        </para>

        <para>
          This sequence of commands shows how to get the tarball from the
          command-line; it is also possible to download it from the site
          directly in a web browser. If you go that route, save the file
          to the <filename class="directory">/var/www/html</filename>
          directory (or its equivalent, if you use something else) and 
          omit the first three lines of the example.
        </para>

        <programlisting>
bash$ <command>cd /var/www/html</command>
bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.22.1.tar.gz</command>
<emphasis>(Output omitted)</emphasis>
bash$ <command>tar xzvf bugzilla-2.22.1.tar.gz</command>
bugzilla-2.22.1/
bugzilla-2.22.1/.cvsignore
<emphasis>(Output truncated)</emphasis>
bash$ <command>cd bugzilla-2.22.1</command>
bash$ <command>cp ../bugzilla/localconfig* .</command>
bash$ <command>cp -r ../bugzilla/data .</command>
bash$ <command>cd ..</command>
bash$ <command>mv bugzilla bugzilla.old</command>
bash$ <command>mv bugzilla-2.22.1 bugzilla</command>
        </programlisting>

        <warning>
          <para>
            The <command>cp</command> commands both end with periods which
            is a very important detail--it means that the destination
            directory is the current working directory.
          </para>
        </warning>

        <para>
          This upgrade method will give you a clean install of Bugzilla.
          That's fine if you don't have any local customizations that you
          want to maintain. If you do have customizations, then you will 
          need to reapply them by hand to the appropriate files.
        </para>
      </section>

      <section id="upgrade-patches">
        <title>Upgrading using patches</title>

        <para>
          A patch is a collection of all the bug fixes that have been made
          since the last bug-fix release.
        </para>
        
        <para>
          If you are doing a bug-fix upgrade&mdash;that is, one where only the 
          last number of the revision changes, such as from 2.22 to
          2.22.1&mdash;then you have the option of obtaining and applying a
          patch file from the <ulink
          url="http://www.bugzilla.org/download/">Download Page</ulink>.
        </para>
        
        <para>
          As above, this example starts with obtaining the file via the 
          command line. If you have already downloaded it, you can omit the
          first two commands.
        </para>

        <programlisting>
bash$ <command>cd /var/www/html/bugzilla</command>
bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.22-to-2.22.1.diff.gz</command>
<emphasis>(Output omitted)</emphasis>
bash$ <command>gunzip bugzilla-2.22-to-2.22.1.diff.gz</command>
bash$ <command>patch -p1 &lt; bugzilla-2.22-to-2.22.1.diff</command>
patching file checksetup.pl
patching file collectstats.pl
<emphasis>(etc.)</emphasis>
        </programlisting>

        <warning>
          <para>
            Be aware that upgrading from a patch file does not change the
            entries in your <filename class="directory">CVS</filename> directory.
            This could make it more difficult to upgrade using CVS
            (<xref linkend="upgrade-cvs"/>) in the future.
          </para>
        </warning>

      </section>
    </section>

    <section id="upgrade-completion">
      <title>Completing Your Upgrade</title>

      <para>
        Now that you have the new Bugzilla code, there are a few final
        steps to complete your upgrade.
      </para>
      
      <orderedlist>
        <listitem>
          <para>
            If your new Bugzilla installation is in a different
            directory or on a different machine than your old Bugzilla
            installation, make sure that you have copied the
            <filename>data</filename> directory and the
            <filename>localconfig</filename> file from your old Bugzilla
            installation. (If you followed the tarball instructions
            above, this has already happened.)
          </para>
        </listitem>
        
        <listitem>
          <para>
            If this is a major update, check that the configuration
            (<xref linkend="configuration"/>) for your new Bugzilla is
            up-to-date. Sometimes the configuration requirements change
            between major versions.
          </para>
        </listitem>
        
        <listitem>
          <para>
            If you didn't do it as part of the above configuration step,
            now you need to run <command>checksetup.pl</command>, which
            will do everything required to convert your existing database
            and settings for the new version:
          </para>

          <programlisting>
bash$ <command>cd /var/www/html/bugzilla</command>
bash$ <command>./checksetup.pl</command>
          </programlisting>

          <warning>
            <para>
              The period at the beginning of the command
              <command>./checksetup.pl</command> is important and can not
              be omitted.
            </para>
          </warning>
          
          <caution>
            <para>
              If this is a major upgrade (say, 2.22 to 3.0 or similar),
              running <command>checksetup.pl</command> on a large
              installation (75,000 or more bugs) can take a long time,
              possibly several hours.
            </para>
          </caution>
        </listitem>

        <listitem>
          <para>
            Clear any HTML or text that you put into the shutdownhtml
            parameter, to re-activate Bugzilla.
          </para> 
        </listitem>

        <listitem>
          <para>
            View the Sanity Check (<xref linkend="sanitycheck"/>) page in your
            upgraded Bugzilla.
          </para>
          <para>
            It is recommended that, if possible, you fix any problems
            you see, immediately. Failure to do this may mean that Bugzilla
            will not work correctly. Be aware that if the sanity check page
            contains more errors after an upgrade, it doesn't necessarily
            mean there are more errors in your database than there were
            before, as additional tests are added to the sanity check over
            time, and it is possible that those errors weren't being
            checked for in the old version.
          </para>
        </listitem>
      </orderedlist>

    </section>
    
    <section id="upgrade-notifications">
      <title>Automatic Notifications of New Releases</title>

      <para>
        Bugzilla 3.0 introduced the ability to automatically notify
        administrators when new releases are available, based on the
        <literal>upgrade_notification</literal> parameter, see
        <xref linkend="parameters"/>. Administrators will see these
        notifications when they access the <filename>index.cgi</filename>
        page, i.e. generally when logging in. Bugzilla will check once per
        day for new releases, unless the parameter is set to
        <quote>disabled</quote>. If you are behind a proxy, you may have to set
        the <literal>proxy_url</literal> parameter accordingly. If the proxy
        requires authentication, use the
        <literal>http://user:pass@proxy_url/</literal> syntax.
      </para>
    </section>
  </section>

2486
</chapter>
2487 2488 2489 2490 2491

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-always-quote-attributes:t
2492 2493
sgml-auto-insert-required-elements:t
sgml-balanced-tag-edit:t
2494
sgml-exposed-tags:nil
2495 2496 2497
sgml-general-insert-case:lower
sgml-indent-data:t
sgml-indent-step:2
2498 2499
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
2500 2501 2502
sgml-minimize-attributes:nil
sgml-namecase-general:t
sgml-omittag:t
2503
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
2504 2505
sgml-shorttag:t
sgml-tag-region-if-active:t
2506 2507
End:
-->