Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Drupal のMultisite対応

Drupalをマルチサイト対応にする方法を書いておく。

さくらレンタルサーバは複数のドメインを使わせてもらえるので、例えば、http://example.sakura.ne.jp/ というサイトと、http://abc.chew.jp/ という別々のサイトを運営することができる。両方のサイトをともにDrupalで構築しようとするとき、Drupalのコードは1つにしてき、データベースや設定を別々にすることができる。このようにすればDrupalモジュールのアップデートなどもどちらかのサイトで1回だけ行えばよい。

その方法は以下のページに書いてある。
Multisite – Sharing the same code base

この通りの手順でやってみた。さくらレンタルサーバの場合、最初のサイトは ~/www の下にファイルを置くことになる。その後、別のドメインを取得すると、~/www/another_site の下に第二のサイト用のファイルを置くことになる。

前提として、~/www にdrupal がインストールしてあり、http://example.sakura.ne.jp/ というサイトで使用しているとする。そこへ、新たに http://abc.chew.jpというサイトを追加する場合の手順である。

  1. 新しいサイト用のデータベースを作る
  2. ‘sites’の下に新しい abc.chew.jp というディレクトリを作る
  3. ‘sites/default/defalt.settings.php’ をabc.chew.jp の下に settings.php という名前でコピーする
  4. abc.chew.jpディレクトリのパーミションを 555 にし、abc.chew.jp/settings.php にいったんWriteパーミションを付加する
  5. www/subdirからwwwへシンボリックリンクを張る。subdir はabc.chew.jp でアクセスするときのWEBルートである。wwwディレクトリで、ln -s . subdir とすればよい。
  6. http://abc.chew.jp/install.php へアクセスしてインストールする。

これでできるはずだ。
それから、cron はサイトごとに実行しなければならない。例えば、http://example.sakura.ne.jp/cron.php と http://abc.chew.jp/cron.php の両方を定期的に実行する必要がある。

PAGE TOP