Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程

时间2018-05-04

一、安装环境

操作系统Windows10

二、 安装过程中需要使用的软件

1. MySQL 数据库;

2. Strawberry Perl;

3. Navicat 使用它来更改了超级用户的密码;

4. Bugzilla 解压包;

5. Nodepad++ 手动修改一些文件的时候使用;

三、 安装设置 MySQL 数据库

1. MySQL数据库下载

下载地址: https://www.mysql.com/downloads/

2. MySQL数据库安装

我机器上有之前别人安装过的MySQL数据库,所以我跳过了下载、安装MySQL数据库这步。

具体的安装过程可参看https://wenku.baidu.com/view/7e2ee71c5fbfc77da369b19e.html

里面有图,很详细。

3. MySQL 版本查询

结论:我机器MySQL数据库的版本号:5.6.24-log MySQL Community Server(GPL)

我想知道机器上已安装的MySQL数据库的版本号,所以我查了一下:

方法一:

在“开始菜单”打开MySQL 5.6 Command Line Client窗口,输入MySQL数据库root用户的密码回车

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

显示了我安装的MySQL数据库的版本号

Server Version: 5.6.24-log MySQL Community Server(GPL)

方法二:

或者,调出CMD窗口,输入

mysql -u root –p,例如C:\Users\001>mysql -u root –p

输入root的密码,也可以看到Server Version: 5.6.24-log MySQL Community Server(GPL)

最后,输入exit回车,即可退出MySQL命令行。

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

方法三:

快捷键win+r,然后在运行对话框输入“cmd”,点击确定即可打开Dos命令行界面。

输入:C:\Users\001>mysql –version

mysql  Ver 14.14 Distrib 5.6.24, for Win64 (x86_64)

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

四、 安装Strawberry Perl

1. Strawberry Perl下载

下载地址: http://strawberryperl.com/

下载文件: Strawberry Perl 5.26.2.1 (64bit)

2. Strawberry Perl安装

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

安装路径:

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

3. Strawberry Perl是否安装成功

CMD窗口输入perl –v,例如 C:\Users\001>perl –v

输出如下,即安装成功

This is perl 5, version 26, subversion 2 (v5.26.2) built for MSWin32-x64-multi-thread

Copyright 1987-2018, Larry Wall

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

4. 判断Strawberry Perl的某个perl模块是否已经安装

Dos窗口输入perldoc  + 模块名字

例如,模块名字为Win32;C:\>perldoc Win32

若出现该模块的说明文档则说明该模块已安装。

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

备注:ActivePerl和Strawberry Perl的区别

首先,Perl 是一门语言, ActivePerl和Strawberry Perl 都是Perl 的编译器。

之所以选择安装Strawberry Perl ,没有用 ActivePerl是因为看了几个网页。

-如下-

<1>http://blog.waterlin.org/articles/strawberry-perl%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E4%BD%BF%E7%94%A8.html

<1>在Windows下刚开始使用Perl的人,很大部分都是用ActivePerl。但其实对于熟悉Linux环境下Perl编程的人来说,用Strawberry Perl会更加习惯。毕竟,ActivePerl的PPM包,更新得太慢了,如果需要自己手动编译CPAN的包,还不如用strawberry Perl来得放心呢!

<1>Strawberry Perl其实就是windows下的the core Windows distribution of Perl的一个版本。它尽可能地在Windows平台上保持了Perl在Unix上的特性,从而也最大程度地保证了可移植性。因此,CPAN上的包,在Strawberry Perl下很容易能编译通过。

<2>https://blog.csdn.net/oscar999/article/details/16855931

<2>ActiveState Perl和 Strawberry Perl最大的区别是 Strawberry Perl 里面有多包含一些 CPAN 里的模块, 所以Strawberry Perl 下载的安装文件有 80多M, 而ActiveState Perl 只有20M 左右。

然后看了<3>http://strawberryperl.com/ 下面两句话动心了:

<3>The Perl for MS Windows, free of charge! (完全开源。)

<3>Strawberry Perl is a perl environment for MS Windows containing all you need to run and develop perl applications. It is designed to be as close as possible to perl environment on UNIX systems.

但是,我忽视了,网页上以ActivePerl为组合来安装Bugzilla的文章比以Strawberry Perl为组合的文章多很多,这对于一个新手来说很重要。可能对于新手来说,还是选用ActivePerl更适合一些,毕竟,只是为了快点把Bugzilla跑起来而已。

