1. 程式人生 > >Linux下禪道專案管理軟體安裝

Linux下禪道專案管理軟體安裝

1)網上下載開源包:
httpd-2.4.2.tar.gz
mysql-5.6.4-m7.tar.gz
libxml2-2.6.19.tar.gz
php-5.4.0.tar.gz
PDO_MYSQL-1.0.2.tgz
ZenTaoPMS.4.0.stable.zip

2)RHEL5系統盤自帶的安裝包:
ncurses-devel-5.5-24.20060715.i386.rpm
e2fsprogs-devel-1.39-8.el5.i386.rpm
krb5-devel-1.5-17.i386.rpm 
zlib-devel-1.2.3-3.i386.rpm
libidn-devel-0.6.5-1.1.i386.rpm 
curl-devel-7.15.5-2.el5.i386.rpm

libjpeg-devel-6b-37.i386.rpm
libpng-devel-1.2.10-7.i386.rpm
freetype-devel-2.2.1-16.el5.i386.rpm
cyrus-sasl-devel-2.1.22-4.i386.rpm
openldap-devel-2.3.27-5.i386.rpm
實際上可能需要更多

安裝禪道專案開源管理軟體需要apache+mysql+php服務的支援,因此需要先部署相應服務

2.安裝apache服務

httpd安裝
[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# tar zxf httpd-2.4.2.tar.gz

[[email protected] httpd-2.4.2]#./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so
[[email protected] httpd-2.4.2]# make
[[email protected] httpd-2.4.2]# make install
[[email protected] httpd-2.4.2]# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
[[email protected] httpd-2.4.2]# chmod +x /etc/init.d/httpd

[[email protected] httpd-2.4.2]# /etc/init.d/httpd start

3.安裝mysql資料庫
1)安裝cmake
由於mysql5.5以後需要通過cmake來編譯,因此需要先安裝cmake
官網:http://www.cmake.org/
下載地址:http://cmake.org/cmake/resources/software.html
# tar zxf cmake-2.8.7.tar.gz
# cd cmake-2.8.7
# ./bootstrap
# gmake
# gmake install

2)mysql安裝
# useradd mysql
# tar zxf mysql-5.6.4-m7.tar.gz
# cd mysql-5.6.4-m7
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/var/mysql/data

報錯了:Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH) 
安裝相應的Curses包
#rm CMakeCache.txt
#rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm

[[email protected] mysql-5.6.4-m7]#make
[[email protected] mysql-5.6.4-m7]#make install
[[email protected] mysql-5.6.4-m7]#chown -R mysql:mysql /usr/local/mysql
[[email protected] mysql-5.6.4-m7]#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18
[[email protected] mysql-5.6.4-m7]#mkdir -p /var/mysql/
[[email protected] mysql-5.6.4-m7]#mkdir -p /var/mysql/data/
[[email protected] mysql-5.6.4-m7]#mkdir -p /var/mysql/log/
[[email protected] mysql-5.6.4-m7]#chown -R mysql:mysql /var/mysql/
[[email protected] mysql-5.6.4-m7]#cp support-files/my-medium.cnf /etc/my.cnf
[[email protected] mysql-5.6.4-m7]#cp support-files/mysql.server /etc/init.d/mysqld
[[email protected] mysql-5.6.4-m7]#/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/var/mysql/data --user=mysql &
[[email protected] mysql-5.6.4-m7]#chmod +x /etc/init.d/mysqld
[[email protected] mysql-5.6.4-m7]#vi /etc/init.d/mysqld
檔案中新增以下內容:
basedir=/usr/local/mysql
datadir=/var/mysql/data
[[email protected] mysql-5.6.4-m7]#chkconfig --add mysqld        //使服務可以開機啟動
[[email protected] mysql-5.6.4-m7]#chkconfig --level 345 mysqld on
[[email protected] mysql-5.6.4-m7]#/etc/init.d/mysqld start
[[email protected] mysql-5.6.4-m7]#ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
[[email protected] mysql-5.6.4-m7]#/usr/local/mysql/bin/mysqladmin -u root password 'mysql'     //設定密碼
[[email protected] mysql-5.6.4-m7]#/usr/local/mysql/bin/mysql -u root -p    //進入資料庫

