それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

(完全版)OpenPNE3インストール。

OpenPNE3のインストールは、初心者にはまだまだ難しい。
また公式ドキュメントが不備が多い。本来はシンプルです。公式マニュアルには働きかけないと

作業環境の準備

takuya@tenchi:~/temp/OpenPNE3$ mkdir temp
takuya@tenchi:~/temp/OpenPNE3$ cd temp

ソースコード取得と展開

takuya@tenchi:~/temp/OpenPNE3$ git clone git://github.com/openpne/OpenPNE3.git
takuya@tenchi:~/temp/OpenPNE3$ cd OpenPNE3
takuya@tenchi:~/temp/OpenPNE3$ ln -s lib/vendor/symfony/data/web/sf web/sf

最初の設定とデータベース

takuya@tenchi:~/temp/OpenPNE3$ cp config/ProjectConfiguration.class.php.sample \
config/ProjectConfiguration.class.php
takuya@tenchi:~/temp/OpenPNE3$ echo "create database takuya_test2;" \
| mysql -p -u root #データベース作成
Enter password:

OpenPNEのインストールコマンドを実行

takuya@tenchi:~/temp/OpenPNE3$ ./symfony openpne:install

  Choose DBMS:
  - mysql
  - pgsql (unsupported)
  - sqlite (unsupported)

mysql

  Type database username

root

  Type database password (optional)

MY_PASSWD

  Type database hostname

localhost

  Type database port number (optional)



  Type database name

takuya_test2

  Type database socket path (optional)
takuya_test2

  Type database socket path (optional)

  The DBMS                 : mysql
  The Database Username    : root
  The Database Password    : ******
  The Database Hostname    : localhost
  The Database Port Number :
  The Database Name        : takuya_test2
  The Database Socket      :

  Is it OK to start this task? (Y/n)
y
....(ry)
>> sfPearFrontendPlugin bytes)
>> sfPearFrontendPlugin ...done: 478,984 bytes
>> opPluginManager Installation successful for plugin "opOpenSocialPlugin"
>> opPluginManager Installing web data for plugin
>> opPluginManager Installing web data for plugin
....(ry)

動作確認

index.phpをシェルから起動し、HTMLが出力されることを確認。この確認でパス設定に問題ないことを確認する。

takuya@tenchi:~/temp/OpenPNE3$ php web/index.php
...(ry)
</div><!-- ContentsContainer -->
</div><!-- Contents -->

<div id="Footer">
<div id="FooterContainer">
<p>
<a target="_blank" href="web/symfony/privacyPolicy">プライバシーポリシー</a>
<a target="_blank" href="web/symfony/userAgreement">利用規約</a>
Powered by <a href="http://www.openpne.jp/" target="_blank">OpenPNE</a></p>
</div><!-- FooterContainer -->
</div><!-- Footer -->

</div><!-- Container -->
</div><!-- Body -->
</body>
</html>
組み込みの動作チェックを行なう

Symfony組み込みの動作チェックを走らせる。致命的なエラーがないことを確認。
幾つかエラーがあるようだ。使ってみて発生したエラーが、テストエラー箇所なら、
私の責任でないと切り分けが出来る。

takuya@tenchi:~/temp/OpenPNE3$ php test/unit/config/sfOpenPNEViewConfigHandlerTest.php
# addCustomizes() basic customize addition
ok 1 - addCustomizes() basic customize addition
1..1
# Looks like everything went fine.
時間に余裕があるときはテストを全部とおしてみる。
takuya@tenchi:~/temp/OpenPNE3$ symfony test:unit
acl/opMemberAclBuilderTest...........................................ok
behavior/opActivityCascadingBehaviorTest.............................ok
behavior/opApplicationLevelCascadingListenerTest.....................ok
config/sfOpenPNEViewConfigHandlerTest................................ok
form/MemberConfigFormTest............................................ok
helper/opUtilHelperTest..............................................ok
model/doctrine/ActivityDataTableTest.................................dubious
    Test returned status 255
    Failed tests: 0
model/doctrine/ActivityDataTest......................................ok
model/doctrine/AdminUserTableTest....................................ok
model/doctrine/AdminUserTest.........................................ok
model/doctrine/BannerImageTest.......................................ok
model/doctrine/BannerTableTest.......................................ok
model/doctrine/BannerTest............................................ok
model/doctrine/BannerUseImageTableTest...............................ok
model/doctrine/BlacklistTableTest....................................ok
model/doctrine/CommunityCategoryTableTest............................ok
model/doctrine/CommunityCategoryTest.................................ok
model/doctrine/CommunityConfigTableTest..............................ok
model/doctrine/CommunityMemberPositionTableTest......................ok
model/doctrine/CommunityMemberTableTest..............................ok
model/doctrine/CommunityMemberTest...................................ok
model/doctrine/CommunityTableTest....................................dubious
    Test returned status 255
    Failed tests: 0
