Win7系统搭建4.4.6—Bugzilla平台
create database bugs; 创建一个数据库bugs
create user bugs@localhost; 创建一个用户bugs
grant all on bugs.* to bugs@'localhost'; 为用户bugs授权
flush privileges; 刷新用户权限
ActivePerl:
下载ActivePerl,默认安装,这里遇到的问题是安装perl模块,安装perl模块使用命令ppm install xxx(必须联网);如果使用代理服务器或者启用防火墙,使用ppm将出现问题;如果安装不上,安装进度条不动了,可以换其他版本。
安装好后,在命令行运行C:\>ppm upgrade --install; 接着分别运行命令:ppm install AppConfig、 ppm install TimeDate、ppm install DBI 、ppm install DBD-mysql、ppm install Template-Toolkit、 ppm install MailTools、ppm install GD、ppm install Chart、ppm install GDGraph、ppm install PatchReader、ppm install Net-LDAP-Express;
Apache:
默认安装Apache,编辑C:\Program Files\Apache Grounp\Apache2\conf\httpd.conf,如果用NodePad等编辑工具编辑完后保持,弹出用另一程序占用不能保存,可以退出,使用管理员用户重新开启NodePad在保存;需要编辑的内容如下:
# # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses (0.0.0.0) # #Listen 12.34.56.78:80 Listen 80
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "C:/Bugzilla" # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride None </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # <Directory "C:/Bugzilla">
# AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # AddHandler cgi-script .cgi
# # This should be changed to whatever you set DocumentRoot to. # <Directory "C:/Bugzilla"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs-2.0/mod/core.html#options # for more information. # Options Indexes FollowSymLinks ExecCGI # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all # # Tell Apache to use Perl to execute .cgi # ScriptInterpreterSource Registry-Strict </Directory>
# # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # # The index.html.var file (a type-map) is used to deliver content- # negotiated documents. The MultiViews Option can be used for the # same purpose, but it is much slower. # DirectoryIndex index.html index.html.var index.cgi为了使 ScriptInterpreterSource Registry-Strict 能够工作,还需要在注册表中增加一条信息:
创建一个Key值:HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command,在HKEY_CLASSES_ROOT下创建新项.cgi等,注意这些拼写不能出错,将Perl.exe的完整安装路径加上一个-T参数作为Command的默认值,如:C:\Perl\bin\perl.exe -T,这样apacheWeb服务器就配置好了,配置好后需要重新启动Apache。
配置Bugzilla:
在命令行中转到bugzilla目录下C:\bugzilla运行命令checksetup.pl;C:\bugzilla>checksetup.pl
可以看到还有好多perl模块没有安装,将所有命令运行一遍,没有就跳过,一些模块有依赖性,必须先装完后面的前面的才能装,运行一遍后,再装前面的最后剩下几个实在装不了也没关系,最重要的是必须安装所有必选项。
我的这些模块没装上;之后在bugzilla目录下会生成一个localconfig文件,编辑该文件,修改参数:db_port = 3306,index_html =1;修改之后保存再次运行checksetup.pl,系统会自动生成bugzilla所需的数据库表,并需要输入一些个人信息。
Looks like we don't have an administrator set up yet. Either this is your first time using Bugzilla, or your administrator's privileges might have accidently been deleted. Enter the e-mail address of the administrator: byron@example.com 必须是一个可用的邮箱地址 You entered 'byron@example.com'. Is this correct? [Y/n] y Enter the real name of the administrator: Byron Jones 随便 Enter a password for the administrator account: beef 随便 Please retype the password to verify: beef 'byron@example.com' is now set up as an administrator account.
这样bugzilla基本就安装完成了,打开浏览器输入http://localhost;便可以看到bugzilla的主页面了。之后还需要做一些设置,用checksetup时设置的用户名和密码登入后,去parameters页面设置url_base,设置http://本机IP:80/,别忘了结尾的/符号。
为了可以发送Email,还需要设置smtp服务器,用户名、密码,这里的问题最多;
我使用的是内部邮箱服务器,可以用,但是只能内部之间发送邮件。
这是网上搜到的一个案例
There was an error sending mail from 'bugzilla-daemon@' to '123@163.com': Can't call method "address" on an undefined value at C:/Perl/site/lib/Email/Send/SMTP.pm line 25.
Email::MIME::CreatorBUGZILLA里自带的有SMTP,只要SMTP能够通过认证就可以了,所以第三方,以及代码什么都不用修改,只要设置params里面的参数就可以了!
在..\data\params设置如下参数:
maintainer : 123@163.com
mail_delivery_method : SMTP
mailfrom : 123@163.com
sendmailnow: on
smtpserver : smtp.163.com
smtp_username: 123@163.com
smtp_password : **********
注意:maintainer、mailfrom必须相同!smtp_username邮箱必须是存在的真实的邮箱,smtp_password必须是你真实邮箱的真实密码(要与你所登陆邮箱时的密码相同)!邮件已经发送成功!如果还有不能连接等问题,只能说明你的邮箱和密码有问题!