1.修改bugzilla CPAN镜像源
vim ./Bugzilla/Install/CPAN.pm
http://mirrors.163.com/CPAN
http://mirror.qdu.edu.cn/CPAN/
http://cpan.dcc.uchile.cl/
http://mirrors.ustc.edu.cn/CPAN/
ftp://mirrors.xmu.edu.cn/CPAN/
http://mirrors.xmu.edu.cn/CPAN/
ftp://mirrors.sohu.com/CPAN/
ftp://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/
http://mirrors.btte.net/CPAN/
http://cpan.communilink.net/
ftp://mirror.communilink.net/CPAN/
http://mirrors.devlib.org/cpan/
http://cpan.pair.com/
http://mirror.hiwaay.net/CPAN/
ftp://ftp.dc.aleron.net/pub/CPAN
http://mirrors.kernel.org/cpan/
http://mirrors2.kernel.org/cpan/
2.生成需要安装的perl模块列表
./checksetup.pl --check-modules #提示必须安装的模块
./checksetup.pl --check-modules | grep 'not found' | egrep -v "DBD-Pg|DBD-SQLite|DBD-Oracle" | awk '{gsub("-","::",$3);m+=1;s[m]=$3}END{for(i in s) print "/usr/bin/perl install-module.pl "s[i]}' > a.sh
1. CGI (3.51)
2. Date::Format (2.21)
3. DateTime (0.28)
4. DateTime::TimeZone (0.71)
5. DBI (1.41)
6. DBD::mysql (4.001) if using MySQL
7. DBD::Pg (1.45) if using PostgreSQL
8. DBD::Oracle (1.19) if using Oracle
9. Digest::SHA (any)
10. Email::Send (2.00)
11. Email::MIME (1.904)
12. Template (2.22)
13. URI (1.37)
3.安装perl modules
/usr/bin/perl install-module.pl DateTime
/usr/bin/perl install-module.pl mod_perl2
/usr/bin/perl install-module.pl Apache::SizeLimit
/usr/bin/perl install-module.pl Encode::Detect
/usr/bin/perl install-module.pl Email::Reply
/usr/bin/perl install-module.pl Daemon::Generic
/usr/bin/perl install-module.pl Apache::SizeLimit
/usr/bin/perl install-module.pl Apache::SizeLimit
/usr/bin/perl install-module.pl Encode
/usr/bin/perl install-module.pl Apache2::SizeLimit
或者
/usr/bin/perl install-module.pl --all
nohup sh a.sh &
#确认安装成功
tail -f a.log
4.修改配置文件localconfig
vim ./localconfig
$db_name = 'bugs';
$db_user = 'abc';
$db_pass = 'abc';
执行./checksetup.pl自动按照localconfig配置apache和mysql
别忘此时设置的管理员密码
5.配置数据库
5.1下载bugzilla mysql scheme
http://www.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/
5.2配置my.cnf
[mysqld]
max_allowed_packet=4M
ft_min_word_len=2
5.3授权用户
GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
TO bugs@localhost IDENTIFIED BY 'abc';
GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
TO bugs@127.0.0.1 IDENTIFIED BY 'abc';
FLUSH PRIVILEGES;
5.4允许attachements table 表大于4GB
use bugs
ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;
6.配置web服务器
vim httpd.conf
Alias /bugs "/data/bugs"
<Directory /bugs>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>
<VirtualHost x.x.x.x:80>
ServerName bugs.xxxx.me
ErrorLog logs/bugs_error.log
CustomLog logs/bugs_access.log common
DocumentRoot /bugs
</VirtualHost>
注意:
Alias /username/ "path" 有可能让user找不到web page的风险,因此结论是:/username的后面不要加 / 符号!
双引号中的path,其写法最後可加/,也可不加 /。
7.配置cron作业
5 0 * * * cd /bugs/ && ./collectstats.pl #(配置bug画图)
*/15 * * * * cd /bugs/ && ./whine.pl #配置