![]() |
LINUX |
Xoops Cube のインストール
・xoopsでホームサイトを立ち上げます
・Package_Legacy_2_2_0をインストールします
・基本言語は"ja_utf8"で設定します
・既にWEBサーバ (PHPを含む) が起動していること
・インストールはメンテナンスマシンで行っています
・本サイトはPackage_Legacy_2.1.8aからのアップデートです
・ファイルの取得、削除は省略します
・エディタ、ファイラーの操作は省略します
・ソースを展開したら説明文を読みましょう
・Enterキーを省略します
・ログイン端末で "#" はroot、"$" は一般ユーザのプロンプトの記号です
・設定ファイルで "#" で始まる行はコメントとして解釈されます
関連サイト| :Package_Legacy_2_2_0.zip | (http://xoopscube.jp/) |
| :jquery | (http://jquery.com/) |
| :jquery-ui | (http://jqueryui.com/) |
参照ファイル:最初の設定 (Xen)
:MySQLのインストール
:httpd/phpのインストール
インストール環境| :OS | CentOS 5.6 |
| :サーバデーモン | httpd-2.2.19 |
| php-5.3.6 | |
| mysql-5.1.57 | |
| :selinux | disabled or permissive |
| :インストール先 | /home/www/htdocs/ |
| :作業 | /usr/src |
| :ユーザー | rootで実行 |
・メンテナンスは一般ユーザから行います
xoops用設定例| :データベースユーザ名 | uranus |
| :データベース名 | xoopsdata |
| :xoopsへのパス | /home/www/htdocs |
| :xoopsへのURL | http://ja.528p.com |
| :xoops管理者名 | neptune |
| :管理者メールアドレス | moonlight@528p.com |
xoops試験用設定例 (ローカルで使用する場合)| :データベースユーザ名 | uranus |
| :データベース名 | xoopsdata |
| :xoopsへのパス | /home/www/htdocs |
| :xoopsへのURL | http://mars.528p.com |
| :xoops管理者名 | neptune |
| :管理者メールアドレス | moonlight@528p.com |
Package_Legacy_2_2_0
ファイルの展開・コピー・適宜、自分の構成するディレクトリ名に合わせてください
・ja_utf8,japaneseの言語ファイルをextrasからコピーします
・systemモデュールをextrasからコピーします
・systemモデュールは、xoops2.0.xモデュールへの対応です
・trustディレクトリはドキュメントルートの外に置きます
# cd /usr/src [root@jupiter:/usr/src] # unzip Package_Legacy_2_2_0.zip # cd r2_2_00 [root@jupiter:/usr/src/r2_2_00] # ls docs extras html xoops_trust_path # cp -a extras/extra_languages/ja_utf8/{install,language,modules} html # cp -a extras/extra_languages/japanese/{install,language,modules} html
・必要ならば後から入れても良い
# cp -a extras/extra_modules/html/modules/system html/modules
・/home/www/htdocsディレクトリへコピーします
# cp -a html/* /home/www/htdocs # cp -a xoops_trust_path /home/www/xoops_trust
オーナー・グループ・パーミッションを変更します・httpd (apache) の設定コンセプトに合わせます
# cd /home/www
[root@jupiter:/home/www]
# chown -R apache:apache htdocs
# find htdocs -type f -print0 | xargs -0 chmod g-w,o-rwx
# find htdocs -type d -print0 | xargs -0 chmod g-rw,o-rw
# chown -R apache:apache xoops_trust
# find xoops_trust -type f -print0 | xargs -0 chmod g-w,o-rwx
# find xoops_trust -type d -print0 | xargs -0 chmod g-rw,o-rw
xoopsの設定
MySQLにxoops用データベースを作ります:設定例 ( データベース名cubedata,ユーザーuranus,パスワードyyyyyyyyyy )
・mysqlの管理者 (root) でログインします
[root@jupiter:~] # mysql -u root -p password:← パスワード(mysql管理者)の入力
・データベースの作成
mysql> create database cubedata;
・データベースに全権を持つユーザーの作成
mysql> grant all on cubedata.* to uranus@localhost identified by 'yyyyyyyyyy';
mysql> flush privileges;
・ログアウト
mysql> exit;
2ndマシンからxoopsにアクセスします・インストールドキュメントが用意されているので、参照します
・modsecurityが有効な場合、installできないので一時的に止めておきます
:URL ( http://ja.528p.com/install/index.php )
| インストール第1ステップ | |
| :インストール画面 | |
| :ja_utf8を選択 | →次へ |
| :XOOPS Cubeのインストールウィザード | →次へ |
| :ファイルのアクセス権のチェック | →次へ |
| :データベース及びパス・URLの設定 | |
| データベースサーバ | :mysql |
| データベースサーバのホスト名 | :localhost |
| データベースユーザ名 | :uranus |
| データベースパスワード | :yyyyyyyyyy |
| データベース名 | :cubedata |
| テーブル接頭語 | :そのまま使用 |
| SALT | :そのまま使用 |
| データベースの持続的接続 | :いいえ |
| XOOPS Cubeへのパス | :/home/www/htdocs |
| XOOPS_TRUST_PATH へのパス | :/home/www/xoops_trust |
| XOOPS CubeへのURL | :http://ja.528p.com |
| →次へ | |
| :設定内容の確認 | →次へ |
| :設定の保存 | →次へ |
| :XOOPS_TRUST_PATH のファイルのアクセス権のチェック | →次へ |
| :パス・URLのチェック | →次へ |
| :データベース設定の確認 | →次へ |
| :データベースをチェック | →次へ |
| :データベーステーブルが作成されました | →次 |
| :サイト管理者についての設定 | |
| 管理者ユーザ名 | :neptune |
| 管理者メールアドレス | :moonlight@528p.com |
| 管理者パスワード | :************ |
| 再入力 | :************ |
| タイムゾーン (Asia/Tokyoと時差のない) | Asia/Seoul |
| →次へ | |
| :データの生成 | →次へ |
| :インストール完了 | →次へ |
| インストール第2ステップ | |
| 管理者ユーザ名 | neptune |
| 管理者パスワード | ************ |
| ログイン | |
| Module | Status | |
| ∨ | legacy | 必須(未導入) |
| ∨ | legacyRender | 必須(未導入) |
| ∨ | user | 必須(未導入) |
| ∨ | profile | 必須(未導入) |
| ∨ | stdCache | 必須(未導入) |
| ∨ | message | 導入推奨 |
| system | 選択導入可能 | |
| インストール | ||
ファイルのアクセス権を変更します・installディレクトリの名前変更 (または別の場所に移す)
# cd /home/www/htdocs
[root@jupiter:/home/www/htdocs]
# mv install install-*******
・mainfile.phpのパーミッションの変更
# cd /home/www/htdocs
[root@jupiter:/home/www/htdocs]
# chmod 440 mainfile.php
httpd (apache) のアクセス制御・xoops用の設定ファイルを作成し、httpd.confで読み込みます
・.htaccessでの制御は非力なマイサーバでは、負担になります
:/etc/httpd/conf/httpd.conf
・省略
<Directory "/home/www/htdocs">
Options SymLinksifOwnerMatch IncludesNoExec
AllowOverride None
Order allow,deny
Allow from all
<Files mainfile.php>
deny from all
</Files>
</Directory>
・省略
Include /etc/httpd/conf/extra/httpd-xoops.conf
:/etc/httpd/conf/extra/httpd-xoops.conf
・他のディレクトリに影響しないように、正規表現の書き方に注意します
・xoopsディレクトリ下にxoops_trustが必要な場合 紫色部分を追加します
<DirectoryMatch "/htdocs/(include|uploads)">
AddType text/plain .php4 .php3 .phtml .cgi .pl
<Files ~ ".php$">
order deny,allow
deny from all
</Files>
</DirectoryMatch>
<DirectoryMatch "/xoops_trust">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/htdocs/(class|kernel|language)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/myalbum/(include|language|sql|templates)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/myalbum0/(include|language|sql|templates)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/altsys/(include|blocks)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/sitemap/(include|language|plugins|blocks|templates)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/contact/(language|templates)">
order deny,allow
deny from all
</DirectoryMatch>
<DirectoryMatch "/modules/mylinks/(language|sql|templates|include)">
order deny,allow
deny from all
</DirectoryMatch>
アップグレード・XOOPS Cube Wiki の [XCL2.1.* から XCL2.2 へのアップグレード] を参照して下さい
・http://sourceforge.net/apps/mediawiki/xoopscube/index.php?title=Upgrade22;ja
サイトを閉じます・管理メニュー > 互換モデュール > 全般設定 > サイトを閉鎖する
・[はい]をチェックし、[送信]をクリックします
サイトのバックアップ・現サイトのすべてのファイルをバックアップします
・現サイトのデータベースをバックアップします
ファイルの展開・コピー (2_1_8a to 2_2_0)・"2_2_0"で"2_1_8a"のファイルを上書きします
・適宜、自分の構成するディレクトリ名に合わせてください
・ja_utf8,japaneseの言語ファイルをextrasからコピーします
・systemモデュールをextrasからコピーします
・install,mainfile.php,favicon.icoを削除します
・自分でhackしているファイルがあれば修正します
# cd /usr/src [root@jupiter:/usr/src] # unzip Package_Legacy_2_2_0.zip # cd r2_2_00 [root@jupiter:/usr/src/r2_2_00] # ls docs extras html xoops_trust_path # cp -a extras/extra_languages/ja_utf8/{install,language,modules} html # cp -a extras/extra_languages/japanese/{install,language,modules} html # cp -a extras/extra_modules/html/modules/system html/modules # rm -rf html/install # rm -f html/mainfile.php # rm -f html/favicon.ico
・yesコマンドをパイプして"y"の入力を省略します
# yes | cp -a html/* /home/www/htdocs # yes | cp -a xoops_trust_path/* /home/www/xoops_trust
SetupAltsysLangMgr.class.phpの修正:htdocs/preload/SetupAltsysLangMgr.class.php
・Altsysモデュールを使っている場合
・ファイルはWindowsのCR+LFの改行コードになっています
・下記はdiffコマンドで修正部分を出力したものです
・+部分 をエディタで追記します(ー+は書き込まない)
--- SetupAltsysLangMgr.class.php 2011-04-29 07:35:40.000000000 +0900 +++ SetupAltsysLangMgr.class.php.new 2011-04-29 07:39:12.000000000 +0900 @@ -85,6 +85,7 @@ class AltsysLangMgr_LanguageManager exte $this->_loadFile(XOOPS_ROOT_PATH . "/modules/legacy/language/english/global.php"); } */ $this->_loadLanguage( 'legacy' , 'global' ) ; + $this->_loadLanguage( 'legacy' , 'setting' ) ; // // Now, if XOOPS_USE_MULTIBYTES isn't defined, set zero to it.
xoops_trust_pathの設定・XCL2.2より, xoops_trust_pathが追加になります
・htdocs,xoops_trustは自分の環境に合わせます
・htdocs/settings/site_custom.ini.phpが存在する場合、
・xoops_trust/settings/site_custom.iniに移動します
・class/smarty/pluginsに追加されたプラグインを、
・xoops_trust/libs/smarty/pluginsにコピーします
・定数XOOPS_TRUST_PATHをmainfile.phpに追加します
# cd /home/www/htdocs/class/smarty/plugins
[root@jupiter:/home/www/htdocs/class/smarty/plugins]
# cp -a *.php /home/www/xoops_trust/libs/smarty/plugins
・同名のファイルがある場合、上書きしない(nでコピーを否定)
:htdocs/mainfile.php
・省略
define('XOOPS_TRUST_PATH', '/home/www/xoops_trust');
・省略
ディレクトリ削除# cd /home/www/htdocs [root@jupiter:/home/www/htdocs] # rm -r cache # rm class/smarty/*.* ← index.htmlは残します (nで消去を否定) # rm -r class/smarty/core # rm class/smarty/plugins/*.* ← index.htmlは残します (nで消去を否定) # rm -r settings # rm -r templates_c
アップグレード・upgrade22.class.phpをextras/extra_preloadから
・htdocs/preloadにアップロードします
・ファイルのオーナー・グループ・パーミッションを変更します
・httpd (apache) の設定コンセプトに合わせます
# cd /usr/src/r2_2_00/extras/extra_preload
[root@jupiter:/usr/src/r2_2_00/extras/extra_preload]
# cp upgrade22.class.php /home/www/htdocs/preload
# cd /home/www [root@jupiter:/home/www] # chown -R apache:apache htdocs # find htdocs -type f -print0 | xargs -0 chmod g-w,o-rwx # find htdocs -type d -print0 | xargs -0 chmod g-rw,o-rw # chown -R apache:apache xoops_trust # find xoops_trust -type f -print0 | xargs -0 chmod g-w,o-rwx # find xoops_trust -type d -print0 | xargs -0 chmod g-rw,o-rw
・サイトにアクセスします、管理者でログインします
・profileモジュールのインストール画面が表示されますので、インストールします
・htdocs/preload/upgrade22.class.phpを削除します
・管理メニュー > 互換モデュール > モジュールの管理で
・アップデートの必要なモジュールを全てアップデートします
サイトの再開・管理メニュー > 互換モデュール > 全般設定 > サイトを閉鎖する
・[いいえ]をチェックし、[送信]をクリックします
参考
mainfile.phpでmysql情報を外部から読み込む・xoopsディレクトリの外に設定ファイルを置き、mainfile.phpの先頭で読み込みます
・サイトの表示に失敗したら、mainfile.phpを直接修正して、元にもどします
・気休め程度と理解しましょう、ファイルのパーミッションに注意!
:xoops_trust/settings/xoops-auth.php (apache apache 640)
<?php $db_user = "uranus"; //データベースユーザ名 $db_pass = "yyyyyyyyyy"; //データベースパスワード $db_name = "cubedata"; //データベース名 ?>
:htdocs/mainfile.php (apache apache 440)
・省略
include ("/home/www/xoops_trust/settings/xoops-auth.php");
if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
define("XOOPS_MAINFILE_INCLUDED",1);
・省略
// Database Username
// Your database user account on the host
define('XOOPS_DB_USER', $db_user);
// Database Password
// Password for your database user account
define('XOOPS_DB_PASS', $db_pass);
// Database Name
// The name of database on the host. ...
define('XOOPS_DB_NAME', $db_name);
・省略
ローカル環境でのjquery・デフォルトでは、googleサイトからjqueryライブラリを読み込みます
・ローカル環境用にライブラリをダウンロードして設定します
・jqueryのサイトからjquery*.jsをdownloadします
・jquery*.jsをxoopsディレクトリにコピーします
・jquery-uiのサイトからtheme smoothnessを選択し、downloadします
・jquery-ui*.js jquery-ui*.cssをxoopsディレクトリにコピーします
・(例 xoopsディレクトリ/common/js)
・管理メニュー > 互換レンダーシステム > 一般設定 で
・ファイルの設置場所を指定し、[送信]をクリックします
jQuery UI CSS ファイルの URL
http://mars.528p.com/common/js/jquery-ui-1.8.13.custom.css
jQuery コアライブラリ
http://mars.528p.com/common/js/jquery-1.6.1.min.js
jQuery UI ライブラリ
http://mars.528p.com/common/js/jquery-ui-1.8.13.custom.min.js
・サイトのトップページのソース"
・デフォルト
<!-- RMV: added module header -->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript"><!--
google.load("language", "1");
google.load("jquery", "1");
google.load("jqueryui", "1");
//-->
</script>
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/smoothness/jquery-ui.css" />
・変更後
<!-- RMV: added module header --> <script type="text/javascript" src="http://mars.528p.com/common/js/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="http://mars.528p.com/common/js/jquery-ui-1.8.13.custom.min.js"></script> <link type="text/css" rel="stylesheet" href="http://mars.528p.com/common/js/jquery-ui-1.8.13.custom.css" />
XCL2.1.x以前のテーマを使う場合・XCL2.1.xでは[メイン・ユーザメニュー]のhtml構文が<td>の構成でしたが
・XCL2.2.xでは[メイン・ユーザメニュー]のhtml構文が<li>の構成になっています
・defaultテーマからiconをコピーして、theme.html,style.cssを書き換えましょう
改行コードを LF に変換(必須ではない)・特定のファイルの改行コードを CR+LF から LF に変換します
# cd /home/www/htdocs
[root@jupiter:/home/www/htdocs]
# find -name '*.html' -o -name '*.php' -o -name '*.css' -o -name '*.tpl' \
-o -name '*.sql' -o -name '*.js' | xargs dos2unix
# find -name '*.html' -print0 | xargs -0 dos2unix
・オーナー・グループの変更
# chown -R apache:apache /home/www/htdocs
php-5.3のDEPRECATED警告(古いコード使用)への対処・php.iniのerror_reporting = E_ALL & ~E_DEPRECATED に変更します
・または、phpコードを置換(& new → new)します(必須ではない)
・失敗すれば動かなくなるので、実行する前に必ずバックアップを取ります
・txtファイルに出力して& newの部分を確認
・xcl 2.2 ではextrasの一部を除いて、& new は使われていません
[root@jupiter:/home/www/htdocs]
# find -name '*.php' | xargs grep '& new' > php-new.txt
・bakファイルを作成して、phpコードの変換
# find -name '*.php' | xargs grep -l '& new' | xargs sed -i.bak 's/& new/ new/g'
・オーナー・グループの変更
# chown -R apache:apache /home/www/htdocs
![]() |
Copyright(c) 528p.com All Rights Reserved. |

