版权声明:本文为博主原创文章,未经博主允许不得转载。

一 安装APACHE,MYSQL

  安装方法请参考  http://www.cnblogs.com/lcl0421/p/8028921.html

二 安装Mail Transfer Agent 终端运行命令:sudo apt-get install sendmail 或者安装postfix

1 sudo apt-get install postfix
2 tab键跳转到ok键

  

  3 回车,选择了默认(Internet Site),如下图: (不太懂啥意思)

  

  4 此处如何设置还不太清楚,我随便设置了一个邮箱

   

三 下载bugilla

  1. 下载地址: https://www.bugzilla.org/download/

  2. 解压: tar zxvf bugzilla5.0.3.tar.gz

  3. 放在/var/www/html/ 路径下:mv bugzilla5.0.3 /var/www/html/bugzilla

  4. 更改用户:sudo chown -R www-data:www-data /var/www/html/bugzilla

四 配置mysql服务器/创建bugs用户

 1. 终端运行命令 mysql -u root -p
  Enter password: 
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 44
  Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)

  Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

  Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  mysql> GRANT SELECT, INSERT,
  UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
  CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY 'password';
  mysql> FLUSH PRIVILEGES;
  mysql> quit
  Bye
  如下图所示:
  

  或者按如下方式创建数据库:

  create database bugs;

  grant all on bugs.* to root@localhost identified by "root";

  flush privileges;

  exit;

 2. 终端运行命令 cd /var/www/html/bugzilla ,运行命令 sudo ./checksetup.pl 自动安装组件 (必须联网,需要等一段时间,大概半个小时左右的样子 )

 3. 终端运行命令 sudo /usr/bin/perl install-module.pl --all  ,注意一定要加上sudo命令,不然会出错。   

 4. 再次运行,检查安装失败的组件 sudo ./checksetup.pl 

  最终显示如下:

  

五 修改localconfig

  1. 终端运行命令 cd /var/www/html/bugzilla ,然后运行命令 vi localconfig按如下设置编辑该文件

    $create_htaccess = 1;     

    $webservergroup = 'www-data';    

    $use_suexec = 0;     

    $db_driver = 'mysql';   

    $db_host = 'localhost';   

    $db_name = 'bugs';   

    $db_user = 'root';    

    $db_pass = 'password';   (填写设置的密码)

 

  2. 再次检查,终端运行命令 sudo ./checksetup.pl ,最终显示如下图

  

六 配置Apache服务器

  终端运行命令 sudo vi /etc/apache2/apache2.conf,添加以下代码

    <Directory /var/www/html/bugzilla> 

    AddHandler cgi-script .cgi

    Options +Indexes +ExecCGI

    DirectoryIndex index.cgi

    AllowOverride All

    </Directory>

七 重启Apache

  sudo service apache2 restart

八 访问http://127.0.0.1/bugzilla,显示如下

  

 九 邮箱配置
在bugzilla目录下的data\params文件中设置相关参数,要设置的参数有:

‘mail_delivery_method’,'mailfrom' ,‘maintainer’,'smtp_password','smtp_username','smtpserver'
其中'mailfrom'和'smtp_username'设置要一致,
'smtp_password'为邮箱的登录密码
示例:

   "mail_delivery_method" : "Sendmail",
   "mailfrom" : "chunli.li@watchdata.com",
   "maintainer" : "chunli.li@watchdata.com",

   "smtp_password" : "liechang123!"

   "smtp_username" : "chunli.li@watchdata.com",
   "smtpserver" : "smtp.watchdata.com",