您的位置:首页 > 运维架构 > Linux

Linux下禅道项目管理软件安装

2013-03-15 22:47 141 查看
Linux下搭建禅道

1.准备安装所需的包

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安装

[root@localhost ~]# cd /usr/local/src/

[root@localhost src]# tar zxf httpd-2.4.2.tar.gz

[root@localhost httpd-2.4.2]#./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so

[root@localhost httpd-2.4.2]# make

[root@localhost httpd-2.4.2]# make install

[root@localhost httpd-2.4.2]# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd

[root@localhost httpd-2.4.2]# chmod +x /etc/init.d/httpd

[root@localhost 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

[root@localhost mysql-5.6.4-m7]#make

[root@localhost mysql-5.6.4-m7]#make install

[root@localhost mysql-5.6.4-m7]#chown -R mysql:mysql /usr/local/mysql

[root@localhost mysql-5.6.4-m7]#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18

[root@localhost mysql-5.6.4-m7]#mkdir -p /var/mysql/

[root@localhost mysql-5.6.4-m7]#mkdir -p /var/mysql/data/

[root@localhost mysql-5.6.4-m7]#mkdir -p /var/mysql/log/

[root@localhost mysql-5.6.4-m7]#chown -R mysql:mysql /var/mysql/

[root@localhost mysql-5.6.4-m7]#cp support-files/my-medium.cnf /etc/my.cnf

[root@localhost mysql-5.6.4-m7]#cp support-files/mysql.server /etc/init.d/mysqld

[root@localhost mysql-5.6.4-m7]#/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/var/mysql/data --user=mysql &

[root@localhost mysql-5.6.4-m7]#chmod +x /etc/init.d/mysqld

[root@localhost mysql-5.6.4-m7]#vi /etc/init.d/mysqld

文件中添加以下内容:

basedir=/usr/local/mysql

datadir=/var/mysql/data

[root@localhost mysql-5.6.4-m7]#chkconfig --add mysqld //使服务可以开机启动

[root@localhost mysql-5.6.4-m7]#chkconfig --level 345 mysqld on

[root@localhost mysql-5.6.4-m7]#/etc/init.d/mysqld start

[root@localhost mysql-5.6.4-m7]#ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

[root@localhost mysql-5.6.4-m7]#/usr/local/mysql/bin/mysqladmin -u root password 'mysql' //设置密码

[root@localhost 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: