2013年12月11日 星期三

VtigerCRM安裝步驟

OS:ubuntu 12.04
1.下載vTigercrm的安裝檔
sudo wget http://sourceforge.net/projects/vtigercrm/files/vtiger%20CRM%205.3.0/Core%20Product/vtigercrm-5.3.0.tar.gz

2.解開vTigercrm的安裝檔
sudo tar zxvf vtigercrm-5.3.0.tar.gz

3.安裝vTigercrm需要的環境架構libraries, MySQL, and PHP(Apache,MySQL,PHP或是LDAP伺服器)
sudo apt-get install binutils cpp flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl
libpcre3 libpopt-dev lynx m4 make  ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9
libtool bison autotools-dev gcc libpng12-dev libjpeg62-dev libfreetype6-dev libssl-dev libxml2-dev libxml2 apache2 php5-mysql
libapache2-mod-php5 mysql-server php5-gd php5-imap
如果出現錯誤應該是已經安裝過perl了,把libarchive-zip-perl拿掉就可以了,安裝mysql套件時會出現提示視窗設定MySQL密碼.

4.設定Apache:sudo /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerName tiger.mydomain.com
DocumentRoot /var/www

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ServerSignature Off
</VirtualHost>

5.複製剛剛解開的vtigercrm-5.3.0.tar.gz到Apache預設資料夾下
sudo cp -rf /vtigercrm/* /var/www/

6.設定權限後安裝vtigercrm
sudo chmod -R a+rw config.inc.php
sudo chmod -R a+rw tabdata.php
sudo chmod -R a+rw install.php
sudo chmod -R a+rw parent_tabdata.php
sudo chmod -R a+rw cache
sudo chmod -R a+rw cache/images/
sudo chmod -R a+rw cache/import/
sudo chmod -R a+rw storage/
sudo chmod -R a+rw install/
sudo chmod -R a+rw user_privileges/
sudo chmod -R a+rw Smarty/cache/
sudo chmod -R a+rw Smarty/templates_c/
sudo chmod -R a+rw modules/Emails/templates/
sudo chmod -R a+rw modules/
sudo chmod -R a+rw cron/modules/
sudo chmod -R a+rw test/vtlib/
sudo chmod -R a+rw backup/
sudo chmod -R a+rw Smarty/templates/modules/
sudo chmod -R a+rw test/wordtemplatedownload/
sudo chmod -R a+rw test/product/
sudo chmod -R a+rw test/user/
sudo chmod -R a+rw test/contact/
sudo chmod -R a+rw test/logo/
sudo chmod -R a+rw logs/
sudo chmod -R a+rw modules/Webmails/tmp/

7.設定vtigercrm安裝時需要使用的資料庫(vtigercrm安裝在unix-like版本時需要資料庫支援uft-8)
連線到MySQL
#mysql -u root -p
增加一個vtigercrm要使用的資料庫
mysql>CREATE DATABASE vtiger資料庫名 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
設定vtigercrm資料庫的使用者
mysql>GRANT ALL ON vtiger_db.* TO 'vtiger使用者帳號名稱' @'主機IP' IDENTIFIED BY 'vtiger使用者密碼';

8.開啟mysql遠端連線並測試
8.1.修改mysql的設定檔sudo vim /etc/mysql/my.cnf
8.2.找到 :bind-address = 127.0.0.1 這一行要注釋掉
8.3.重啟 MySQL $> sudo /etc/init.d/mysql restart
8.4.測試連線方法一:mysql -h 主機ip -u vtigeruser  -p
    測試連線方法二:寫測試php頁面程式,檔名:mysqltest.php,測試方式:http://主機IP/mysqltest.php
#code#
<?php
$link = mysql_connect('10.27.21.105', 'vtigercrm', 'xxxxxx');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

9.開啟網址安裝vtigercrmURL: http://主機ip/install.php,請注意安裝過程中會需要回去修改php.ini這個檔案符合vtigercrm安裝需求.

安裝過程中如果有出現:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near 'Type=InnoDB' at line 7Error: Tables partially created. Table creation failed.的訊息,請依照下列方式修改
1.cd schema
2.vi DatabaseSchema.xml找到Type=InnoDB修改成ENGINE=InnoDB
3.重新安裝vtigercrm.
參考連結:http://www.christopherkois.com/?p=512 等等

沒有留言:

張貼留言