在CentOS下安装源码SugarCRM Pro / CE 5.0.0 (待续)
1.install curl
http://curl.haxx.se/download/curl-7.15.0.tar.gz
# rpm -q curl
# tar –xzvf curl-7.15.0.tar.gz
# cd curl-7.15.0
# ./configure –prefix=/usr/local/curl
# make
# make install
2.install zlib
http://www.zlib.net/zlib-1.2.3.tar.gz
# rpm –q zlib
# rpm –e zlib --nodeps
# tar –xzvf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure –prefix=/usr/local/zlib
# make
# make install
3.install imap
ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
# wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z(如果不能下载,可以上网搜索c-client.tar.Z文件)
# tar xzf c-client.tar.Z
# mv imap-2006k imap-2006h
# cd imap-2006h
# make lrh (我用的系统是CentOS,如果你用的是其它的系统,可以查看Makefile文件)
# cd c-client
# cp *.h /usr/local/include
# cp *.c /usr/local/lib
# cp c-client.a /usr/local/lib/libc-client.a
4.install apache
http://apache.mirror.phpchina.com/httpd/httpd-2.2.8.tar.bz2
# rpm –q httpd
# rpm –e httpd –-nodeps
# rm -rf /etc/httpd
# cd /usr/src
# tar -xjvf httpd-2.2.8.tar.bz2
# cd httpd-2.2.8
# ./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --enable-rewrite -–enable-spling
# make
# make install
如果你想一开机就让apache自动运行的话,那么进行如下操作:
编辑etc/rc.d/rc.local
# vi /etc/rc.d/rc.local
在最后加上一句: /usr/local/apache2/bin/apachectl start
# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
启动运行apache:
# /usr/local/apache2/bin/apachectl start
或# service httpd start
然后在本机浏览器里面输入:http://127.0.0.1,回车,默认会显示:it works字样,证明apache已经在工作状态中了。
5.install mysql
http://mysql.orst.edu/Downloads/MySQL-5.0/mysql-5.0.45-linux-i686.tar.gz
# rpm –q mysql
# rpm –e mysql --nodeps
# cd /usr/src
# tar -zxvf mysql-5.0.45-linux-i686.tar.gz
# mv mysql-5.0.45-linux-i686 /usr/local/mysql
# cd /usr/local/mysql/
# groupadd mysql
# useradd -g mysql mysql
# chown -R mysql .
# chgrp -R mysql .
# scripts/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# bin/mysqld_safe --user=mysql &
正常情况下,mysql能正常运行,如果不删除旧版本(#rpm –q mysql # rpm –e mysql --nodeps),则安装新版本时可能会出现问题。
# bin/mysqladmin –u root password 123456 (设置mysql的root用户的密码,当然你可以设置自己的密码,不设置也可以,不过为了安全,还是设置了吧)
# cd /etc/init.d/
# cp /usr/local/mysql/support-files/mysql.server mysql
# chkconfig --add mysql
# chkconfig mysql on
# chkconfig --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service mysql start //启动mysqld服务
# netstat -atln //查看3306端口是否打开。要注意在防火墙中开放该端口。
6.install php5
http://cn.php.net/distributions/php-5.2.5.tar.bz2
安装php5,php5必须有libxml2支持!
确定系统中已经安装了libxml2 和libxslt、curl(可选)
# rpm -q libxml2
# rpm -q libxslt
# tar –xjvf php-5.2.5.tar.bz2
# cd php-5.2.5
# ./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-zlib=/usr/local/zlib --with-curl=/usr/local/curl --with-openssl --with-imap --with-imap-ssl
# make
# Make test
# make install
# cp php.ini-dist /usr/local/php5/lib/php.ini
注意:最后有个cp命令。
修改apache配置文件
# vim /usr/local/apache2/conf/httpd.conf
安装完成后,/usr/local/apache2/conf/httpd.conf中自动有
LoadModule php5_module modules/libphp5.so
找到# AddType application/x-gzip .gz .tgz
并在后面加入,
AddType application/x-httpd-php .php
或AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
这两行的目的是让apache识别php。
再找到“DirectoryIndex index.html”
加上 index.php 让它把index.php做为默认页
测试环境:
在/usr/local/apache2/htdocs/下面建立php文件。
# vi /usr/local/apache2/htdocs/index.php
输入:
<?
phpinfo();
?>
重启apache服务器
# /usr/local/apache/bin/apachectl restart
或
# service httpd restart
浏览器中输入:http://127.0.0.1/index.php测试一下
7.install SugarCRMPro
install SugarCRMPro