小蚂蚁  
风雨过后才见彩虹
公告

  • —————————————
    李丽君
    软件测试工作者
    广东籍贯的海南人
    北京生活12年
    目前在深圳

    邮箱:
    llj2003hbdd@163.com
    —————————————
    说明:本Blog中的内容均为本人原创或转载,本人依法保留Blog内原创文章的所有权利,如需转载,请注明作者及出处。未经许可,不得将本Blog内文章用于任何盈利性用途。
    —————————————
日历
<2012年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

导航

常用链接

留言簿(117)

随笔分类(188)

0--感兴趣的网站

1--国内测试网站

2--测试同行的blog

3--开发好友的blog

最新评论

 

编写背景:
   这几天开始梳理和总结测试环境维护管理方面的工作,bugzilla和Testlink也该升级了,找了台机器重新安装这两个软件,先试试;顺带整理相关安装文档给测试人员进行安装学习并录像,便于以后要用或培训时可以拿出来分享。放在这里希望对测试新手有帮助。


参考资料:http://3708841.blog.51cto.com/3698841/1020932
安装环境:redhat enterprise linux 5 + mysql-5.5.27+httpd-2.2.23+bugzilla-4.2.3
安装方法:编译安装
安装步骤:
一、安装程序包下载
下载mysql-5.5.27所需的如下安装文件:
libevent-2.0.20-stable.tar.gz
cmake-2.8.9tar.gz
下载mysql-5.5.27的安装包:mysql-5.5.27.tar.gz
下载httpd-2.2.23的安装包:httpd-2.2.23.tar.bz2
下载bugzilla-4.2.3的安装包:bugzilla-4.2.3.tar.gz
下载bugzilla安装的相关组件包:DBD-mysql-4.0.22.tar.gz

二、卸载linux安装后自动安装上的mysql和httpd所有相关包,具体如下:
1. 用下面命令查看系统自动安装的mysql和http相关的包有哪些
rpm –qa|grep mysql
rpm –qa|grep http
2. 用下面命令删除系统自动安装的mysql和http的包
3. rpm -e –nodeps mysql已经安装的文件包名

三、安装mysql并创建bugzilla数据库
1. 安装libevent
# tar zxvf libevent-2.0.20-stable.tar.gz
# cd libevent-2.0.20-stable
#  ./configure
# make
# make install
# ln -s /usr/local/lib/libevent-2.0.so.5  /usr/lib/libevent-2.0.so.5
2. 安装cmake
安装前确认系统是否安装了ncurses包,具体如下:
#rpm -qa|grep ncurses
ncurses-5.5-24.20060715
ncurses-devel-5.5-24.20060715
# tar zxvf  cmake-2.8.9tar.gz
# cd cmake-2.8.9
# ./bootstrap
# make
# make install
3. 安装mysql
1)建立mysql用户
# groupadd mysql
# useradd -g mysql -s /sbin/nologin mysql
# mkdir -p /data/db/mysql_data
# mkdir -p /data/mysql
# mkdir -p /etc/mysql
# mkdir /data/db/innodb_data/ -p
# mkdir /data/db/mysql_logs/binary_log -p
# mkdir /data/db/mysql_logs/innodb_log -p
# mkdir /data/db/mysql_logs/query_log -p
# mkdir /data/db/mysql_logs/slow_query_log -p
# mkdir /data/db/mysql_logs/error_log -p
# chown mysql. /data/db/* -R
2)安装配置
# tar zxvf mysql-5.5.27.tar.gz
#cd mysql-5.5.27
# cmake . -DCMAKE_INSTALL_PREFIX=/data/mysql/ -DMYSQL_DATADIR=/data/db/mysql_data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_SSL=bundled -DWITH_ZLIB=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DSYSCONFDIR=/etc/mysql -DMYSQL_TCP_PORT=3306 -DWITH_DEBUG=0 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysqld.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1
# make && make install
3)初始化数据库
# /data/mysql/scripts/mysql_install_db --basedir=/data/mysql/ --user=mysql --datadir=/data/db/mysql_data/
4)创建配置文件
#vi /etc/mysql/my.cnf
[client]
#password       = [your_password]
port            = 3306
socket          = /tmp/mysqld.sock
default-character-set=utf8
[mysqld]
wait_timeout=7200
port            = 3306
socket          = /tmp/mysqld.sock
character_set_server=utf8
basedir=/data/mysql
datadir=/data/db/mysql_data
back_log = 500
log-error=/data/db/mysql_logs/error_log/server.err
max_connections = 1024
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
join_buffer_size = 8M
thread_cache_size = 128
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
#default-storage-engine = MYISAM
default-storage-engine = innodb
thread_stack = 192K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
log-bin=/data/db/mysql_logs/binary_log/db-bin
expire_logs_days=10
binlog_format=mixed
#general_log=1
#general_log_file=/data/db/mysql_logs/query_log/query.log
slow_query_log=1
long_query_time = 2
slow_query_log_file=/data/db/mysql_logs/slow_query_log/slow_query.log
server-id = 1
key_buffer_size = 200M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 300M
innodb_data_file_path = ibdata1:100M;ibdata2:100M;ibdata3:100M;ibdata4:100M:autoextend
innodb_data_home_dir=/data/db/innodb_data/
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_log_group_home_dir=/data/db/mysql_logs/innodb_log
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
5)后台启动
# cp support-files/mysql.server /etc/init.d/mysqld
# chmod 755 /etc/init.d/mysqld
# vim /etc/init.d/mysqld
basedir=/data/mysql
datadir=/data/db/mysql_data
# /etc/init.d/mysqld start
Starting MySQL……………..[ OK ]
# netstat -an |grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
# vim /etc/profile
用#注释掉之前的export内容,追加如下内容
export PATH=$PATH:/data/mysql/bin
# source /etc/profile
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.27-log Source distribution
Copyright (c) 2000, 2012, 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.
6)添加Mysql自启动服务
# ln -sf /data/mysql/bin/mysql /sbin/mysql
# ln -sf /data/mysql/bin/mysqladmin /sbin/mysqladmin
# chkconfig mysqld on
# chkconfig --level 24 mysqld off
# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:off 5:on 6:off
# vi /etc/ld.so.conf
用#注释掉文件内容,增加如下内容
/data/mysql/lib
# ldconfig -v |grep mysql
/data/mysql/lib:
libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
7)为mysql数据库root用户设置密码
# mysqladmin -uroot password "qwe123"
# mysql –uroot –p
use mysql
Grant all privileges on *.* to 'root'@'%' identified by 'qwe123' with grant option;
flush privileges;
select host, user, password from user;
增加远程登录权限
删除匿名用户:
delete from user where user=' ';
设置所有root密码
update user set password=password( "qwe123") where user= "root";
4. 创建bugzilla数据库和用户
1)创建数据库bugs
create database bugs;
show databases;
use bugs;
2)创建用户bugs
grant select,insert,update,delete,index,alter,create,lock tables,drop,references on bugs.* to bugs@localhost identified by '123456';
flush privileges;

