* @license GNU General Public License, version 2 (GPL-2.0) * * For full copyright and license information, please see * the docs/CREDITS.txt file. * */ namespace phpbb\filesystem; /** * Interface for phpBB's filesystem service */ interface filesystem_interface { /** * chmod all permissions flag * * @var int */ const CHMOD_ALL = 7; /** * chmod read permissions flag * * @var int */ const CHMOD_READ = 4; /** * chmod write permissions flag * * @var int */ const CHMOD_WRITE = 2; /** * chmod execute permissions flag * * @var int */ const CHMOD_EXECUTE = 1; /** * Change owner group of files/directories * * @param string|array|\Traversable $files The file(s)/directorie(s) to change group * @param string $group The group that should own the files/directories * @param bool $recursive If the group should be changed recursively * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function chgrp($files, $group, $recursive = false); /** * Global function for chmodding directories and files for internal use * * The function accepts filesystem_interface::CHMOD_ flags in the permission argument * or the user can specify octal values (or any integer if it makes sense). All directories will have * an execution bit appended, if the user group (owner, group or other) has any bit specified. * * @param string|array|\Traversable $files The file/directory to be chmodded * @param int $perms Permissions to set * @param bool $recursive If the permissions should be changed recursively * @param bool $force_chmod_link Try to apply permissions to symlinks as well * * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function chmod($files, $perms = null, $recursive = false, $force_chmod_link = false); /** * Change owner group of files/directories * * @param string|array|\Traversable $files The file(s)/directorie(s) to change group * @param string $user The owner user name * @param bool $recursive Whether change the owner recursively or not * * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function chown($files, $user, $recursive = false); /** * Eliminates useless . and .. components from specified path. * * @param string $path Path to clean * * @return string Cleaned path */ public function clean_path($path); /** * Copies a file. * * This method only copies the file if the origin file is newer than the target file. * * By default, if the target already exists, it is not overridden. * * @param string $origin_file The original filename * @param string $target_file The target filename * @param bool $override Whether to override an existing file or not * * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be copied */ public function copy($origin_file, $target_file, $override = false); /** * Atomically dumps content into a file. * * @param string $filename The file to be written to. * @param string $content The data to write into the file. * * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be written */ public function dump_file($filename, $content); /** * Checks the existence of files or directories. * * @param string|array|\Traversable $files files/directories to check * * @return bool Returns true if all files/directories exist, false otherwise */ public function exists($files); /** * Checks if a path is absolute or not * * @param string $path Path to check * * @return bool true if the path is absolute, false otherwise */ public function is_absolute_path($path); /** * Checks if files/directories are readable * * @param string|array|\Traversable $files files/directories to check * @param bool $recursive Whether or not directories should be checked recursively * * @return bool True when the files/directories are readable, otherwise false. */ public function is_readable($files, $recursive = false); /** * Test if a file/directory is writable * * @param string|array|\Traversable $files files/directories to perform write test on * @param bool $recursive Whether or not directories should be checked recursively * * @return bool True when the files/directories are writable, otherwise false. */ public function is_writable($files, $recursive = false); /** * Given an existing path, convert it to a path relative to a given starting path * * @param string $end_path Absolute path of target * @param string $start_path Absolute path where traversal begins * * @return string Path of target relative to starting path */ public function make_path_relative($end_path, $start_path); /** * Mirrors a directory to another. * * @param string $origin_dir The origin directory * @param string $target_dir The target directory * @param \Traversable $iterator A Traversable instance * @param array $options An array of boolean options * Valid options are: * - $options['override'] Whether to override an existing file on copy or not (see copy()) * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink()) * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) * * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be copied. * The filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function mirror($origin_dir, $target_dir, \Traversable $iterator = null, $options = array()); /** * Creates a directory recursively. * * @param string|array|\Traversable $dirs The directory path * @param int $mode The directory mode * * @throws \phpbb\filesystem\exception\filesystem_exception On any directory creation failure * The filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function mkdir($dirs, $mode = 0777); /** * Global function for chmodding directories and files for internal use * * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. * The function determines owner and group from common.php file and sets the same to the provided file. * The function uses bit fields to build the permissions. * The function sets the appropiate execute bit on directories. * * Supported constants representing bit fields are: * * filesystem_interface::CHMOD_ALL - all permissions (7) * filesystem_interface::CHMOD_READ - read permission (4) * filesystem_interface::CHMOD_WRITE - write permission (2) * filesystem_interface::CHMOD_EXECUTE - execute permission (1) * * NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions. * * @param string|array|\Traversable $file The file/directory to be chmodded * @param int $perms Permissions to set * @param bool $recursive If the permissions should be changed recursively * @param bool $force_chmod_link Try to apply permissions to symlinks as well * * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function phpbb_chmod($file, $perms = null, $recursive = false, $force_chmod_link = false); /** * A wrapper for PHP's realpath * * Try to resolve realpath when PHP's realpath is not available, or * known to be buggy. * * @param string $path Path to resolve * * @return string Resolved path */ public function realpath($path); /** * Removes files or directories. * * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove * * @throws \phpbb\filesystem\exception\filesystem_exception When removal fails. * The filename which triggered the error can be * retrieved by filesystem_exception::get_filename() */ public function remove($files); /** * Renames a file or a directory. * * @param string $origin The origin filename or directory * @param string $target The new filename or directory * @param bool $overwrite Whether to overwrite the target if it already exists * * @throws \phpbb\filesystem\exception\filesystem_exception When target file or directory already exists, * or origin cannot be renamed. */ public function rename($origin, $target, $overwrite = false); /** * Creates a symbolic link or copy a directory. * * @param string $origin_dir The origin directory path * @param string $target_dir The symbolic link name * @param bool $copy_on_windows Whether to copy files if on Windows * * @throws \phpbb\filesystem\exception\filesystem_exception When symlink fails */ public function symlink($origin_dir, $target_dir, $copy_on_windows = false); /** * Sets access and modification time of file. * * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create * @param int $time The touch time as a Unix timestamp * @param int $access_time The access time as a Unix timestamp * * @throws \phpbb\filesystem\exception\filesystem_exception When touch fails */ public function touch($files, $time = null, $access_time = null); } >228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 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 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 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 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 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 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 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 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 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 1252 1253 1254 1255 1256 1257 1258 1259 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 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 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 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 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 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 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 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 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 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
<!-- $Id: installation.xml,v 1.101 2005/07/25 12:50:49 mozilla%colinogilvie.co.uk Exp $ -->
<chapter id="installing-bugzilla">
  <title>Installing Bugzilla</title>

  <section id="installation">
    <title>Installation</title>

    <note>
      <para>If you just want to <emphasis>use</emphasis> Bugzilla, 
      you do not need to install it. None of this chapter is relevant to
      you. Ask your Bugzilla administrator
      for the URL to access it over the web.
      </para>
    </note>

    <para>The Bugzilla server software is usually installed on Linux or 
    Solaris. 
    If you are installing on another OS, check <xref linkend="os-specific"/>
    before you start your installation to see if there are any special
    instructions.
    </para>

    <para>
      As an alternative to following these instructions, you may wish to
      try Arne Schirmacher's unofficial and unsupported 
      <ulink url="http://www.softwaretesting.de/article/view/33/1/8/">Bugzilla
      Installer</ulink>, which installs Bugzilla and all its prerequisites
      on Linux or Solaris systems.
    </para>

    <para>This guide assumes that you have administrative access to the
    Bugzilla machine. It not possible to
    install and run Bugzilla itself without administrative access except
    in the very unlikely event that every single prerequisite is
    already installed.
    </para>

    <warning>
      <para>The installation process may make your machine insecure for
      short periods of time. Make sure there is a firewall between you
      and the Internet.
      </para>
    </warning>

    <para>
    You are strongly recommended to make a backup of your system
    before installing Bugzilla (and at regular intervals thereafter :-).
    </para>

    <para>In outline, the installation proceeds as follows:
    </para>

    <procedure>
      <step>
        <para><link linkend="install-perl">Install Perl</link>
        (&min-perl-ver; or above for non-Windows platforms; &min-perl-ver-win;
        for Windows)
        </para>
      </step>
      <step>
        <para><link linkend="install-database">Install a Database Engine</link>
        </para>
      </step>
      <step>
        <para><link linkend="install-webserver">Install a Webserver</link>
        </para>
      </step>
      <step>
        <para><link linkend="install-bzfiles">Install Bugzilla</link>
        </para>
      </step>
      <step>
        <para><link linkend="install-perlmodules">Install Perl modules</link>
        </para>
      </step>
      <step>
        <para>
          <link linkend="install-MTA">Install a Mail Transfer Agent</link>
          (Sendmail 8.7 or above, or an MTA that is Sendmail-compatible with at least this version)
        </para>
      </step>
      <step>
        <para>Configure all of the above.
        </para>
      </step>
    </procedure>

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

      <para>Installed Version Test: <filename>perl -v</filename></para>
      
      <para>Any machine that doesn't have Perl on it is a sad machine indeed.
      If you don't have it and your OS doesn't provide official packages, 
      visit <ulink url="http://www.perl.com"/>.
      Although Bugzilla runs with Perl &min-perl-ver;,
      it's a good idea to be using the latest stable version. 
      </para>
    </section>

    <section id="install-database">
      <title>Database Engine</title>
      
      <para>From Bugzilla 2.20, support is included for using both the MySQL and
      PostgreSQL database servers. You only require one of these systems to make
      use of Bugzilla.</para>

      <section id="install-mysql">
          <title>MySQL</title>
          <para>Installed Version Test: <filename>mysql -V</filename></para>
      
          <para>
          If you don't have it and your OS doesn't provide official packages, 
          visit <ulink url="http://www.mysql.com"/>. You need MySQL version
          &min-mysql-ver; or higher.
          </para>
      
          <note>
            <para> Many of the binary
            versions of MySQL store their data files in 
            <filename class="directory">/var</filename>.
            On some Unix systems, this is part of a smaller root partition,
            and may not have room for your bug database. To change the data
            directory, you have to build MySQL from source yourself, and
            set it as an option to <filename>configure</filename>.</para>
          </note> 
           
          <para>If you install from something other than a packaging/installation
          system, such as .rpm (Redhat Package), .deb (Debian Package), .exe
          (Windows Executable), or .msi (Microsoft Installer), make sure the MySQL
          server is started when the machine boots.
          </para>
      </section>
      
      <section id="install-pg">
          <title>PostgreSQL</title>
          <para>Installed Version Test: <filename>psql -V</filename></para>
      
          <para>
          If you don't have it and your OS doesn't provide official packages, 
          visit <ulink url="http://www.postgresql.org/"/>. You need PostgreSQL
          version &min-pg-ver; or higher.
          </para>
           
          <para>If you install from something other than a packaging/installation
          system, such as .rpm (Redhat Package), .deb (Debian Package), .exe
          (Windows Executable), or .msi (Microsoft Installer), make sure the
          PostgreSQL server is started when the machine boots.
          </para>
      </section>
      
    </section>
    
    <section id="install-webserver">
      <title>Web Server</title>

      <para>Installed Version Test: view the default welcome page at
      http://&lt;your-machine&gt;/</para>
      
      <para>You have freedom of choice here, pretty much any web server that
      is capable of running <glossterm linkend="gloss-cgi">CGI</glossterm>
      scripts will work.
       However, we strongly recommend using the Apache web server
       (either 1.3.x or 2.x), and 
       the installation instructions usually assume you are
        using it. If you have got Bugzilla working using another webserver,
        please share your experiences with us by filing a bug in &bzg-bugs;.
      </para>
      
      <para>
      If you don't have Apache and your OS doesn't provide official packages, 
      visit <ulink url="http://httpd.apache.org/"/>.
      </para>

    </section>

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

      <para>
        Download a Bugzilla tarball (or check it out from CVS) and place
        it in a suitable directory, accessible by the default web server user 
        (probably <quote>apache</quote> or <quote>www</quote>). 
        Good locations are either directly in the main web space for your
        web server or perhaps in 
        <filename>/usr/local</filename>
        with a symbolic link from the web space.
      </para>

      <caution>
        <para>The default Bugzilla distribution is NOT designed to be placed
        in a <filename class="directory">cgi-bin</filename> directory. This
        includes any directory which is configured using the
        <option>ScriptAlias</option> directive of Apache.
        </para>
      </caution>
      
      <para>Once all the files are in a web accessible directory, make that
      directory writable by your webserver's user. This is a temporary step
      until you run the 
      <filename>checksetup.pl</filename>
      script, which locks down your installation.</para>
    </section>

    <section id="install-perlmodules">
      <title>Perl Modules</title>
      
      <para>Bugzilla's installation process is based
      on a script called <filename>checksetup.pl</filename>. 
      The first thing it checks is whether you have appropriate 
      versions of all the required
      Perl modules. The aim of this section is to pass this check. 
      When it passes, 
      <emphasis>do not run it again</emphasis>, 
      but proceed to <xref linkend="configuration"/>.
      </para>
      
      <para>
      At this point, you need to <filename>su</filename> to root. You should
      remain as root until the end of the install. To check you have the
      required modules, run:
      </para>
      
      <screen><prompt>bash#</prompt> ./checksetup.pl --check-modules</screen>
 
      <para>
        <filename>checksetup.pl</filename> will print out a list of the
        required and optional Perl modules, together with the versions
        (if any) installed on your machine.
        The list of required modules is reasonably long; however, you 
        may already have several of them installed.
      </para>
      
      <para>
        There is a meta-module called Bundle::Bugzilla, 
        which installs all the other 
        modules with a single command. You should use this if you are running
        Perl 5.6.1 or above.
      </para>
      
      <para>
        The preferred way of installing Perl modules is via CPAN on Unix, 
        or PPM on Windows (see <xref linkend="win32-perl-modules"/>). These
        instructions assume you are using CPAN; if for some reason you need 
        to install the Perl modules manually, see 
        <xref linkend="install-perlmodules-manual"/>.
      </para>  
        
      <screen><prompt>bash#</prompt> perl -MCPAN -e 'install "&lt;modulename&gt;"'</screen>

      <para>
        If you using Bundle::Bugzilla, invoke the magic CPAN command on it.
        Otherwise, you need to work down the 
        list of modules that <filename>checksetup.pl</filename> says are
        required, in the order given, invoking the command on each.
      </para>
      
      <tip>
        <para>Many people complain that Perl modules will not install for
        them. Most times, the error messages complain that they are missing a
        file in 
        <quote>@INC</quote>. 
        Virtually every time, this error is due to permissions being set too
        restrictively for you to compile Perl modules or not having the
        necessary Perl development libraries installed on your system.
        Consult your local UNIX systems administrator for help solving these
        permissions issues; if you 
        <emphasis>are</emphasis>
        the local UNIX sysadmin, please consult the newsgroup/mailing list
        for further assistance or hire someone to help you out.</para>
      </tip>

      <note>
        <para>If you are using a package-based system, and attempting to install the
        Perl modules from CPAN, you may need to install the "development" packages for
        MySQL and GD before attempting to install the related Perl modules. The names of
        these packages will vary depending on the specific distribution you are using,
        but are often called <filename>&lt;packagename&gt;-devel</filename>.</para>
      </note>
 
      <para>
        Here is a complete list of modules and their minimum versions.
        Some modules have special installation notes, which follow.
      </para>

      <para>Required Perl modules:
      <orderedlist>

        <listitem>
          <para>
            AppConfig (&min-appconfig-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            CGI (&min-cgi-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            Data::Dumper (&min-data-dumper-ver;)
          </para>
        </listitem>
    
        <listitem>
          <para>
            Date::Format (&min-date-format-ver;)
          </para>
        </listitem>
    
        <listitem>
          <para>
            DBI (&min-dbi-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-dbd-mysql">DBD::mysql</link>
            (&min-dbd-mysql-ver;) if using MySQL
          </para>
        </listitem>
        
        <listitem>
          <para>
            DBD::Pg (&min-dbd-pg-ver;) if using PostgreSQL
          </para>
        </listitem>

        <listitem>
          <para>
            File::Spec (&min-file-spec-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            File::Temp (&min-file-temp-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-template">Template</link>
            (&min-template-ver;)
          </para>
        </listitem>

        <listitem>
          <para>
            Text::Wrap (&min-text-wrap-ver;)
          </para>
        </listitem>
        
        <listitem>
          <para>
            Mail::Mailer (&min-mail-mailer-ver;)
          </para>
        </listitem>
        
        <listitem>
          <para>
            Storable (&min-storable-ver;)
          </para>
        </listitem>
      </orderedlist>

      Optional Perl modules:
      <orderedlist>  
        <listitem>
          <para>
            <link linkend="install-modules-gd">GD</link>
            (&min-gd-ver;) for bug charting
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-chart-base">Chart::Base</link>
            (&min-chart-base-ver;) for bug charting
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-gd-graph">GD::Graph</link>
            (&min-gd-graph-ver;) for bug charting
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-gd-text-align">GD::Text::Align</link>
            (&min-gd-text-align-ver;) for bug charting
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-xml-parser">XML::Parser</link>
            (&min-xml-parser-ver;) for the XML interface
          </para>
        </listitem>

        <listitem>
          <para>
            <link linkend="install-modules-patchreader">PatchReader</link>
            (&min-patchreader-ver;) for pretty HTML view of patches
          </para>
        </listitem>
        
        <listitem>
          <para>
            <link linkend="install-modules-mime-parser">MIME::Parser</link>
            (&min-mime-parser-ver;) for the optional email interface
          </para>
        </listitem>
      </orderedlist>          
      </para>

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

        <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>

        <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>

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

        <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> 

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

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

        <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>

        <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>

      <section id="install-modules-chart-base">
        <title>Chart::Base (&min-chart-base-ver;)</title>

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

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

        <para>The GD::Graph module is only required if you want graphical 
        reports.
        </para>
      </section>

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

        <para>The GD::Text::Align module is only required if you want graphical 
        reports.
        </para>
      </section>

      <section id="install-modules-xml-parser">
        <title>XML::Parser (&min-xml-parser-ver;)</title>

        <para>The XML::Parser module is only required if you want to import
        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.
        XML::Parser requires that the
        <classname>expat</classname> library is already installed on your machine.
        </para>
      </section>

      <section id="install-modules-mime-parser">
        <title>MIME::Parser (&min-mime-parser-ver;)</title>

        <para>The MIME::Parser module is only required if you want to use the 
        email interface
        located in the <filename class="directory">contrib</filename> directory.
        </para>
      </section>

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

        <para>The PatchReader module is only required if you want to use 
        Patch Viewer, a
        Bugzilla feature to show code patches in your web browser in a more
        readable form. 
        </para>
      </section>
    </section>    
    <section id="install-MTA">
      <title>Mail Transfer Agent (MTA)</title>
    
      <para>Bugzilla is dependent on the availability of an e-mail system for its user
      authentication and for other tasks. </para>
    
      <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 that Bugzilla
      will not distinguish between them.</para>

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

      <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>
    </section>  
  </section>
  
  
  <section id="configuration">
    <title>Configuration</title>

    <warning>
      <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>      
    </warning>

    <section id="localconfig">
      <title>localconfig</title>
      
      <para>
        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.
      </para>
      
      <para>
        Load this file in your editor. The only value you 
        <emphasis>need</emphasis> to change is $db_pass, the password for
        the user you will create for your database. Pick a strong
        password (for simplicity, it should not contain single quote
        characters) and put it here.
      </para>
      
      <para>
        The other options in the <filename>localconfig</filename> file
        are documented by their accompanying comments. If you have a slightly
        non-standard MySQL setup, you may wish to change one or more of
        the other "$db_*" parameters. 
      </para>
      
      <para>
        You may also wish to change the names of 
        the priorities, severities, operating systems and platforms for your
        installation. However, you can always change these after installation
        has finished; if you then re-run <filename>checksetup.pl</filename>,
        the changes will get picked up.
      </para>
    </section>
    
    <section id="mysql">
      <title>MySQL</title>

      <caution>
        <para>
          MySQL's default configuration is very insecure.
          <xref linkend="security-mysql"/> has some good information for
          improving your installation's security.
        </para>
      </caution>
     
      <section id="install-setupdatabase">
        <title>Allow large attachments</title>
        
        <para>
          By default, MySQL will only accept packets up to 64Kb in size.
          If you want to have attachments larger than this, you will need
          to modify your <filename>/etc/my.cnf</filename> as below.
        </para>

        <para>
          If you are using MySQL 4.0 or newer, enter:
        </para>
        <screen>  [mysqld]
  # Allow packets up to 1M
  max_allowed_packet=1M</screen>

        <para>
          If you are using an older version of MySQL, enter:
        </para>
        <screen>  [mysqld]
  # Allow packets up to 1M
  set-variable = max_allowed_packet=1M</screen>

        <para>
          There is also a parameter in Bugzilla called 'maxattachmentsize'
          (default = 1000 Kb) that controls the maximum allowable attachment
          size. Attachments larger than <emphasis>either</emphasis> the 
          'max_allowed_packet' or 'maxattachmentsize' value will not be
          accepted by Bugzilla.
        </para>

        <note>
          <para>
            This does not affect Big Files, attachments that are stored directly
            on disk instead of in the database.  Their maximum size is
            controlled using the 'maxlocalattachment' parameter.
          </para>
        </note>
      </section>



      <section>
        <title>Allow small words in full-text indexes</title>

        <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>

        <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>

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

        <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>

        <note>
          <para>
            The ft_min_word_len parameter is only suported in MySQL v4 or higher.
          </para>
        </note>
      </section>

      <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>
          Run the <filename>MySQL</filename> command-line client and
          enter:
        </para>

        <screen>  <prompt>mysql&gt;</prompt> ALTER TABLE attachments 
          AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
        </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>
            
      <section id="install-setupdatabase-adduser">
        <title>Add a user to MySQL</title>

        <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>

        <para>
          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.
        </para>
        
        <para>
          Run the <filename>mysql</filename> command-line client.
        </para>

        <para>
          If you are using MySQL 4.0 or newer, enter:
        </para>

        <screen>  <prompt>mysql&gt;</prompt> GRANT SELECT, INSERT,
         UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
         CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
         TO bugs@localhost IDENTIFIED BY '<replaceable>$db_pass</replaceable>';
  <prompt>mysql&gt;</prompt> FLUSH PRIVILEGES;</screen>

        <para>
          If you are using an older version of MySQL,the
          <computeroutput>LOCK TABLES</computeroutput> and 
          <computeroutput>CREATE TEMPORARY TABLES</computeroutput>
          permissions will be unavailable and should be removed from
          the permissions list. In this case, the following command
          line can be used:
        </para>

        <screen>  <prompt>mysql&gt;</prompt> GRANT SELECT, INSERT,
         UPDATE, DELETE, INDEX, ALTER, CREATE, DROP,
         REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY
         '<replaceable>$db_pass</replaceable>';
  <prompt>mysql&gt;</prompt> FLUSH PRIVILEGES;</screen>
      </section>      
    </section>

    <section>
      <title>checksetup.pl</title>

      <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>

      <para>
        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.
      </para>
      
      <para>
        <filename>checksetup.pl</filename> will then finish. You may rerun
        <filename>checksetup.pl</filename> at any time if you wish.
      </para>
    </section>


    <section id="http">
      <title>Web server</title>
      <para>
        Configure your web server according to the instructions in the
        appropriate section. (If it makes a difference in your choice,
        the Bugzilla Team recommends Apache.) Regardless of which webserver
        you are using, however, ensure that sensitive information is
        not remotely available by properly applying the access controls in
        <xref linkend="security-webserver-access"/>.
      </para>

      <section id="http-apache">
        <title>Apache <productname>httpd</productname></title>

        <para>
          To configure your Apache web server to work with Bugzilla,
          do the following:
        </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>
              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>
          </step>                    

          <step>
            <para>
              <filename>checksetup.pl</filename> can set tighter permissions
              on Bugzilla's files and directories if it knows what group the
              webserver runs as. Find the <computeroutput>Group</computeroutput>
              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>

          <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-iis">
        <title>Microsoft <productname>Internet Information Services</productname></title>

        <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
            Bugzilla's .pl files are not designed to be run via a webserver.
          </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.
        </para>

        <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"/>.
        </para>

      </section>

      <section id="http-aol">
        <title>AOL Server</title>

        <para>Ben FrantzDale reported success using AOL Server with Bugzilla. He