4.安裝php
1)安裝libxml2
php5的安裝需要有libxml2的支援
#tar -zxf libxml2-2.6.19.tar.gz
#cd?libxml2-2.6.19
#mkdir -p /usr/local/libxml2
#./configure --prefix=/usr/local/libxml2
#make
#make instal

2)安裝libmcrypt
#tar zxf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make install


3)安裝各類支援包
實際上php的安裝需要許多庫的支援
rpm -ivh e2fsprogs-devel-1.39-8.el5.i386.rpm
rpm -ivh krb5-devel-1.5-17.i386.rpm 
rpm -ivh zlib-devel-1.2.3-3.i386.rpm
rpm -ivh libidn-devel-0.6.5-1.1.i386.rpm 
rpm -ivh curl-devel-7.15.5-2.el5.i386.rpm
rpm -ivh libjpeg-devel-6b-37.i386.rpm
rpm -ivh libpng-devel-1.2.10-7.i386.rpm
rpm -ivh freetype-devel-2.2.1-16.el5.i386.rpm
rpm -ivh cyrus-sasl-devel-2.1.22-4.i386.rpm
rpm -ivh openldap-devel-2.3.27-5.i386.rpm
不同的系統已經安裝的庫不同,需要根據提示安裝相應包

3)php安裝
#tar zxf php-5.4.0.tar.gz
#cd php-5.4.0
#./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql 
--with-apxs2=/usr/local/apache2/bin/apxs --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib 
--with-libxml-dir=/usr/local/libxml2 --enable-xml --disable-rpath --enable-bcmath --enable-shmop 
--enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex  
--enable-fpm  --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl 
--enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl
#make
#make install 
#cp php.ini-production /usr/local/php/etc/php.ini
#cd /usr/local/apache2/conf
#vi httpd.conf
AddType application/x-httpd-php .php     #新增
DirectoryIndex index.html index.php      #新增index.php
#/etc/init.d/httpd restart           //重啟apache服務

4)測試php頁面
# cd
# vi /usr/local/apache2/htdocs/test.php        //建立php頁面
<?php
phpinfo();
?>

用瀏覽器訪問http://ip/test.php


5.安裝禪道

1)PDO_MYSQL安裝
#wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
#tar -xvf PDO_MYSQL-1.0.2.tgz
#cd PDO_MYSQL-1.0.2
#./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
#make

報錯了:/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such file or directory
In file included from /usr/local/program/PDO_MYSQL-1.0.2/pdo_mysql.c:31:
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before ‘MYSQL’
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before ‘MYSQL_FIELD’
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ‘MYSQL_RES’

原因:因為在編譯時需要 MySQL 的頭的檔案。而它按預設搜尋找不到標頭檔案的位置,所以才出現這個問題。通過軟連線把MySQL標頭檔案對應到/usr/local/include/下就好
比如你的MySQL安裝檔案位於/usr/local/mysql,那麼就執行以下命令:
#ln -s /usr/local/mysql/include/* /usr/local/include/
#make install
提示:
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20100525/
#vi php.ini
在檔案中新增以下內容:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20100525/"
extension=pdo_mysql.so
#service httpd restart    //修改完檔案後重啟apache服務

2)禪道安裝
這裡使用原始碼包安裝
下載地址:http://www.zentao.net/article-view-79766.html
#unzip ZenTaoPMS.4.0.stable.zip       //解壓到apache服務下
用瀏覽器訪問http://ip//zentaopms/www/index.php按提示安裝

6.遇到的問題
1)磁碟空間不足
報錯:file INSTALL cannot copy file
  "/usr/local/mysql-5.6.4-m7/mysql-test/./suite/parts/r/partition_alter4_myisam.result"
  to
  "/usr/local/mysql/mysql-test/./suite/parts/r/partition_alter4_myisam.result".
Call Stack (most recent call first):
  cmake_install.cmake:103 (INCLUDE)
