OSSでチャットツールを探していたところ、SPIKAを見つけました。
そこで、CentOS6 に OSS メッセンジャーの SPIKA をインストールしてみました。
※ここでは、とりあえず動作する手順のみ書いています。セキュリティとか無視してます
■SPIKA公式
http://spikaapp.com/ja/
目次
1. EPELのリポジトリ登録
[root@localhost ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm を取得中 警告: /var/tmp/rpm-tmp.iRW5Nq: ヘッダ V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY 準備中... ########################################### [100%] 1:epel-release ########################################### [100%]
SPIKAインストールに必要な xdebug と phpunit をインストールするためにEPELを使用します。
2. 必要なパッケージのインストール
[root@localhost ~]# yum -y install httpd mod_ssl curl git php php-curl php-mysql php-gd php-phpunit-PHPUnit php-pecl-xdebug mysql-server
※mod_ssl をインストールしているのはhttpsを対応にできるようにするためです。必須ではありません。ただ、httpsでSPIKAを利用すると、チャット発言のリアルタイム反映がうまくいきませんでした。
3. SPIKAのインストール
[root@localhost ~]# cd /var/www/html/ [root@localhost html]# git clone https://github.com/cloverstudio/Spika-Server.git [root@localhost html]# cd Spika-Server/ [root@localhost Spika-Server]# mkdir logs [root@localhost Spika-Server]# mkdir uploads [root@localhost Spika-Server]# chmod 777 logs/ [root@localhost Spika-Server]# chmod 777 uploads/ [root@localhost Spika-Server]# php composer.phar install -d . (snip) silex/silex suggests installing symfony/form (>=2.3,<2.5-dev) phpunit/phpunit suggests installing phpunit/php-invoker (>=1.1.0,<1.2.0) symfony/dom-crawler suggests installing symfony/css-selector () symfony/browser-kit suggests installing symfony/process () Generating autoload files
4. Apacheの設定
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf (snip) <Directory "/var/www/html"> (snip) # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None ↓ # 変更 AllowOverride All
5. MySQLの設定
[root@localhost ~]# vi /etc/my.cnf (snip) # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 character-set-server = utf8 # 追加 skip-character-set-client-handshake # 追加
6. ApacheとMySQLの起動
[root@localhost ~]# service httpd start [root@localhost ~]# chkconfig httpd on [root@localhost ~]# service mysqld start [root@localhost ~]# chkconfig mysqld on
7. SPIKAで使用するDBとMySQLのユーザーを作成
[root@localhost ~]# mysql -u root mysql> create database spikadb; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on spikadb.* to spikauser@localhost identified by 'password'; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
8. SPIKAのセットアップ
ブラウザで以下のアドレスにアクセスします。
アドレス : http://IP or FQDN/Spika-Server/wwwroot/installer
8-1. DB情報を入力
DB情報を入力して、「Connect to Database」をクリックします。
8-2.スキーマ作成
「Create Database Schema」をクリックします。
8-3. 初期データ作成
「Create Initial Data」をクリックします。
8-4. 初期設定
赤枠部分をコピーします。
以下のファイル(init.php)を修正します。
[root@localhost ~]# vi /var/www/html/Spika-Server/config/init.php (snip) /* change here */ /*define('ROOT_URL','http://localhost:8080/wwwroot'); コメントアウト define('LOCAL_ROOT_URL', 'http://localhost/wwwroot'); コメントアウト*/ define('ROOT_URL','http://192.168.0.195/Spika-Server/wwwroot'); /* 追加 */ define('LOCAL_ROOT_URL', 'http://localhost/Spika-Server/wwwroot'); /* 追加 */ /*define("MySQL_HOST", 'localhost'); コメントアウト define('MySQL_DBNAME', 'spikadb'); コメントアウト define('MySQL_USERNAME', 'root'); コメントアウト define('MySQL_PASSWORD', 'yourpassword'); コメントアウト */ define("MySQL_HOST", 'localhost'); /* 追加 */ define('MySQL_DBNAME', 'spikadb'); /* 追加 */ define('MySQL_USERNAME', 'spikauser'); /* 追加 */ define('MySQL_PASSWORD', 'password'); /* 追加 */
8-5. SPIKAの開始
9. ログイン
SPIKAにログインします。
初期情報は以下の通りです。
ID : admin@spikaapp.com
PW : password
「Sing In」をクリックしてログインします。
以下は、初期ログイン画面です。