本文安裝環境為Gentoo Linux,理論上其它發行版本Linux也可做為參考。
Crob原創,轉載請註明出處。
環境介紹
Linux dotc 2.6.28-gentoo-r4 #2 SMP Fri Jun 5 19:36:48 CST 2009 i686 Intel(R) Core(TM)2 Duo CPU T5470 @ 1.60GHz GenuineIntel GNU/Linux
gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)
[ebuild R ] www-servers/apache-2.2.11 USE="ssl -debug -doc -ldap (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB
[ebuild R ] dev-db/mysql-5.0.70-r1 USE="berkdb perl ssl -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal (-selinux) -static" 0 kB
[ebuild R ] www-apps/bugzilla-3.0.5 USE="graphviz modperl mysql vhosts -extras -postgres" LINGUAS="-de" 0 kB
本文假設您已安裝了以上軟體包。
1、安裝軟體準備
# echo "www-apps/bugzilla apache2 graphviz modperl mysql vhosts" >> /etc/portage/package.use
# emerge www-apps/bugzilla www-apache/mod_perl www-servers/apache
2、配置Appach
# vim /etc/apache2/httpd.conf
在檔案未尾添加以下內容
#For bugzilla
Listen 8666
#### Directory entry added by The Beast in Black on 3-Aug-2006
# for bugzilla. God save us all.
<Directory /var/www/bugzilla>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi
AllowOverride Limit
</Directory>
並確認 Include /etc/apache2/vhosts.d/*.conf 在httpd.conf中是否存在,不存在則添加上。
3、配置Bugzilla的appache vhost
# vim /etc/apache2/vhosts.d/bugzilla-vhost.conf
檔案內容如下,其中的IP地址改為正確的地址,ServerName如不知道該是什麼則可不改
NameVirtualHost *:8666
<VirtualHost *:8666>
ServerName "myserver.mydomain.com"
DocumentRoot "/var/www/bugzilla/htdocs"
<Directory "/var/www/bugzilla/htdocs">
AddHandler cgi-script cgi
Options +Indexes +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
</VirtualHost>
然後熱行以下命令,產生apache虛擬機器主機配置及目錄,3.0.5要改為當前安裝的bugzilla對應的版本號碼
# webapp-config -I -h bugzilla bugzilla 3.0.5
執行完成後bugzilla被安裝在 /var/www/bugzilla/htdocs/
4、配置MySQL
# vim /etc/mysql/my.cnf
[mysqld]
# Allow packets up to 1M
max_allowed_packet=1M
# Allow small words in full-text indexes
ft_min_word_len=2
my.cnf修改完後/etc/init.d/mysql restart
接下去在mysql中添加bugs使用者和資料庫並分配許可權
//登入MYSQL
# mysql -u root -p
# 密碼
//建立使用者
mysql> insert into mysql.user(Host,User,Password) values("localhost","bugs",password("systex"));
//重新整理系統許可權表
mysql> flush privileges;
//建立資料庫bugs
mysql> create database bugs;
//授權bugs使用者擁有bugs資料庫的所有許可權。
mysql> grant all privileges on bugs.* to bugs@localhost identified by "systex";
//重新整理系統許可權表
mysql> flush privileges;
5、配置Bugzilla
熱行以下命令配置bugzilla
# perl /var/www/bugzilla/htdocs/checksetup.pl
執行完成如出現:Enter the e-mail address of the administrator: 則表明所有bugzilla需要的perl module已經安裝完成,按提示輸入admin的email、姓名、密碼。
執行完如出現其它安裝perl module組件的提示,則按提示用root運行顯示出的所有commands安裝,有些commands是可選的,不必安裝,再將運行 checksetup.pl
6、配置Bugzilla localconfig
注意每次修改完localconfig都要再執行第5步的checksetup.pl
# vim /var/www/bugzilla/htdocs/localconfig
找到$db_pass = 'systex'; 填入mysql密碼
,此例中密碼為systex, mysql的密碼。
修改完後,再次熱行以下命令配置bugzilla
# perl /var/www/bugzilla/htdocs/checksetup.pl
7、重啟apache,重啟mysql
# /etc/init.d/apache2 restart
# /etc/init.d/mysql restart
在瀏覽器中輸入 http://127.0.0.1:8666,可以開啟bugzill頁面了。
8、sendmail
在我的gentoo中,emerge sendmail後,所有配置均為預設,即可收到EMAIL,但經過測試一般需一到兩小時後才收到郵件。以後再嘗試換用postfix來做為SMTP伺服器的效果。