Linux下安裝mantis配置指南【轉】

sky-heaven發表於2017-07-06

轉自:http://blog.csdn.net/xabc3000/article/details/6858229

Linux下安裝mantis配置指南

1 配置Linux下的Apache+Mysql+PHP

 

一.安裝配置Apache

安裝包的獲取:http://www.apache.org

1.1.安裝Apache(tar包)

tar –zxvf http-2.2.11.tar.gz

./configure –prefix=/usr/local/apache –enable-modules=so –enable-rewrite

make && make install

1.2.配置Apache

vi /usr/local/apache/conf/httpd.conf

找到下面這行

#ServerName www.example.com:80

修改為:

ServerName www.dong.com:80

儲存退出。

1.3.拷貝檔案

cp –a /usr/local/apache/bin/apachectl /etc/init.d/httpd

1.4執行service命令

Service httpd restart

1.5檢驗配置是否成功

IE位址列輸入:http://www.dong.com

看到It’s Work證明配置成功。

或者使用 ps –aux|grep httpd

如果看到多行資料,也證明配置成功

二.安裝Mysql(rpm包)

安裝包的獲取: http://www.mysql.com

2.1.檢查是否安裝MySQL

輸入命令:

rpm -qa |grep –i mysql

如果有提示,證明mysql已經安裝,那麼使用rpm –e mysql解除安裝mysql包。

因為系統安裝的mysql的版本太低了。

 

2.2.如果沒有安裝

2.2.1.從mysql網站獲取安裝包:

rpm –ivh mysql-client*

rpm –ivh mysql-server*

2.3啟動服務

service mysql restart

三.安裝GD庫(tar包 讓PHP支援GIF、PNG、JPEG)

注意:不安裝只會影響mantis的資料統計部分功能。

3.1安裝GD庫

3.1.1.安裝jpeg6(jpegsrc.v6b.tar.gz)ftp://ftp.uu.net/graphics/jpeg/     

mkdir -p /usr/local/jpeg6

mkdir -p /usr/local/jpeg6/bin

mkdir -p /usr/local/jpeg6/lib

mkdir -p /usr/local/jpeg6/include

mkdir -p /usr/local/jpeg6/man

mkdir -p /usr/local/jpeg6/man1

mkdir -p /usr/local/jpeg6/man/man1

tar –zxvf  jpegsrc.v6b.tar.gz

./configure –prefix=/usr/local/jpeg6/ –enable-shared –enable-static

Make &&make install

3.1.2.安裝libpng(libpng-1.2.35-i486-1.gz) http://www.libpng.org/pub/png/libpng.html

tar –zxvf  libpng-1.2.35-i486-1.gz

./configure –prefix=/usr/local/libpng/

Make &&make install

3.1.3.安裝freetype(freetype-2.3.9.tar.gz) http://freetype.fis.uniroma2.it/download.html

注意:需升級make version到3.80以上:下載地址:http://ftp.gnu.org/pub/gnu/make/

tar –zxvf  freetype-2.3.9.tar.gz

mkdir -p /usr/local/freetype

./configure –prefix=/usr/local/freetype

Make &&make install

3.1.4.安裝zlib (zlib-1.2.3.tar.gz) http://zlib.net/index.html

tar –zxvf  zlib-1.2.3.tar.gz

./configure –prefix=/usr/local/zlib

Make &&make install

3.1.5.安裝GD庫 (gd-2.0.35.tar.gz) http://www.libgd.org/Downloads

注意:需要對m4升級到1.4.12. 下載地址:http://ftp.gnu.org/pub/gnu/m4/

注意:需要對autoconf升級到2.58或者更高 下載地址:http://ftp.gnu.org/pub/gnu/autoconf/

tar –zxvf  gd-2.0.35.tar.gz

mkdir -p /usr/local/gd2

./configure –prefix=/usr/local/gd2 –with-jpeg=/usr/local/jpeg6/ –with-png=/usr/local/lib/ –with-zlib=/usr/local/zlib/ –with-freetype=/usr/local/freetype/

Make &&make install

3.1.6安裝Curl庫(curl-7.19.4.tar.gz) http://curl.haxx.se/download.html

tar –zxvf  curl-7.19.4.tar.gz

./configure –prefix=/usr/local/curl

Make &&make install

 

四.安裝PHP(tar包,PHP必須有libxml2支援)

安裝包的獲取:http://www.PHP.net

4.1.安裝libxml2

4.2.安裝libxslt(可選安裝)

4.3.安裝php5

tar –zxvf php-5.2.9.tar.gz

