SilverStripeインストールメモ(1)
SilverStripeのバージョンは2.4。
サーバーOSは、Ubuntuサーバー版9.10。
Webサーバーは、Apache 2.2.12。
サーバー側の基本的な設定は一通り終わったところから、
インストール画面のRequirements(Step: 1 of 5)まで。
1. SilverStripeのパッケージをダウンロードする。
今回はMac OS X 10.5でSafariを使い、以下からダウンロード。
Stable Download » SilverStripe
2. Mac上でパッケージを解凍する。
.tarのアーカイブが落ちてくるので、右クリックで「開く」を選んで解凍。
フォルダが作られる。
3. サーバーにアップロード。
バーチャルホストは設定済みで、
samba経由でそのディレクトリに、
解凍して作られたフォルダの中身をすべてコピーする。
Ubuntuでは、/var/www/が初期状態のドキュメントルートになっているので、
その下にディレクトリを作っておいた。
Macからアップロードすると、
「._〜」というファイルが必要ファイルの数だけ作られているので、
sshでサーバーに接続し、rmで削除した。
サブディレクトリの中にもあります。
4. ブラウザで、ファイル群をアップロードしたサイトにアクセスする。
ブラウザはとりあえずMacからSafariで。
http://(バーチャルホストの名前)/
↓
http://(バーチャルホストの名前)/install.php
に飛ばされる。
で、エラーがいくつか表示されているので、
1つずつ対処していく。
(アクセス権のあるユーザーで。)
5. _config.phpのパーミッション変更。
/var/www/(バーチャルホストのディレクトリ)/mysite/_config.php
のパーミッションが644になっているので、666に変更。
$ chmod 666 _config.php
エラーメッセージの内容を記録するの忘れたけど、
インストール後に元に戻す?
6. assetsディレクトリ以下のパーミッション変更。
/var/www/(バーチャルホストのディレクトリ)/assets/
以下のパーミッションを755から777に変更。
$ chmod -R 777 assets
エラーの内容は以下:
User 'www-data' needs to be able to write to this file:
/var/www/(バーチャルホストのディレクトリ)/assetsThe file is currently owned by 'masaakia'. There is no user-group that contains both the web-server user and the owner of this file. Change the ownership of the file, create a new group, or temporarily make the file writeable by everyone during the install process.
7. .htaccessのパーミッション変更。
.htaccessは作ってなかったので、とりあえずviで空のファイルを、
バーチャルホストのディレクトリの直下に作成。
$ vi .htaccess
で:w(保存して)、:q(閉じる)。
パーミッションを644から666に変更。
$ chmod 666 .htaccess
エラーの内容は以下:
User 'www-data' needs to be able to write to this file:
/var/www/(バーチャルホストのディレクトリ)/.htaccessThe file is currently owned by 'masaakia'. There is no user-group that contains both the web-server user and the owner of this file. Change the ownership of the file, create a new group, or temporarily make the file writeable by everyone during the install process.
8. mod_rewriteの有効化。
エラーの内容は以下:
You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.
apacheの設定も含め、以下を参照:
Ubuntuでapacheのmod_rewriteを有効にする - カサヒラボ
バーチャルホストの設定部分のみ記述。
viで設定ファイルを開き、
$ vi /etc/apache2/site-available/(バーチャルホストの設定ファイル)
内の、
AllowOverride None
の部分を、
AllowOverride All
に変更。
apacheを再起動。
$ sudo /etc/init.d/apache2 restart
9. GD2のインストール。
こちらを参照:
ubuntu7.04-serverでgd2 | じゃれすのろぐ
エラーメッセージ:
GD support for PHP not included.
$ apt-cache search php5 gd
(以下が表示された。)
php5-dbg - Debug symbols for PHP5
php5-gd - GD module for php5
$ sudo apt-get install php5-gd
インストール開始。
インストールが完了したら、apacheを再起動。
$ sudo /etc/init.d/apache2 restart
インストールページをリロードしたら、エラーの表示が消えた。