build Zen Road under Linux
1. Prepare the required package for installation1) online Download Open source package:
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 system disk with the installation package:
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
May actually require more
Installation Zen Road project open source management software requires the support of the apache+mysql+php service, so you need to deploy the corresponding services first
2. Install Apache service
HTTPD installation
[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. Install MySQL database
1) Installation CMake
Because mysql5.5 later needs to be compiled via CMake, you need to install CMake first
Official website: http://www.cmake.org/
Download Address: 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 Installation
# 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
Error: Could not find Curses (missing:curses_library curses_include_path)
Install the appropriate curses package
#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
Add the following to the file:
Basedir=/usr/local/mysql
Datadir=/var/mysql/data
[Root@localhost mysql-5.6.4-m7] #chkconfig--add mysqld//enable service to boot
[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 '//Set Password
[Root@localhost mysql-5.6.4-m7]#/usr/local/mysql/bin/mysql-u root-p/Enter database
4. Install PHP
1) Installation LIBXML2
The installation of PHP5 requires LIBXML2 support.
#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) Installation Libmcrypt
#tar ZXF libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make Install
3) installation of various support packages
In fact, PHP installation requires a lot of library support
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
Different systems have been installed different libraries, you need to follow the prompts to install the appropriate package
3) PHP Installation
#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//restart Apache service
4) Test PHP page
# CD
# vi/usr/local/apache2/htdocs/test.php//Create PHP page
<?php
Phpinfo ();
?>
Accessing http://ip/test.php in a browser
5. Installation of Zen Road
1) Pdo_mysql Installation
#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
Error:/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 '
Reason: Because the MySQL header file is required at compile time. It does not find the location of the header file by default search, so this problem occurs. Through the soft connection to the MySQL header file corresponding to the/usr/local/include/.
For example, if your MySQL installation file is located in/usr/local/mysql, execute the following command:
#ln-S/usr/local/mysql/include/*/usr/local/include/
#make Install
Tips:
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-zts-20100525/
#vi php.ini
Add the following content to the file:
Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20100525/"
Extension=pdo_mysql.so
Restart the Apache service #service httpd Restart//after modifying files
2) Zen Road installation
Use the source pack to install here
Download Address: http://www.zentao.net/article-view-79766.html
#unzip Zentaopms.4.0.stable.zip//extract to Apache service
Use browser access http://ip//zentaopms/www/index.php install by prompt
6. The problems encountered
1 Insufficient disk space
Error: 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 i):
cmake_install.cmake:103 (INCLUDE)
Can not copy the file, the first thought permissions issues, Df-h looked down unexpectedly is insufficient disk space.
2) FATAL error:could not find./bin/my_print_defaults
If you are compiled from source, your need to run ' make install ' to
Copy the software into the correct location ready for operation.
If you are are using a binary release, your must either be on the top
Level of the extracted archive, or pass the--BASEDIR option
Pointing to that location.
Reason:/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/ Data
No & symbol at last when database initialization
Workaround:/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql /data & (plus & This is very important)
3 The configuration file and the actual file conflict problem
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
Innodb:to what it was, and remove the new ibdata files InnoDB created
Innodb:in this failed attempt. InnoDB only wrote those files full
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
Reason: The file size specified in the configuration file is inconsistent with the actual file size
WORKAROUND: You can delete the./ibdata1 file as prompted, and the file will be re-created automatically when the database restarts
4 Pdo_mysql can not find the installed 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 '
Reason: Because the MySQL header file is required at compile time. And it does not find the location of the header file by default search,
That's why the problem arises. Through the soft connection to the MySQL header file corresponding to the/usr/local/include/.
For example, if your MySQL installation file is located in/usr/local/mysql, execute the following command:
#ln-S/usr/local/mysql/include/*/usr/local/include/
7. Other
A in MySQL cmake commonly used parameters Description:
Cmake-dcmake_install_prefix=/usr/local/mysql \
#安装目录
-dmysql_datadir=/usr/local/mysql/data \
#数据库存放目录
-dmysql_unix_addr=/usr/local/mysql/data/mysql.sock \
#Unix Socket file path
-dwith_myisam_storage_engine=1 \
#安装 MyISAM Storage Engine
-dwith_innobase_storage_engine=1 \
#安装 InnoDB Storage Engine
-dwith_archive_storage_engine=1 \
#安装 Archive Storage Engine
-dwith_blackhole_storage_engine=1 \
#安装 blackhole Storage Engine
-dwith_partition_storage_engine=1 \
#安装数据库分区
-denabled_local_infile=1 \
#允许从本地导入数据
-dwith_readline=1 \
#快捷键功能
-dwith_ssl=yes \
#支持 SSL
-ddefault_charset=utf8 \
#使用 UTF8 Characters
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
#校验字符
-dextra_charsets=all \
#安装所有扩展字符集
-dmysql_tcp_port=3306 \
#MySQL Listening Port
b The installation package that is often missing in the PHP installation
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.
The MySQL client library is not bundled anymore!
Solutions:
Quote: # Yum Install Mysql-devel (for Redhat & Fedora)
# Apt-get Install Libmysql++-dev (for Ubuntu)
Configure:error:Please Reinstall the ncurses distribution
Solutions:
Quote: # yum Install ncurses Ncurses-devel
Checking for UNIXODBC support ... configure:error:ODBC header file '/usr/include/sqlext.h ' not found!
Solutions:
Quote: # yum Install Unixodbc-devel
Configure:error:Cannot Find Pspell
Solutions:
Quote: # yum Install Pspell-devel
Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
Solutions:
Quote: # yum Install Libmcrypt libmcrypt-devel (for Redhat & Fedora)
# Apt-get Install Libmcrypt-dev
Configure:error:snmp.h not found. Check your SNMP installation.
Solutions:
quote:# Yum Install Net-snmp net-snmp-devel