公司現在有需要搭建bugzilla 系統,之前搭建過,但是沒有記錄下來,這次把他完全記錄下來,以供自己以後參考(建議在安裝系統的時候安裝上開發工具,administrator tool ,system tool 等,這樣在安裝的過程中就不會出現缺少包的情況)
1.安裝apache
tar zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/lib --with-auth-digest --enable-cgi --enable-mods-shared=all --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs --enable-auth-digest
make
make install
建立所需的目錄, 例如 mkdir /usr/local/apache2/htdocs/Dawn
在/usr/local/apache2/conf/httpd.conf中添加如下
AddHandler cgi-script .cgi
<Directory "/usr/local/apache2/htdocs/Dawn/">
Options All
AllowOverride Limit
Order allow,deny
Allow from all
</Directory>
添加index.cgi eg :
<IfModule dir_module>
DirectoryIndex index.cgi index.php index.html
</IfModule>
note:是這個樣子/usr/local/apache2/htdocs/Dawn/
2.安裝mysql
groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
tar zxvf mysql-5.1.44.tar.gz
cd mysql-5.1.44
./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charsets=all --enable-thread-safe-client --enable-local-infile --with-low-memoryz
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
chown -R mysql.mysql /usr/local/mysql/
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R mysql.mysql /usr/local/mysql/var/
/usr/local/mysql/bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --levels 345 mysqld on
echo "/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
ldconfig
echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
source /etc/profile
/usr/local/mysql/bin/mysqladmin -u root password 123123
這是我整理的,完全可以将上面代碼複制,建立成一個腳本,最簡單是利用if 判斷mysql這個目錄存在不存在就可以了 eg: if [ ! -d /usr/local/mysql ]
進入mysql資料庫建立Dawn
/usr/local/mysql/bin/mysql -u root -p123123
>create database Dawn;
3.安裝perl
1)取得最新版本的 perl,即 perl-5.8.8.tar.bz2
2)解檔案包:
tar -jxvf perl-5.8.8.tar.bz2
得到目錄 perl-5.8.8
3)在目錄 perl-5.8.8 下安裝 perl:
sh Configure -de
make test
sh Configure -de 安裝使用預設配置,一般而言将會 ok 。
安裝完成後 perl 所在目錄為 /usr/local/lib/perl5, perl 執行檔案
在 /usr/local/bin 中。
note:
使用rpm包安裝也可以,假設在安裝系統的時候安裝上開發工具 perl 就自動安裝好了
初始化perl (這個很重要)
首先初始化perl的cpan:perl -MCPAN -e 'shell'
一路預設回車即可,
First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.
(1) Africa
(2) Asia
(3) Australasia
(4) Central America
(5) Europe
(6) North America
(7) Oceania
(8) South America
Select your continent (or several nearby continents) [] 2
Sorry! since you don't have any existing picks, you must make a
geographic selection.
(1) China
(2) Hong Kong
(3) India
(4) Indonesia
(5) Japan
(6) Kazakhstan
(7) Republic of Korea
(8) Russia
(9) Singapore
(10) Taiwan
(11) Thailand
(12) Turkey
Select your country (or several nearby countries) [] 1
(1) http://cpan.wenzk.com/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1
4.安裝perl子產品
1)安裝bugzilla所需的perl子產品
必要子產品:
1. CGI 2.93 or CGI 3.11 if using mod_perl
2. Date::Format (2.21)
3. DBI (1.41)
4. DBD::mysql (2.9003) if using MySQL
5. DBD::Pg (1.45) if using PostgreSQL
6. File::Spec (0.84)
7. Template (2.12)
8. Email::Send (2.00)
9. Email::MIME::Modifier (any)
其中DBD子產品在本章中先不進行安裝,因為這個子產品需要先安裝mysql,其他子產品均可安裝
可選子產品:
1. GD (1.20) for bug charting
2. Template::Plugin::GD::Image (1.20) for Graphical Reports
3. Chart::Base (1.0) for bug charting
4. GD::Graph (any) for bug charting
5. GD::Text (any) for bug charting
6. XML::Twig (any) for bug import/export
7. MIME::Parser (5.406) for bug import/export
8. LWP::UserAgent (any) for Automatic Update Notifications
9. PatchReader (0.9.4) for pretty HTML view of patches
10. Image::Magick (any) for converting BMP p_w_picpath p_w_uploads to PNG
11. Net::LDAP (any) for LDAP Authentication
12. SOAP::Lite (any) for the web service interface
13. HTML::Parser (3.40) for More HTML in Product/Group Descrīptions
14. HTML::Scrubber (any) for More HTML in Product/Group Descrīptions
15. Email::MIME::Attachment::Stripper (any) for Inbound Email
16. Email::Reply (any) for Inbound Email
17. mod_perl2 (1.999022) for mod_perl
18. CGI (2.93) for mod_perl
19. Apache::DBI (0.96) for mod_perl2
2) 不過,放心 perl提供了很簡便的子產品安裝方式:
(單子產品安裝方式)perl -MCPAN -e 'install 子產品名'
(批量安裝方式)比如安裝bugzilla的子產品,執行這個指令就可以了:perl -MCPAN -e 'install "Bundle::Bugzilla"' or perl install-module.pl --all (我用的是這個,使用前面那個不知道是怎麼回事安裝不全,使用這個可以将安裝bugzilla所必需的子產品安裝完畢,時間大約要一個半小時)
5.安裝bugzilla
tar -zxvf bugzilla-4.0.tar.gz
cd bugzilla-4.0
mv * /usr/local/apache2/htdocs/Dawn
chmod -R 777 /usr/local/apache2/htdocs/Dawn
cd /usr/local/apache2/htdocs/Dawn
./checksetup.pl (檢查安裝,如果上一步的perl子產品沒有裝好,這裡會提示)如果沒有錯的話會生出localconfig 檔案
修改 localconfig 修改以下内容:
$db_host = "localhost";
$db_name = "Dawn";
$db_user = "root";
$db_pass = "123123";
找到
$index_html=0
改為:
$index_html=1
這樣會生成一個index.html檔案,該檔案指向index.cgi
檢視資料庫是否支援innodb
先檢視mysql是否安裝了innodb插件
Sql代碼
- [root@localhost bin]# ./mysql
- mysql> show plugin;
- +------------+--------+----------------+---------+---------+
- | Name | Status | Type | Library | License |
- | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
- | MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
發現沒有安裝
安裝
mysql> install plugin innodb soname 'ha_innodb.so'; Query OK, 0 rows affected (0.36 sec)