LoginSignup
30
24

More than 5 years have passed since last update.

HumHubというCMSを使ってSNSを秒で作る

Last updated at Posted at 2018-01-07

概要

HumHubというCMSを使うと、SNSサービスを秒で作ることができます。
HumHubとは、SNSに必要な機能が一通り用意されているPHP製のCMSです。

Screen Shot 2018-01-07 at 17.25.26.png

関連

環境

  • CentOS 7.2
  • PHP 7.0.27
  • Composer 1.6.2
  • Apache 2.4.6
  • Mysql 5.7.20
  • HumHub 1.2.4

構成

項目
DocumentRoot /var/www/html/humhub/public/
DB User humhub
DB Name humhub_db

PHP, Mysql, Apacheのインストール

以下を参考にインストールしておいてください。

PHP Extensionのインストール

以下のextensionをインストールします。

$ sudo yum -y --enablerepo=remi,remi-php70 install php-pecl-zip
$ sudo yum -y --enablerepo=remi,remi-php70 install php-pecl-mysql
$ sudo yum -y --enablerepo=remi,remi-php70 install php-intl
$ sudo yum -y --enablerepo=remi,remi-php70 install php-ldap
$ sudo yum -y --enablerepo=remi,remi-php70 install php-apc

以下はPHPをインストールしたら入っていると思いますが、念のため。

$ sudo yum -y --enablerepo=remi,remi-php70 install php-curl
$ sudo yum -y --enablerepo=remi,remi-php70 install php-mbstring
$ sudo yum -y --enablerepo=remi,remi-php70 install php-exif
$ sudo yum -y --enablerepo=remi,remi-php70 install php-fileinfo

インストールしたら、Apacheをリスタートします。

$ sudo apachectl restart

HumHubのダウンロード

GitHubからclone

GitHubからソースをcloneします。

$ git clone https://github.com/humhub/humhub

ディレクトリ権限変更

以下のディレクトリの権限を変更します。

chmod 777 -R assets
chmod 777 -R protected/config/
chmod 777 -R protected/modules
chmod 777 -R protected/runtime
chmod 777 -R uploads/

composer install

このCMSはyiiを利用しているみたいなので、 fxp/composer-asset-plugin も入れます。

$ composer global require "fxp/composer-asset-plugin:~1.4.2"
$ composer install

/var/www/html/humhub/の下に、cloneされた、humhubをpublicというディレクトリ名に変更して設置します。

$ mv /var/www/html/humhub/humhub /var/www/html/humhub/public

DBとDBユーザー作成

DBを作成します。

mysql> CREATE DATABASE `humhub_db` CHARACTER SET utf8 COLLATE utf8_general_ci;

DBユーザーを作成します。

mysql> GRANT ALL ON `humhub_db`.* TO `humhub`@localhost IDENTIFIED BY 'password_changeme';
mysql> FLUSH PRIVILEGES;

初期設定

ブラウザからアクセスします。
http://192.168.33.10

すると、初期設定画面が表示されるので、ガイドに従って進んでいきます。

Screen Shot 2018-01-07 at 11.49.53.png

システム要件に不備があると、以下のようになるので、適宜対応してください。

Screen Shot 2018-01-07 at 11.53.05.png

問題がなければ以下のようになるので、次へをクリックしてください。

Screen Shot 2018-01-07 at 14.43.26.png

DBの設定

先程作成したDBの情報を入力してください。

Screen Shot 2018-01-07 at 14.44.31.png

Social Network Name

SNSの名前を入力します。

Screen Shot 2018-01-07 at 17.19.54.png

Configuration

このSNSをどのような用途で使用するのか選択します。
どれを選択するかによって、用途に沿ったプラグインのインストールが促されます。

Screen Shot 2018-01-07 at 14.58.49.png

今回は、 Skip this step, I want to set up everything manually を選択して、何もプラグインをインストールしないまま進めます。

Admin Account

サイトの管理者のアカウントを作成します。

Screen Shot 2018-01-07 at 14.59.32.png

Example contents

チェックを入れると、デフォルトで何人かのユーザーと投稿が入った状態のものが出来上がります。
HumHubがどのようなものかをとりあえず試してみたい方はチェックを入れましょう。
後で消せるらしいです。

Screen Shot 2018-01-07 at 15.01.20.png

インストール完了

これで初期設定は完了です!

Screen Shot 2018-01-07 at 15.04.17.png

sign in

先程作成した管理者アカウントでログインします。

Screen Shot 2018-01-07 at 17.24.26.png

Facebookみたいですね。
Example contentsにチェックを入れたので、既にユーザーと投稿が存在しています。

Screen Shot 2018-01-07 at 17.25.26.png

Admin管理画面

右上のプルダウンメニューから管理をクリックすると、Admin管理画面に飛ぶことができます。

Screen Shot 2018-01-07 at 22.19.18.png

以下のようなページに飛びます。

Screen Shot 2018-01-07 at 22.21.00.png

プラグイン

HumHubでは、プラグインを、モジュールという呼び方をするみたいです。

最期ほど、初期設定ではモジュールを何もインストールしなかったので、Admin管理画面でインストールしてみます。

左メニュのモジュールをクリックして、 オンラインで見る のタブを選択し、必要なモジュールをインストールします。

Screen Shot 2018-01-07 at 22.22.47.png

以下のプラグインを入れてみます。
インストール をクリックした後、 インストール済み のタブで 有効化 をクリックすることで適用されます。

  • Birthday Widget
    • 誕生日が来ると通知してくれるみたいです
  • Report Content
    • スパム投稿などを通報できるみたいです
  • Most Active Users Widget
    • アクティブなユーザーを一覧にして表示してくれるみたいです
  • Mail
    • ユーザー同士でメッセージのやり取りが可能になります
  • Social Share
    • 投稿を他のSNSと連携できるみたいです
  • Humhub Updater
    • Humhubのアップデートを簡単にしてくれるみたいです
  • Polls(質問のやつ?)
    • アンケート機能が使えるようになります
      • デフォルトで設定 -> 常に作動 を設定する必要があります

友達機能を有効にする

Administration 管理メニュー -> 設定 -> Enable user friendship system
にチェックして、保存を押すと、友達機能が有効になります。

Mail設定

Screen Shot 2018-01-07 at 23.11.02.png

以下の3つを選ぶことができます。

  • File (Use for testing/developoment)
  • PHP
  • SMTP

SMTPを選択した場合は、以下のような設定項目が現れます。

Screen Shot 2018-01-07 at 23.21.33.png

参考:http://docs.humhub.org/admin-installation-configuration.html#e-mails

関連

参考

30
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
24