SugarCRMのインストール

SugarCRMCentOS on VMWare Playerにインストールします。

環境は以下の通り。

以下の手順でインストールをします。

  1. CentOSの環境設定
  2. Apache, PHP, MySQLのインストール
  3. php.iniとmy.cnfの編集
  4. データベースの作成
  5. SugarCRMのインストール

1. CentOSの環境設定

CentOSVMWare Playerに簡易インストールした場合、いろいろ足りていないものがあるため設定します。
[日本語のフォント]
 参考URL: 日本語フォントの設定 on CentOS 5.3
 IPAフォントの設定で、

# fc-cache -fv

 を実行してエラーが出る場合は、failed が出るフォルダのタイムスタンプを以下のように touch で更新する。

# touch /usr/share/fonts/bitmap-fonts/


[キーボードの変更]
 System -> Keyboard -> Layout で
 ・Keyboard model を Japanese 106-key
 ・Selected layouts に Japan を追加


[日本語入力]
参考URL: CentOS 日本語入力できるようにする。

2. Apache, PHP, MySQLのインストール

参考URL1: SugarCRMのインストール: ペンギンの教科書
参考URL2: パソコンに関すること、特にcentosで試行錯誤 - sugarcrmインストール

CentOS5.5を簡易インストールした場合、Apacheのみインストールされます。

[root@localhost ~]# rpm -qa http*
httpd-2.2.3-43.el5.centos.3
[root@localhost ~]# rpm -qa php*
[root@localhost ~]# rpm -qa mysql*
[root@localhost ~]#

[PHPMySQLのインストール]
yumで必要なものをインストールします。

[root@localhost ~]# yum -y install php php-mysql php-ldap php-pdo
〜略〜
[root@localhost ~]# yum -y install mysql mysql-server mysql-connector-odbc mysql-devel mysql-bench
〜略〜
[root@localhost ~]#

参考URL1ではここでアップデートしていますが、最後にまとめてすることにします。


[php-mbstring, php-json, php-imap のインストール]
php に必要なモジュールである php-mbstring, php-json, php-imap をインストールします。
こちらは参考URL1の手順でそのままできます。
まずは、php-jsonから。
php-jsonrpmパッケージがないので、以下の手順でリビルドしてインストールします。
リビルドにはphp-develが必要なので、yum でインストールします。

[root@localhost ~]# rpm -qa php-devel libtool gcc-c++
gcc-c++-4.1.2-48.el5
libtool-1.5.22-7.el5_4
[root@localhost ~]# yum -y install php-devel
〜略〜
[root@localhost ~]#

[root@localhost ~]# wget http://www.aurore.net/projects/php-json/php-json-4.3.2_1.2.1-1.aurore.src.rpm
[root@localhost ~]# rpmbuild --rebuild --target=i386 php-json-4.3.2_1.2.1-1.aurore.src.rpm
[root@localhost ~]# cd /usr/src/redhat/RPMS/i386/
[root@localhost i386]# rpm -ivh php-json-5.1.6_1.2.1-1.aurore.i386.rpm
〜略〜
[root@localhost i386]# rpm -ivh php-json-debuginfo-5.1.6_1.2.1-1.aurore.i386.rpm 
〜略〜
[root@localhost ~]#

次に、php-mbstring と php-imap のインストール。

[root@localhost i386]# yum -y install php-imap php-mbstring
〜略〜
[root@localhost ~]#

こんな感じになります。

[root@localhost ~]# rpm -qa php*
php-common-5.1.6-27.el5
php-json-debuginfo-5.1.6_1.2.1-1.aurore
php-ldap-5.1.6-27.el5
php-cli-5.1.6-27.el5
php-5.1.6-27.el5
php-devel-5.1.6-27.el5
php-mbstring-5.1.6-27.el5
php-mysql-5.1.6-27.el5
php-json-5.1.6_1.2.1-1.aurore
php-imap-5.1.6-27.el5
php-pdo-5.1.6-27.el5
[root@localhost ~]# rpm -qa mysql*
mysql-bench-5.0.77-4.el5_5.4
mysql-devel-5.0.77-4.el5_5.4
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-server-5.0.77-4.el5_5.4
mysql-5.0.77-4.el5_5.4
[root@localhost ~]#

[アップデート]
以下の手順でパッケージのアップデートをします。
1. リポジトリのインストール
 * それぞれバージョンを確認して取得。

[root@localhost ~]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
[root@localhost ~]# wget http://rpms.famillecollet.com/el5.i386/remi-release-5-8.el5.remi.noarch.rpm
[root@localhost ~]# rpm -Uvh epel-release-5* remi-release-5*

[root@localhost ~]# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
[root@localhost ~]# rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.i386.rpm

2. インストール

 [root@localhost ~]# yum -y --enablerepo=remi,epel,rpmforge update php* mysql*

[httpdの再起動]
 すべてのモジュールのインストール・アップデートを反映させるため再起動します。

[root@localhost ~]# service httpd restart

以上でPHPMySQLのパッケージのインストールは終わりです。

3. php.iniとmy.cnfの編集

SugarCRMのための設定をします。
まずはPHPの設定をするためphp.iniを編集します。

[root@localhost ~]# cp -p /etc/php.ini /etc/php.ini.org
[root@localhost ~]# vi /etc/php.ini

264行目
変更前: output_buffering = 4096
変更後: output_buffering = On

291行目
変更前: zlib.output_compression = Off
変更後: zlib.output_compression = On

878行目
変更前: upload_max_filesize = 2M
変更後: upload_max_filesize = 10M

1592行目[mbstring]以降
変更前: ;mbstring.language = Japanese
変更後: mbstring.language = Japanese

変更前: ;mbstring.internal_encoding = EUC-JP
変更後: mbstring.internal_encoding = UTF-8

変更前: ;mbstring.http_input = auto
変更後: mbstring.http_input = auto

変更前: ;mbstring.http_output = SJIS
変更後: mbstring.http_output = pass

変更前: ;mbstring.detect_order = auto
変更後: mbstring.detect_order = auto

変更前: ;mbstring.substitute_character = none
変更後: mbstring.substitute_character = none

追加
default_character = UTF-8

httpdの再起動

 [root@localhost ~]# service httpd restart

次に、my.cnfを編集します。

[root@localhost ~]# cp -p /etc/my.cnf /etc/my.cnf.org
[root@localhost ~]# vi /etc/my.cnf

[mysqld]の下に下記を追加して保存。

 skip-character-set-client-handshake

以上でphp.iniとmy.cnfの編集は終わりです。


つづく