レンタルサーバー
BIG-server.com
簡単・はやい・大容量・どんな目的にもマッチするレンタルサーバー
HOME プライス お見積もり・プラン選択 お申し込み ユーザーサポート お問い合わせ

■ osCommerce のインストール方法

ECサイト構築システム osCommerce のインストール方法をご紹介します。 >> osCommerce 設置サンプル

BIG-server.com でオンラインショップを簡単スタート!

osCommerce のインストール方法
osCommerce とは

osCommerce は、国際的なコミュニティで開発が進められているオープンソースのECサイト構築システムです。
最新版の osCommerce 日本語版は SourceForge.JP で入手する事が出来ます。

BIG-server.com で osCommerce を使うには

以下の手順に従い、osCommerce をダウンロードしてサーバーにインストールしてください。

osCommerce に最適なサーバープラン
Banana サーバー(専用サーバー) PHP 4.4.2 + MySQL4.0.21
osCommerce の構築に最適なサーバー環境です。
パッケージをインストールするだけですぐに osCommerce をご利用いただけます。

T-Banana サーバー(専用サーバー) PHP5.2.5 + MySQL5.0.45
プログラムを一部改造すれば、最新のサーバーでも osCommerce をご利用いただけます。(詳細は後述
マルチコアプロセッサ搭載の強力なサーバーで、より多くのお客様に商品を販売できます。

1、パッケージの入手
SourceForge.JPよりパッケージをダウンロードして、FTP で /home/[account]/ にアップロードしてください。
最新版 oscommerce-2.2ms1j-R8.tar.gz(2010年4月21日現在)

Telnet/SSH でログインして wget コマンドでサーバーに直接ダウンロードする事も可能です。
$ wget http://iij.dl.sourceforge.jp/tep-j/3606/oscommerce-2.2ms1j-R8.tar.gz

2、パッケージの解凍
Telnet/SSH でログインして /home/[account]/ で oscommerce-2.2ms1j-R8.tar.gz を解凍してください。
$ tar xpvfz oscommerce-2.2ms1j-R8.tar.gz

解凍に成功すると、ディレクトリ oscommerce-2.2ms1j/ が生成されます。
このディレクトリの中にあるファイルを public_html/ の下にコピーしてください。
$ cp -R oscommerce-2.2ms1j/* public_html/

3、パーミッションの確認・変更
osCommerce セットアップのため、以下の設定ファイルのパーミッションを 706 に変更してください。

public_html/catalog/includes/configure.php ……(属性:706)
public_html/admin/includes/configure.php ……(属性:706)

FTPソフトで変更もしくは Telnet/SSH から下記コマンドで変更してください。
$ chmod 706 public_html/catalog/includes/configure.php
$ chmod 706 public_html/admin/includes/configure.php

4、.htaccess の設定
public_html/catalog/.htaccess をダウンロードして、テキストエディタで以下の内容を追加してください。

# [PHP]
php_flag output_buffering Off
php_flag register_globals On

# [mbstring]
php_value mbstring.language Japanese
php_flag mbstring.encoding_translation On
php_value mbstring.http_input auto
php_value mbstring.http_output EUC-JP
php_value mbstring.internal_encoding EUC-JP
php_value mbstring.detect_order auto
php_flag mbstring.substitute_character none

編集した .htaccess を、public_html/catalog/ と public_html/admin/ にアップロードしてください。

Telnet/SSH からファイルを直接編集して、public_html/admin/にコピーする場合は、
$ vi public_html/catalog/.htaccess
----------
ファイルの編集・保存
----------


$ cp public_html/catalog/.htaccess public_html/admin/
としてください。

5、インストール

5−1、インストールスクリプトの起動
ブラウザで http://ドメイン/catalog/install にアクセスしてだくさい。
設置サンプルでは http://oscommerce.syo-ten.com/catalog/install となります。

5−2、新規インストール
[New Install] をクリックするとインストールに必要な情報の入力画面になります。
3. データベース・サーバに関する情報を入力してください: の項目を以下の通り設定してください。

項目設定
データベース・サーバlocalhost
ユーザ名メールでお知らせしたMySQL ユーザー (pj****g** など)
パスワードメールでお知らせしたMySQL パスワード
データベースメールでお知らせしたデータベース名 (DBユーザと同一)

5−3、データベース・インポート
データベースの接続テストに成功すると、データベースのインポートを行います。
次のインストールプロセスに進んでください。

データベースのインポートに成功すると処理結果が表示されます。

5−4、osCommerce の設定
オンラインショップのURLなど、osCommerce の基本項目を設定します。
テキストボックスに表示されている内容のまま設定してください。

その他の設定項目

  • 「SSL による接続を利用する」
    SSLを使用する場合はチェックを入れてください。
  • 「持続的な接続を使用する」
    サーバーの負荷が高くなりますので非チェックを推奨します。
  • 「PHPセッションの保存先」
    持続的な接続を使用する場合、セッション情報の保存先を指定してください。
    セッション情報をファイルに保存する
    セッション情報をデータベースに保存する(推奨)
    ※セッション情報をファイルに保存する場合はスクリプトの修正が必要です。(詳細は後述

5−5、インストール完了
以上で osCommerce のインストール完了です。

この段階でひとまず osCommerce の操作が可能になります。
[Administration Tool] をクリックして、ユーザ:admin / パスワード:admin で管理画面にログインしてください。

※管理画面に初めてログインしたら
管理画面に初めてログインしたら必ずシステム管理者のパスワード変更を行ってください。
「基本設定」→「ユーザー」→「ユーザー管理」からシステム管理者のパスワードを変更できます。

6、インストール後の調整
そのままの状態ではオンラインショップに警告メッセージが表示されたり、
商品画像のアップロードでエラーが発生する場合がありますので、インストール完了後の調整を行います。

設定ファイルのパーミッション変更:
インストール前に変更した設定ファイル(configure.php)のパーミッションを 644 に変更してください。
$ chmod 644 public_html/catalog/includes/configure.php
$ chmod 644 public_html/admin/includes/configure.php

catalog/ の画像ディレクトリのパーミッション変更:
商品画像をアップロードするディレクトリのパーミッションを 777 変更してしてください。
$ chmod 777 public_html/catalog/images
$ chmod 777 public_html/catalog/images/banners

admin/ の画像ディレクトリ/ファイルのパーミッション変更:
admin/ の画像ディレクトリ/ファイルのパーミッションを下記に変更してしてください。
public_html/admin/images/ ……(属性:777)
public_html/admin/images/graphs/ ……(属性:777)
public_html/admin/images/graphs/ディレクトリの中のファイルすべて ……(属性:666)

$ chmod 777 public_html/admin/images
$ chmod 777 public_html/admin/images/graphs
$ chmod 666 public_html/admin/images/graphs/*

データベースバックアップ用ディレクトリの作成:
public_html/admin/backups をパーミッション 777 で作成してください。
$ mkdir public_html/admin/backups
$ chmod 777 public_html/admin/backups

インストールスクリプトの削除:
インストール完了後はもう使用しませんので、インストールスクリプトを削除してください。
$ rm -r public_html/catalog/install

以上で osCommerce のインストールは全て完了です。
管理画面にログインして、商品の設置やショップのカスタマイズなどオンラインショップの運営をお楽しみください。




T-Bananaサーバーに osCommerce をインストールする
T-Bananaサーバーに osCommerce をインストールする場合は下記ファイルを編集してください。
MySQL 5系のサーバーで osCommerce を動かす場合に発生するエラーの修正方法です。

public_html/catalog/default.php
※このページでは改行があるように見えますが、全て $listing_sql から始まる1行の項目です。

176行目
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

179行目
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

187行目
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

190行目
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES ." p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES ." p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

public_html/catalog/advanced_search_result.php
※このページでは改行があるように見えますが、$from_str から始まる1行の項目です。

183行目
$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";


セッション情報をファイルに保存する
持続的な接続を使用する場合のセッション情報保存先で「ファイルに保存」を選択した場合の追加設定。

FTPもしくはTelnet/SSHで /home/[account] にセッション情報を保存するディレクトリを作成してください。
$ mkdir tmp
$ chmod 777 tmp

public_html/catalog/.htaccess をダウンロードして、テキストエディタで以下の内容を追加してください。

php_value session.save_path /home/[account]/tmp

編集した .htaccess を、public_html/catalog/ と public_html/admin/ にアップロードしてください。

Telnet/SSH からファイルを直接編集して、public_html/admin/にコピーする場合は、
$ vi public_html/catalog/.htaccess
----------
php_value session.save_path /home/[account]/tmp を追加
----------


$ cp public_html/catalog/.htaccess public_html/admin/
としてください。

今回ご紹介いたしました osCommerce のインストール方法はあくまで一例となります。

osCommerce のインストールを BIG-server.com がサポートします。
ご不明な点がございましたら、メールにてお気軽にお問い合わせください。

BIG-server.com

Core 2 Duo + SATA 250GB RAID 1 T-Bananaサーバー 完全帯域保証+無制限 わずらわしい設定は一切不要


いま一番お得なページ! 解析
Copyright (C) 1997-2012, BIG-server.com. All Rights Reserved.
レンタルサーバー BIG-server.com
Powered By Maido3.com