最后,我还是没有用ActivePerl,因为懒得卸载Strawberry Perl还是一条路走到黑用Strawberry Perl作为组合完成了Bugzilla的安装。

五、 安装Bugzilla

1. Bugzilla下载

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

下载版本:Stable Release (5.0.4)

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

下载文件:bugzilla-5.0.4.tar.gz

2. Bugzilla安装

将Bugzilla安装包解压,在C盘下

我的解压路径C:\bugzilla\bugzilla-5.0.4

3. 安装参考文档:https://www.bugzilla.org/docs/

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

https://bugzilla.readthedocs.io/en/5.0/

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

https://bugzilla.readthedocs.io/en/latest/installing/

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

4. https://bugzilla.readthedocs.io/en/latest/installing/windows.html

我基本上,就是按照这个官方文档安装的。但因为写的比较简略,所以遇到问题了,又去参考的别的网页。

六、 安装Bugzilla需要的Perl Modules

1. 检查缺失的Perl Modules

使用Bugzilla自带的checksetup.pl来安装 bugzilla 所需的 perl 模块。

(checksetup.pl路径C:\bugzilla\bugzilla-5.0.4\)

checksetup.pl是Bugzilla的自动安装和升级程序,执行的操作包括检查必要的模块是否存在,可选的模块是否存在,配置运行环境,并升级数据库。

进入目录,C:\bugzilla\bugzilla-5.0.4

C:\bugzilla\bugzilla-5.0.4>perl checksetup.pl

运行checksetup.pl脚本。

显示出已安装的Perl Modules,以及未安装的Perl Modules,红色字体显示。

Checking perl modules…

Checking for              CGI.pm (v3.51)    ok: found v4.38

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

2. 安装缺失的Perl Modules的方法

1) C:\bugzilla\bugzilla-5.0.4>perl install-module.pl –all 

采用这种方法,安装了一些Perl Modules,但还有一些没安装上。

在C:\bugzilla\bugzilla-5.0.4 文件夹下,发现 install-module.pl文件,

Dos环境下,切换到Bugzilla的安装目录,C:\bugzilla\bugzilla-5.0.4>

并执行perl install-module.pl –all (Perl的脚本执行方法)

C:\bugzilla\bugzilla-5.0.4>perl install-module.pl –all 

<4> http://www.runoob.com/perl/perl-environment.html

<4> Perl 有不同的执行方式,

脚本执行

我们可以将 perl 代码放在脚本文件中,通过以下命令来执行文件代码:

C:>perl script.pl        # Windows/DOS

2) C:\>cpan Template::Plugin::GD::Image

使用这个方法,只有两个模块没装上mod_perl 和 Apache2::SizeLimit

最后这两个模块也没装上,但Bugzilla貌似不依赖这两个模块。

Dos窗口下,C:\>cpan Template::Plugin::GD::Image

七、 MySQL增加用户

1. MySQL 创建数据库

打开MySQL Command Line Client窗口,输入连接密码,敲击回车

连接密码 root;

mysql> create database bugs;

Query OK, 1 row affected (0.00 sec)

mysql> create database bugzilla;

Query OK, 1 row affected (0.00 sec)

2. MySQL 显示当前数据库服务器中的数据库列表

mysql> SHOW DATABASES;

看到创建的bugs数据库已经存在;

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

3. MySQL 创建用户

<5>https://bugzilla.readthedocs.io/en/latest/installing/mysql.html#mysql

<5>You need to add a new MySQL user for Bugzilla to use. Run the mysql command-line client and enter:

GRANT SELECT, INSERT,

UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,

CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*

TO bugs@localhost IDENTIFIED BY ‘$DB_PASS’;

$DB_PASS,替换成bugs用户的密码即可;

例如,我修改$db_pass为’vrfactory’;

FLUSH PRIVILEGES; 为用户bugs授权

localconfig文件修改完毕后,保存,重新运行perl checksetup.pl。

这次,与数据库连接的测试即可通过,并会自动创建一些目录,提示输入邮件服务器、邮箱地址等,按照要求输入即可。

    注意:即使这次的邮件服务器、邮箱地址、密码都输入正确,之后也不能正确地发送邮件,还需要按照后面的步骤手动修改一些配置。

4. 修改MySQL 的配置文件

配置文件位置:Windows: C:\mysql\bin\my.ini

按下面的文档进行配置:

<5>https://bugzilla.readthedocs.io/en/latest/installing/mysql.html#mysql

<5>3.6.1.3. Change Configuration

