1、搭建LAMP--apache、mysql、php。php
使用系統及軟件版本:ubuntu 14.04; apache 2.4.20;mysql 5.6.30;html
Mysql:mysql
使用apt-get安裝:sql
#apt-get install mysql-server-5.6 mysql-client-5.6 mysql-common-5.6數據庫
安裝過程當中會提示輸入mysql密碼apache
安裝完成後啓動mysql:ubuntu
#service start mysqlswift
Apache:windows
一、安裝C++編譯相關組件:瀏覽器
#apt-get install build-essential
二、編譯安裝apr:
#tar -zxvf apr-1.4.6.tar.gz
#cd apr-1.4.6
#./configure --prefix=/use/local/apr
#make && make install
三、編譯安裝apr-util:
#tar -zxvf apr-util-1.5.4.tar.gz
#cd apr-util-1.5.4
#./configure --prefix=/use/local/apr-util --with-apt=/usr/local/apr
#make && make install
四、編譯安裝pcre:
#tar -zxvf pcre-8.31.tar.gz
#cd pcre-8.31
#./configure --prefix=/usr/local/pcre
#make && make install
五、編譯安裝zlib:
#tar -zxvf zlib-1.2.8.tar.gz
#cd zlib-1.2.8
#./configure --prefix=/usr/local/zlib
#make && make install
六、安裝zlib1g-dev:
#apt-get install zlib1g-dev
七、編譯安裝apache:
#tar -zxvf httpd-2.4.20.tar.gz
#cd httpd-2.4.20
#./configure --prefix=/usr/local/apache --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-worker --enable-rewrite --with-apt=/usr/local/apr --with-apr-util=/usr/loacal/apr-util --with-pcre=/usr/local/pcre
#make && make install
PHP
一、編譯安裝png:
#tar -zxvf libpng-1.6.7.tar
#cd libpng-1.6.7
#./configure --prefix=/usr/local
#make && make install
二、編譯安裝libiconv:
#tar -zxvf libiconv-1.14.tar
#cd libiconv-1.14
#./configure --prefix=/usr/local
#make && make install
三、編譯安裝freetype:
#tar -zxvf freetype-2.6.tar
#cd freetype-2.6
#./configure --prefix=/usr/local
#make && make install
四、編譯安裝GD:
#tar -zxvf libgd-2.1.1.tar
#cd libgd-2.1.1
#./configure --prefix=/usr/local --with-libiconv-prefix=/usr/loal --with-png=/usr/local --with-freetype=/usr/local
#make && make install
安裝PHP組件
一、安裝libxml
#apt-get install libxml2
#apt-get install libxml2-dev
二、編譯安裝mhash:
#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./configure --prefix=/usr/local
#make && make install
三、編譯安裝libmcrypt:
#tar -zxvf libmcrypt-2.6.8.tar.gz
#cd libmcrypt-2.6.8
#./configure --prefix=/usr/local
#make && make install
四、編譯安裝mcrypt:
#tar -zxvf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#LD_LIBRARY_PATH=/usr/local/lib ./configure --prefix=/usr/local
#make && make install
五、安裝curl:
#apt-get install curl libcurl3-dev php5-curl
六、編譯安裝php:
#tar -zxvf php-5.6.21.tar.gz
#cd php-5.6.21
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-gd --with-zlib --enable-zip --without-sqlite3 --without-pdo-sqlite --with-pear
#make && make install
複製php配置文件:
複製php.ini-development或php.ini-production到/usr/local/php/etc/php.ini
更改時間域:
925行:date.timezone = Asia/Shanghai
2、整合Apache與php:
修改apache配置文件:
#vi /usr/local/apache/conf/httpd.conf
114行:LoadModule php5_module /usr/local/apache/modules/libphp5.so
250行:DirectoryIndex index.php index.html
387行:AddType application/x-httpd-php .php
388行:AddType application/x-httpd-php-source .phps
保存退出,重啓apache
php測試:
vi info.php
<?php
phpinfo();
?>
3、連接php與Mysql:
開啓Extensions:
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_imap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_soap.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll
連接mysql:
1001行:pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock
1209行:mysqli.default_socket =/var/run/mysqld/mysqld.sock
mysql測試:
vi mysql.php
<?php
$link=mysqli_connect('localhost','root','you password');
if(!$link)
{
die('Could not connect: ' . mysql_error());
}
else echo "success";
mysqli_close($link);
?>
4、搭建kayako系統
https://kayako.atlassian.net/wiki/display/DOCS/New+installation
一、下載安裝包
二、解壓 將文件解壓/上傳到apache服務器根目錄(虛擬主機根目錄)
三、建立數據庫:
#mysql -u root -p
> CREATE DATABASE kayako_fusion;
> USE kayako_fusion;
> ALTER DATABASE kayako_fusion DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> GRANT ALL PRIVILEGES ON kayako_fusion.* TO
'kayako_user'
@
'localhost'
IDENTIFIED by
'this_is_a_weak_password'
;
> exit
重啓數據庫
四、編輯kayako中config.php文件:
位置:__swift/config/
#cp config.php.new config.php
#vi config.new
define('SWIFT_BASENAME', 'index.php?');
/**
* DATABASE HOSTNAME
*/
define('DB_HOSTNAME', 'localhost');
/**
* DATABASE USERNAME
*/
define('DB_USERNAME', 'root');
/**
* DATABASE PASSWORD
*/
define('DB_PASSWORD', 'you password');
/**
* DATABASE NAME
*/
define('DB_NAME', 'kayako_fusion');
五、上傳key.php文件(此文件爲官網購買)
六、更改文件權限:
__swift/files
__swift/cache
__swift/geoip
__swift/logs
__apps
# chmod -Rf 777 files cache geoip logs
# chmod -Rf 777 __apps
七、安裝kayako:
windows端打開瀏覽器並輸入kayako服務器IP/setup便可訪問kayako安裝界面;
10.11.20.15/setup