四、安装httpd
1. 安装apache
# tar jxvf httpd-2.2.23.tar.bz2
# cd httpd-2.2.23
# ./configure --prefix=/data/apache2 --enable-so --enable-rewrite --enable-vhost-alias=shared --enable-cache=shared --enable-file-cache=shared --enable-disk-cache=shared --enable-mem-cache=shared --enable-proxy=shared --enable-proxy-http=shared --enable-proxy-ajp=shared --enable-proxy-balancer=shared --enable-proxy-connect=shared --enable-dav --enable-dav-fs --disable-proxy-ftp --disable-userdir --disable-asis --enable-ssl --with-mpm=worker
# make
# make install
2. 添加apache自启动脚本
#cp /data/apache2/bin/apachectl /etc/init.d/httpd
#vi /etc/init.d/httpd
在第三行添加以下两行内容
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
[root@localhost opt]#chkconfig httpd on
3. 启动HTTP服务
[root@localhost opt]#service httpd start
安装完毕,启动httpd,输入“http://ip”能看到“it works”证明成功。

五、安装bugzilla
1. 安装bugzilla
# tar zxvf bugzilla-4.2.3.tar.gz
# mv bugzilla-4.2.3 /data/apache2/htdocs/bugzilla
#chmod 777 /data/apache2/htdocs/bugzilla –R
2. 安装bugzilla所需模块
由于默认的perl安装包缺少一些bugzilla需要的模块,所以需要补充一些模块,最好是在线进行,不要一个一个的自己安装。以root身份运行在联网情况下用以下命令安装所需的最少perl模块:
#perl -MCPAN -e 'install "Bundle::Bugzilla"'
Are you ready for manual configuration? [yes] no
of modules we are processing right now? [yes] 敲回车,以后都敲回车!
#/usr/bin/perl install-module.pl -all
# perl -MCPAN -e 'install "mod_perl2"'
安装需要把Apache的apxs路径:/data/apache2/bin/apxs
#cd /data/apache2/htdocs/bugzilla
#./checksetup.pl
再次执行安装相关包命令
# /usr/bin/perl install-module.pl –all
安装DBD-mysql-4.0.22.tar.gz
# tar zxvf DBD-mysql-4.0.22.tar.gz
# cd DBD-mysql-4.0.22
# perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config
# make
# make install
# perl -MCPAN -e 'install "mod_perl2"'
安装需要把Apache的apxs路径:/data/apache2/bin/apxs
3. 配置bugzilla
#cd /data/apache2/htdocs/bugzilla
#vi localconfig
根据数据库的实际情况修改如下参数:
$db_name = 'bugs';
$db_user = 'bugs';
$db_pass = '123456';
$db_port = 3306;
$db_sock = '/var/lib/mysql/mysqld.sock';
$index_html = 1;
4. 配置启动apache
在 httpd.conf 中添加(或者去除注释)以下这一行:
AddHandler cgi-scrīpt .cgi
到 httpd.conf 中 DirectoryIndex 那一行,修改为:
DirectoryIndex index.html index.html.var index.cgi
 指定Bugzilla的访问目录,在最后添加:
<Directory /data/apache2/htdocs/bugzilla>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>
5. 安装bugzilla数据库配置和文件权限设置
#cd /data/apache2/htdocs/bugzilla
#./checksetup.pl
开始自动安装bugzilla数据库表并设置管理员账号
# cd /data/apache2/htdocs/
# chmod 777-R bugzilla
编辑hosts文件:
# vi /etc/hosts
增加如下一行
127.0.0.1 localhost.localdomain localhost MYHOST
在浏览器输入:http://XXX.XXX.XXX.XXX/bugzilla,用刚才设置的管理员账号登陆即可。

 

posted on 2012-11-29 17:52 lijun 阅读(3196) 评论(0)  编辑  收藏 所属分类: 测试环境维护实践

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © lijun Powered by: 博客园 模板提供:沪江博客