CentOS 7 安裝 Zurmo CRM
- 安裝環境 : CentOS Linux release 7.5.1804 (Core)
- 安裝版本 : Zurmo 3.2.5 (zurmo-stable-3.2.5.d5d5f53cc259.tar.gz)
安裝程序
- 依據安裝需求要
- Apache >= 2.2.1
- PHP >= 5.3.3
- MySQL Server >= 5.1
- CentOS 7 內版本都能符合,不需要另外升級
- 安窗所有套件
yum install epel-release yum install wget httpd mariadb-server memcached java php php-mbstring pcre php-soap php-imap php-pdo php-mysql php-gd php-pecl-memcache php-ldap php-phpunit-PHPUnit mercurial php-pear php-devel httpd-devel pcre-devel php-pecl-apcu yum install php-mcrypt --enablerepo=centosplus
- 安裝 composer
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
- 設定與下載 composer 元件
mkdir /usr/local/composer cd /usr/local/composer vi composer.json
{ "require-dev": { "phpunit/phpunit": "^4.2.0", "phpunit/php-invoker": "^1.1.0", "phpunit/dbunit": "^1.3.0", "phpunit/phpunit-selenium": "^1.4.0", "phpunit/phpunit-mock-objects": "^2.2.0", "phpunit/phpunit-story": "^1.0.0", "phpunit/phpunit-skeleton-generator": "^2.0.0", "phpunit/php-code-coverage": "~2.0" } }
composer install
- 安裝 Selenium Server
mkdir /usr/local/selenium cd /usr/local/selenium wget https://goo.gl/Lyo36k mv Lyo36k selenium-server-standalone-3.0.1.jar java -jar selenium-server-standalone-3.0.1.jar
需要設定開機自動啟動
- 設定 Apache
vi /etc/httpd/conf/httpd.conf
: LoadModule deflate_module modules/mod_deflate.so : ServerName zurmo.ichiayi.com:80 :
- 設定 MySQL
vi /etc/my.cnf
[mysqld] : # Zurmo Setting character-set-server=utf8 collation-server=utf8_unicode_ci default-storage-engine=INNODB max_sp_recursion_depth=100 max_allowed_packet = 20M thread_stack = 512K optimizer-search-depth = 0 skip-log-bin :
- 設定 php
vi /etc/php.ini
[PHP] : include_path = ".:/usr/share/pear:/usr/share/php:/usr/local/composer/vendor/bin" : max_execution_time = 300 : memory_limit = 256M : post_max_size = 20M : file_uploads = On : upload_max_filesize = 20M : [Date] : date.timezone = Asia/Taipei
- 第一次啟動 MySQL 與設定 root 密碼
service mysqld start /usr/bin/mysqladmin -u root password 'root-password'
- 第一次啟動 Apache
service httpd start
- 第一次啟動 memcached
service memcached start
- 設定自動啟動 Apache 與 MySQL、memcached
chkconfig httpd on chkconfig mysqld on chkconfig memcached on
- 確認 php 設定是否正確
vi /var/www/html/t.php
<?php phpinfo();
透過瀏覽器讀取 http://xxx.xxx.xxx.xxx/t.php 確認以下幾項是否有存在
- apache2handler → Loaded Modules → mod_deflate
- date → Default timezone → Asia/Taipei
- Core → memory_limit → 256M
- Core → file_uploads → On
- Core → upload_max_filesize → 20M
- Core → post_max_size → 20M
- Core → max_execution_time → 300
- Core → include_path → .:/usr/share/pear:/usr/share/php
- PHP Variables → _SERVER[“xxx”]
- pcre → PCRE (Perl Compatible Regular Expressions) Support → enabled
- SPL → SPL support → enabled
- ctype → ctype functions → enabled
- soap → Soap Client → enabled
- soap → Soap Server → enabled
- curl → cURL support → enabled
- curl → cURL Information → 7.19.7
- mbstring → Multibyte Support → enabled
- imap → IMAP c-Client Version → 2007e
- PDO → PDO support → enabled
- pdo_mysql → PDO Driver for MySQL → enabled
- zip → Zip → enabled
- gd → GD Support → enabled
- 測試沒問題就移除 t.php
rm /var/www/html/t.php
- 下載與安裝 Zurmo
cd /var/www/html/ wget http://build.zurmo.com/downloads/zurmo-stable-3.2.5.d5d5f53cc259.tar.gz tar -zxvf zurmo-stable-3.2.5.d5d5f53cc259.tar.gz rm zurmo-stable-3.2.5.d5d5f53cc259.tar.gz chown -R apache:apache zurmo
- 直接連入網頁 http://xxx.xxx.xxx.xxx/zurmo/ 開始進入設定畫面
Database host <- localhost Database admin username <- root Database admin password <- root-password Database name <- zurmo Database username <- zurmo Database password <- zurmo-password Memcache host <- localhost Memcache port number <- 11211
如果檢測 memcache 的服務出現 Error code: 13
Message(Memcached): Permission denied
Message(Memcached): Permission denied
可能是 SELinux 造成, 可以關閉 SELinux 或是將 httpd_can_network_memcache –> off 改成 on
setsebool -P httpd_can_network_memcache true
更版程序
- 先將目前的版本備份起來, 如果使用 VM 可以先 Take Snapshot
常見問題
- Q : 如何更改成新的網址, Exp. http://192.168.0.118/zurmo → http://192.168.0.241/zurmo
- A : 參考網址 - http://zurmo.org/forums/index.php?/topic/1711-how-to-change-host-name-where-zurmo-installed/
- 編輯 app/protected/config/perInstance.php
- 修改
$instanceConfig['components']['request']['hostInfo'] = 'http://192.168.0.241';