To change MySQL’s configuration, you need to edit your MySQL configuration file, which is:

Windows: C:\mysql\bin\my.ini

Allow Large Attachments and Many Comments

[mysqld]

# Allow packets up to 16M

max_allowed_packet=16M

 Allow Small Words in Full-Text Indexes

[mysqld]

# Allow small words in full-text indexes

ft_min_word_len=2

Permit Attachments Table to Grow Beyond 4GB

USE $bugs_db;

ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;

八、 Web服务器 IIS服务器

1. Windows10操作系统下,配置IIS服务器

打开控制面板–程序和功能–打开或关闭windows功能–Internet信息服务,把所有选项勾上,点击确定.

<6>https://jingyan.baidu.com/article/eb9f7b6d9e73d1869364e8d8.html

<6>选择Internet Information Services,如下勾选项目

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

BugZilla是cgi写的,后台解释器是Perl,安装IIS的时候注意一定要勾选CGI模块解释器

所以,在安装IIS7的时候,一定要勾选CGI模块解释器!

选择完成后点击确定,等进度条完成即可。

我的电脑是英文版本的所以截图如下:

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

2. Windows10操作系统下,使用IIS服务器

在我的电脑右击,选择管理

如图所示,在服务引用程序 中可以看到 Internet Information Services

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

3. IIS在默认网站中添加虚拟目录

<8> http://blog.sina.com.cn/s/blog_6579ca2e0102wvi8.html

<8>打开控制面板–管理工具–Internet信息服务管理器,选择网站–默认网站,右键选择添加虚拟目录

设置别名:bugzilla;

设置物理路径,选择bugzilla的安装路径,我的机器是C:\bugzilla\bugzilla-5.0.4

然后点击确定。

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

<8>点击bugzilla目录,版面右边出现,bugzilla主页,点击IIS下的“默认文档”,操作“添加”,名称是“index.cgi”。

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》
《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

<8>同样在bugzilla主页,点击IIS下的“处理程序映射”,操作“添加脚本映射”,进入界面,

–设置请求路径:*.cgi

–可执行文件:

StrawBerryPerl的安装路径\bin\perl.exe -T “%s” %s

我的机器:C:\Strawberry\perl\bin\perl.exe  -T  “%s”  %s

–名称可随便填写:strawberry

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》
《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》
《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

4. 改变IIS端口

IIS缺省的端口是80,可以根据需要更改。

<7>https://jingyan.baidu.com/article/ce09321b72030d2bff858ffc.html

<7>点击进IIS管理器,右击网站目录,点击编辑绑定

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》
《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

我设置的是8010

5. 测试IIS页面是否可以出现

以上配置完成后,就可以用浏览器的方式访问Bugzilla了。

注意,要启动IIS服务start,再输入地址:http://localhost:8010/iisstart.htm),出现,IIS页面

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

6. 显示Bugzilla登录页面

http://ip地址:端口号/bugzilla

我的机器http://localhost:8010/bugzilla/

出现bugzilla登录界面:

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

九、 Navicat

出现Bugzilla登录页之后,我突然发现,我不记得我输入超级管理员,带有@的用户名了,

使用navcat,来登陆bugzilla的mysql数据库:

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

可以看见,bugs里面已经有好几个表了:

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

打开Mysql中的bugs数据库,打开profiles表,看到我忘记的邮箱用户名123@qq.com

使用checksetup.pl –reset-password=user@domain.com重置超级管理员密码;

Dos窗口下输入C:\bugzilla\bugzilla-5.0.4> perl checksetup.pl –reset-password=123@qq.com

重置超级管理员密码。

使用超级管理员登录,即可以使用Bugzilla了!!!

十、 参考网页资料

虽然文章里也使用<数字>标出了一些引文,但是最主要的引文还是单独写一下吧:

参考中文网页:

1. 总体上参考:https://wenku.baidu.com/view/7e2ee71c5fbfc77da369b19e.html

2. 总体上参考:https://blog.csdn.net/ll365/article/details/42680011

参考英文网页:

1. Bugzilla 官网:https://www.bugzilla.org/

十一、 感谢

在此过程中,经常有安装不下去的情况,幸好有同事给予了精准的帮助,帮我确定关键思路,得以安装成功。非常感谢!

终于写完了,先休息一下~~

《Win10 + Bugzilla + Mysql + + Strawberry Perl + perl 模块 + iis安装过程》

    原文作者:skybirth
    原文地址: https://www.jianshu.com/p/5ef1b6765a6b
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