./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-libxml-dir=/usr/local/libxml2/ –with-gd=/usr/local/gd2/ –with-jpeg-dir=/usr/local/jpeg6/ –with-png=/usr/local/lib –with-zlib-dir=/usr/lib/ –with-freetype-dir=/usr/local/freetype –with-curl=/usr/local/curl/ –with-xsl=/usr/local/libxslt –enable-xslt

make && make install

4.4配置檔案

cp php.ini-dist /usr/local/lib/php.ini

五.重新配置Apache

5.1. vi /usr/local/apache/conf/httpd.conf

5.1.1找到 AddType application/x-gzip .gz .tgz在其下面新增一行

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

 

5.1.1找到  DirectoryIndex index.html修改為:

DirectoryIndex index.html default.php index.php

5.2設定php檔案字尾

Vi /usr/local/lib/php.ini

找到register-globals這一行修改成:

 register-globals=on

5.3第一個php程式

vi /usr/local/apache/htdocs/test.php

檔案內容為:

<?

       Phpinfo();

?>

5.4重啟apache服務

service httpd restart

5.5檢驗是否成功

在IE中輸入如下網址

http://www.dong.com/test.php

看到php的有關配置資訊就證明成功了。

2安裝配置mantis

一.安裝mantis

1.1將mantis解壓到/usr/local/apache/htdocs目錄下。

1.2生成:mantis配置檔案:

   cp  config_inc.php.sample config_inc.php

1.3生成資料庫

   http://www.dong.com/mantis/admin/install.php

凡是mantis 1.0.0a2以後的版本生成資料庫都比較簡單,只需要上面那個網址就可以。

1.4對bugtracker賦許可權:

   grant all privileges on bugtracker.* to mantisdbuser@localhost    identified by “”;

1.5.登入:

IE中輸入:http://www.dong.com/mantis

使用者名稱:administrator

密碼:root

二.安裝配置sendmail

請參見:Linux初學者Sendmail配置指南

http://blog.sina.com.cn/s/blog_4b086af10100c2ca.html

 

三.安裝配置phpmailer

安裝包的獲取:http://phpmailer.sourceforge.net

解壓此安裝包後到/var/phpmailer

3.1拷貝檔案到include_path路徑下

將此安裝包的class.smtp.php 和class.phpmailer.php檔案拷貝到php的include_path所包含的路徑下。

3.2配置mantis的配置檔案:config_inc.php

增加:

$g_smtp_host=’www.dong.com’;  #mail server的地址

$g_phpMailer_method=2;

$g_return_path_email=’test1@dong.com’; #你的一個郵箱賬戶

$g_administrator_email=`root@localhost`;

$g_from_email=`root@localhost`;

 

3.3配置php.ini的配置檔案:vi /usr/local/lib/php.ini

在#include_path下面一行增加:

Include_path=”.:/usr/local/php/lib/php/”

 

四.安裝配置jpgraph

4.1安裝jpgraph庫(jpgraph-2.3.4.tar.gz) http://www.aditus.nu/jpgraph/jpdownload.php

tar –zxvf  jpgraph-2.3.4.tar.gz

拷貝解壓後 jpgraph到mantis目錄下

4.2配置gd_image.inc.php

開啟/mantis/jpgraph/src/gd_image.inc.php 檔案

註釋if else語句

 function SetAntiAliasing($aFlg=true) {

  $this->use_anti_aliasing = $aFlg;

  /*

  if( function_exists(`imageantialias`) ) {

  imageantialias($this->img,$aFlg);

  }

  else {

  JpGraphError::RaiseL(25128);//(`The function imageantialias() is not available in your PHP installatio

  n. Use the GD version that comes with PHP and not the standalone version.`)

  }

  */

  }

4.3 配置jpgraph_ttf.inc.php

開啟 /mantis/jpgraph/src /jpgraph_ttf.inc.php 檔案

註釋 elseif語句

 /*elseif( $aFF === FF_SIMSUN ) {
 Do Chinese conversion
 if( $this->g2312 == null ) {
 include_once `jpgraph_gb2312.php` ;
 $this->g2312 = new GB2312toUTF8();
 }
 return $this->g2312->gb2utf8($aTxt);
 }*/

4.4 配置graph_api.php

開啟 /mantis/core/graph_api.php檔案

找到 graph_get_font()函式新增

`chinese_gbk` => FF_SIMSUN,

4.4 配置config_inc.php

開啟 /mantis/config_inc.php檔案

新增 $g_graph_font = `chinese_gbk`;

新增  $g_use_jpgraph   = ON;

$g_jpgraph_path   =’’;//引號內新增jpgraph的位置

【作者】張昺華
【新浪微博】 張昺華–sky
【twitter】 @sky2030_
【facebook】 張昺華 zhangbinghua
本文版權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段宣告,且在文章頁面明顯位置給出原文連線,否則保留追究法律責任的權利.


相關文章