不能複製檔案,一開始以為許可權問題,df -h查了下竟然是磁碟空間不足。。

2)FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
原因:/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
資料庫初始化時最後沒有加&符號
解決方法:/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &(加&這點非常重要)

3)配置檔案與實際中檔案衝突問題
060518 16:54:59 mysqld started
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
060518 16:54:59 Can't init databases
060518 16:54:59 Aborting
060518 16:54:59 InnoDB: Warning: shutting down a not properly started
                 InnoDB: or created database!
060518 16:54:59 /usr/local/libexec/mysqld: Shutdown Complete
060518 16:54:59 mysqld ended
原因:配置檔案中指定的檔案大小與實際中的檔案大小不一致
解決:根據提示可刪除./ibdata1檔案,資料庫重啟時會自動重新建立該檔案

4)PDO_MYSQL找不到已安裝好的mysql
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such file or directory
In file included from /usr/local/program/PDO_MYSQL-1.0.2/pdo_mysql.c:31:
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before ‘MYSQL’
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before ‘MYSQL_FIELD’
/usr/local/program/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ‘MYSQL_RES’
原因:因為在編譯時需要 MySQL 的頭的檔案。而它按預設搜尋找不到標頭檔案的位置,
所以才出現這個問題。通過軟連線把MySQL標頭檔案對應到/usr/local/include/下就好
比如你的MySQL安裝檔案位於/usr/local/mysql,那麼就執行以下命令:
#ln -s /usr/local/mysql/include/* /usr/local/include/

7.其它
a)mysql中cmake常用引數說明:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
#安裝目錄
-DMYSQL_DATADIR=/usr/local/mysql/data \
#資料庫存放目錄
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \
#Unix socket 檔案路徑
-DWITH_MYISAM_STORAGE_ENGINE=1 \
#安裝 myisam 儲存引擎
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
#安裝 innodb 儲存引擎
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
#安裝 archive 儲存引擎
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
#安裝 blackhole 儲存引擎
-DWITH_PARTITION_STORAGE_ENGINE=1 \
#安裝資料庫分割槽
-DENABLED_LOCAL_INFILE=1 \
#允許從本地匯入資料
-DWITH_READLINE=1 \
#快捷鍵功能
-DWITH_SSL=yes \
#支援 SSL
-DDEFAULT_CHARSET=utf8 \
#使用 utf8 字元
-DDEFAULT_COLLATION=utf8_general_ci \
#校驗字元
-DEXTRA_CHARSETS=all \
#安裝所有擴充套件字符集
-DMYSQL_TCP_PORT=3306 \
#MySQL 監聽埠

b)php安裝中常缺少的安裝包
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
Quote: #yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev      (For ubuntu)
2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
Solutions :
Quote: #yum install openssl openssl-devel
3) Configure: error: Please reinstall the BZip2 distribution
Solutions :
Quote: # yum install bzip2 bzip2-devel
4) Configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
Solutions :
Quote: # yum install curl curl-devel (For Redhat & Fedora)
# install libcurl4-gnutls-dev    (For Ubuntu)
5) Configure: error: libjpeg.(also) not found.
Solutions :
Quote: # yum install libjpeg libjpeg-devel
6) Configure: error: libpng.(also) not found.
Solutions :
Quote: # yum install libpng libpng-devel
7) Configure: error: freetype.h not found.
Solutions :
Quote: #yum install freetype-devel
8) Configure: error: Unable to locate gmp.h
Solutions :
Quote: # yum install gmp-devel
9) Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Solutions :
Quote: # yum install mysql-devel            (For Redhat & Fedora)
# apt-get install libmysql++-dev      (For Ubuntu)
10) Configure: error: Please reinstall the ncurses distribution
Solutions :
Quote: # yum install ncurses ncurses-devel
11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Solutions :
Quote: # yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions :
Quote: # yum install pspell-devel
13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :
Quote: # yum install libmcrypt libmcrypt-devel    (For Redhat & Fedora)
# apt-get install libmcrypt-dev
14) Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :
Quote:# yum install net-snmp net-snmp-devel