CMS - Drupal - ports でインストール - モジュールの展開

 クラウディア
1. 概要
2. インストール要件
3. ports
4. どこにインストールされるか
5. ports と分離
6. .htaccess をチェック
7. パーミッションの設定
8. php.ini の確認

1. 概要

 残念ながら日本サイトのインストール手順書は「バグ修正と脆弱性修正を含むすべてのサポートが終了いたしました」という Drupal 6 のものではあります。  まぁ、ボランティアで活動なさっている型の苦労を思えば、頭の下がる思いこそすれ、ドキュメントが遅いことになんの不満もありません。  やってみるす。  一応、章立ては 「Drupal 6 クイックスタートページ」と題するサイトの章立てに沿うようにやってみます。  (参考サイトを掲載していましたが、リンク切れになりました)

2. インストール要件

 「Drupal 6 インストール - ステップ1」と題する際とによれば。  (参考サイトを掲載していましたが、リンク切れになりました)  「タイプ - A」PHP が Apache モジュールで動作し、mbstring が有効なサーバ(主に国内の一般的なホスティング)  特に設定の必要はありません。  と書いてある。  はは、わたしの持っている環境は「タイプ - A」だわ。  まんまインストールを開始しますか。

3. ports

 ありがたいことに、Drupal は ports に存在するのだ。  XOOPS のように ports でインストール後、分離するかどうかは後で考えます。

cd /usr/ports/www/drupal8
make config
 使用する可能性のあるデータベースにチェックをいれておきます。
「Drupal」-「/usr/ports/www/drupal8」「make config」


cd /usr/ports/www/drupal8
make
make install
 インストール時のメッセージのメモ

Installing drupal8-8.5.5...
################################################################################
Complete instructions for installing and configuring Drupal can be found here:

/usr/local/share/doc/drupal8/INSTALL.txt

You need to create the DB where Drupal is going to live, and depending on
which database you intend to use, you should consult one of the following
documents:

 /usr/local/share/doc/drupal8/INSTALL.mysql.txt
 /usr/local/share/doc/drupal8/INSTALL.pgsql.txt
 /usr/local/share/doc/drupal8/INSTALL.sqlite.txt

You also need to add appropriate configuration directives to your apache
configuration file (/usr/local/etc/apache(2)/httpd.conf).

A typical configuration might read:

    Alias /drupal "%%DRUPAL_DIR%%"
    <Directory "%%DRUPAL_DIR%%">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

Please see http://drupal.org/cron for important information on setting up
periodic maintenance tasks in Drupal.

Please see http://drupal.org/requirements for important information on
system requirements for Drupal 8.  In particular, please ensure that your
configuration:

- uses PHP 5.2.5 or later
- PHP "memory_limit" is set to "32Mb" or larger
- PHP "register_globals" is set to "Off"
- PHP "safe_mode" is set to "Off"
- PHP "session.cache_limiter" is set to "nocache"

For important information about upgrading from previous versions of Drupal, please
please see: /usr/local/share/doc/drupal8/UPDATE.txt

You can install www/drush if you have problems with Drupal update. Drush is a
command line tool for Drupal
################################################################################

4. どこにインストールされるか

 インストール後に

/usr/local/www/drupal8/
 なるディレクトリが作成されております。

5. ports と分離

 やはりここは、以降のメンテナンスを意識して ports と分離すべきかと判断

cd /usr/local/www/
cp -R drupal8 drupal
cd /usr/ports/www/drupal8
make deinstall

6. .htaccess をチェック

 「タイプ - A」は .htaccess で大概設定できると書いてあることとインストール時のメッセージが気になって、たまたま早めに見ておいてよかった。

/usr/local/www/drupal/.htaccess
 ざっくり見てやばそうなのが

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value assert.active                   0
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
  # PHP 5.6 has deprecated $HTTP_RAW_POST_DATA and produces warnings if this is
  # not set.
  php_value always_populate_raw_post_data   -1
</IfModule>
 「uses PHP 5.2.5 or later」とは書いてありますが、わたしが使用しているのは PHP 7.2.8 です。  「Too late?」ここを書き直すだけで行けるのかどうか・・・。  その他の apache のモジュールでインストールしているかどうか不安な面もありますが・・・。  とりあえず、PHP のモジュールのみは書き換えておきます。

# PHP 5, Apache 1 and 2.
<IfModule php7_module>
  php_value assert.active                   0
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
  # PHP 5.6 has deprecated $HTTP_RAW_POST_DATA and produces warnings if this is
  # not set.
  php_value always_populate_raw_post_data   -1
</IfModule>
 でいいのかしら?

7. パーミッションの設定


chown -R www:www /usr/local/www/drupal

8. php.ini の確認

 インストール時のメッセージに従って

/usr/local/etc/php.ini
 内容を確認しておきます。 - PHP "memory_limit" is set to "32Mb" or larger  これ は最小が 32MB と書いていたのでとりあえずそのまま。

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M
- PHP "register_globals" is set to "Off" - PHP "safe_mode" is set to "Off"  register_globals、safe_mode という設定値が見当たらなかったのでそのまま。 - - PHP "session.cache_limiter" is set to "nocache"  これはデフォルトで nocache が設定されていました。

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
; http://php.net/session.cache-limiter
session.cache_limiter = nocache
earthcar(アースカー)
Amazonギフトカード
葬送のフリーレン Prime Video