FreeBSD 10.2 RELEASE - NetCommons - インストール


クラウディア 


1. インストール要件
2. ダウンロード
3. コンテンツの配置
4. Apache 構成ファイル作成
5. データベース作成

1. インストール要件

 NetCommons をインストールするには下記が必須要件となります(2015年10月6日に書き写したものですので最新は公式サイトで確認してください)。本サイトの他ページにそれぞれインストール・設定について記述してありますので参考にしてください。
 サーバ等  アプリケーション バージョン  本サイト参考  備考
WEBサーバ Apache 2.0.xx 以降 ウェブサーバ apache
データベースサーバ MySQL 5.0.x 以降 データベース MySQL
処理言語 PHP 5.1.6 以降 apache - PHP

 いずれもバージョンが新しすぎても失敗する場合もあります。

2. ダウンロード

 「NetCommons」は、「ports」にも「pkg」にもありませんので、以下のサイトよりダウンロードします。
NetCommons2 公式サイト
 2015年10月6日時点で入手可能な最新版は 2.4.2.1 でした。

3. コンテンツの配置

 ダウンロードした NetCommons-2.4.2.1.tar.gz をサーバーの適切な位置に配置(クライアントでダウンロードした場合はサーバーへアップロード)して解凍します。

> tar xvzf NetCommons-2.4.2.1.tar.gz
 カレントディレクトリ配下に以下のディレクトリが解凍されます。
NetCommons-2.4.2.1 ┳ docs ...
                   ┗ html ...
 上記の html 配下をドキュメントルートへ移動して、パーミッションを変更します。

> mv NetCommons-2.4.2.1/html ドキュメントルート/コンテンツサブディレクトリ名
> cd ドキュメントルート
> chown -R www:www コンテンツサブディレクトリ名

4. Apache 構成ファイル作成

 コンテンツディレクトリを /usr/local/www/netcommons だとすると  ここにアクセス可能となるように /usr/local/etc/apache24/netcommons.conf ファイルを作成して下記のように記述します。

Alias /netcommons/ "/usr/local/www/netcommons/"

<Directory "/usr/local/www/netcommons/">
    Options None
    AllowOverride None
    Require all granted
</Directory>

5. データベース作成

 mySQL に NetCommons 用のデータベースを作成します。仮に以下のようにするとすれば
データベース名 netcombase
データベースユーザ netcomuser
 以下のようにしてデータベース・ユーザを作成します。

> mysql -u root -p
Enter password: ← パスワードを入力
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.20 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database netcombase;
Query OK, 1 row affected (0.03 sec)

mysql> GRANT ALL PRIVILEGES ON netcombase.* to netcomuser@localhost IDENTIFIED BY 'パスワード';
Query OK, 0 rows affected (0.04 sec)

mysql> Bye ← [Ctrl-D] で抜けます

earthcar(アースカー)