model/doctrine/CommunityTest.........................................ok
model/doctrine/FileTableTest.........................................ok
model/doctrine/FileTest..............................................ok
model/doctrine/GadgetConfigTableTest.................................ok
model/doctrine/GadgetTableTest.......................................not ok
    Failed tests: 9, 10
model/doctrine/GadgetTest............................................dubious
    Test returned status 255
    Failed tests: 0
model/doctrine/MemberConfigTableTest.................................ok
model/doctrine/MemberConfigTest......................................ok
model/doctrine/MemberImageTest.......................................ok
model/doctrine/MemberProfileTableTest................................dubious
    Test returned status 255
    Failed tests: 0
model/doctrine/MemberRelationshipTableTest...........................ok
model/doctrine/MemberRelationshipTest................................ok
model/doctrine/MemberTableTest.......................................ok
model/doctrine/MemberTest............................................ok
model/doctrine/NavigationTableTest...................................ok
model/doctrine/NotificationMailTableTest.............................ok
model/doctrine/NotificationMailTest..................................ok
model/doctrine/OAuthAbstractTokenTableTest...........................ok
model/doctrine/OAuthConsumerInformationTableTest.....................ok
model/doctrine/OAuthConsumerInformationTest..........................ok
model/doctrine/OAuthMemberTokenTableTest.............................ok
model/doctrine/OpenIDTrustLogTableTest...............................ok
model/doctrine/ProfileOptionTableTest................................not ok
    Failed tests: 3
model/doctrine/ProfileOptionTest.....................................ok
model/doctrine/ProfileTableTest......................................ok
model/doctrine/ProfileTest...........................................ok
model/doctrine/SkinConfigTableTest...................................ok
model/doctrine/SnsConfigTableTest....................................ok
model/doctrine/SnsConfigTest.........................................ok
model/doctrine/SnsTermTableTest......................................ok
model/doctrine/SnsTermTest...........................................ok
util/opRssFetcherTest................................................ok
validator/opValidatorDateTest........................................ok
Failed Test                     Stat  Total   Fail  List of Failed
------------------------------------------------------------------
doctrine/ActivityDataTableTest   255      1      1  0
el/doctrine/CommunityTableTest   255      1      1  0
model/doctrine/GadgetTableTest     0     11      2  9 10
model/doctrine/GadgetTest        255      1      1  0
octrine/MemberProfileTableTest   255      1      1  0
del/doctrine/MemberProfileTest   255      1      1  0
octrine/ProfileOptionTableTest     0      5      1  3
Failed 7/56 test scripts, 87.50% okay. 8/574 subtests failed, 98.61% okay.

公開サーバ設定

公開先URL http://0.0.0.0/~takuya/openpne/ で公開する。

ln -s /home/takuya/temp/OpenPNE3/web/ /home/takuya/public_html/openpne
vim .htacess
  1 Options +FollowSymLinks +ExecCGI
  2
  3 <IfModule mod_rewrite.c>
  4   RewriteEngine On
  5
  6   # uncomment the following line, if you are having trouble
  7   # getting no_script_name to work
  8   RewriteBase /~takuya/openpne/  # RewriteBase / をURLに従って書き換え
  9
 10   # we skip all files with .something
 11   #RewriteCond %{REQUEST_URI} \..+$
 12   #RewriteCond %{REQUEST_URI} !\.html$
 13   #RewriteRule .* - [L]
 14
 15   # we check if the .html version is here (caching)
 16   RewriteRule ^$ index.html [QSA]
 17   RewriteRule ^([^.]+)$ $1.html [QSA]
 18   RewriteCond %{REQUEST_FILENAME} !-f
 19
 20   # no, so we redirect to our front web controller
 21   RewriteRule ^(.*)$ index.php [QSA,L]
 22 </IfModule>
~

アクセスして確認

ブラウザを開いて http://0.0.0.0/~takuya/openpne/ にアクセス


ログインは

username sns@example.com
password password

管理画面にアクセスする。

username admin
password password

これでインストールして使えるようになる。


手順さえ分かってしまえば、数分で終る。