カスタム検索
tomo.gif (1144 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)To previous pageTo home pageMailing to me

osCommerceの小技

Modified: 30 October 2005, Since: 23 December 2004


カスタマイズの技

配送モジュールでヤマト運輸を有効にする方法1 January 2005
注文メールの署名を変更する方法1 January 2005
トップページの "What's new" を変更する方法 (30 October 2005
ショップのロゴ(バナー)を変更する方法
1 January 2005
右フレームの言語と通貨のブロックを非表示にする方法
1 January 2005
ページ全体の背景色を変更する方法1 January 2005

不具合の解決

文字化けするのを直す方法 (22 December 2004

セキュリティ強化

ディレクトリ一覧の表示を止める方法 (22 December 2004
インデックスファイルを設定する方法 (
22 December 2004

管理画面をSSL対応にする方法 (22 December 2004
特定のIPアドレスしか管理画面が開かないようにする方法 (22 December 2004

管理ユーザ(admin)を変更する方法 (1 January 2005
セッションハイジャックを防止する方法 (1 January 2005

MySQLのrootパスワードの設定23 December 2004

基本的な技

漢字を入力する方法 (1 January 2004)


 配送モジュールでヤマト運輸を有効にする方法 

「管理メニュー」、「モジュール設定」の「配送モジュール」で、「ヤマト運輸」を有効にするには、以下のように、ステータスのところをクリックすれば有効になります。


 注文メールの署名を変更する方法 

"./catalog/includes/language/japanese.php" の"EMAIL_SIGNATURE"を変更すればOKです。


 トップページの "What's new" を変更する方法 

「管理メニュー」を開き、「各種ツール」、「ファイル管理」を開きます。エクスプローラのようにフォルダが見えますので、そこをクリックしていきます。

「catalog」、「include」、「language」、「japanese」と進み、「default.php」をクリックすると、以下のような編集画面が出てきます。

直接編集してもかまいません。

"./catalog/includes/language/japanese/default.php"の"TEXT_MAIN"を変更します。 
HTMLのタグを使ってリンクをはったり改行などの書式の調整ができます。


 ショップのロゴ(バナー)を変更する方法 

"./catalog/includes/header.php"の以下のところを変更します。

   :
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT)
. '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'oscommerce') . '</a>'; ?></td>
   :

上記が元のデータで、以下が変更後です。

   :
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT)
. '">' . tep_image(DIR_WS_IMAGES . 'tomo.gif', 'Tomos Homepage') . '</a>'; ?></td>
   :

 右フレームの言語と通貨のブロックを非表示にする方法 

"./catalog/includes/column_right.php"の以下のところを変更します。

   :
if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
 include(DIR_WS_BOXES . 'languages.php');
 include(DIR_WS_BOXES . 'currencies.php');
   :

上記が言語ブロックと通貨ブロックですので、以下のようにコメントアウトします。

   :
// if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
// include(DIR_WS_BOXES . 'languages.php');
// include(DIR_WS_BOXES . 'currencies.php');
   :

 ページ全体の背景色を変更する方法 

"./catalog/stylesheet.css"の以下のところを変更します。

ページ全体

/* ---------------------------
BODY:ボディ
--------------------------- */
BODY {
  background: #FCF9E4;                             /* 背景色 */
  color: #000000;                                  /* フォントカラー */
  margin: 0px;                                     /* マージン */
}

ヘッダー部

/* ---------------------------
TR:ヘッダー(ショップ名)
--------------------------- */
TR.header {
  background: #FCF9E4;                             /* 背景色 */
}

 文字化けするのを直す方法 

"/etc/php.ini" を以下のように修正します。

    :

[mbstring]
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.detect_order = auto
mbstring.encoding_translation = On
mbstring.substitute_character = none;

    :

修正後、Apacheを再起動します。

# service httpd restart

 ディレクトリ一覧の表示を止める方法  

"/etc/httpd/conf/httpd.conf" の以下を、

<Directory "/var/www/html">

   Options Indexes FollowSymLinks

以下のように、"Indexes" を削除します。

<Directory "/var/www/html">

  Options FollowSymLink

 インデックスファイルを設定する方法 

"/etc/httpd/conf/httpd.conf" の以下を、

DirectoryIndex index.html index.html.var

以下のように、"index.php"と、"default.php" を追加します。

DirectoryIndex index.html index.php default.php index.html.var

 管理画面をSSL対応にする方法 

"DocumentRoot" の"./admin/includes/configure.php" 内の以下を変更します。

  :

define('HTTP_SERVER', 'https://192.168.0.7'); // eg, http://localhost or - https://localhost should not be empty for productive servers
define('HTTP_CATALOG_SERVER', 'https://192.168.0.7');
define('HTTPS_CATALOG_SERVER', 'https://192.168.0.7');
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module

  :

上記により、"http" の他、"https" でもアクセスできるようになります。

"https" で開くと管理作業を盗聴されませんので安心です。

 SSL以外では接続できないようにするには、「httpsでしか接続できないようにする方法」を参考に、Apacheを設定してください。".htaccess"は、"DocumentRoot" の"./admin"に作成します。


 特定のIPアドレスしか管理画面が開かないようにする方法 

"/etc/httpd/conf/httpd.conf"に、以下を追加します。

<Directory "/var/www/html/admin">
    Options FollowSymLinks
    AllowOverride AuthConfig
    Order allow,deny
    Allow from 192.168.0.6

</Directory>

"192.168.0.6" からしかアクセスできなくなります。


 管理ユーザを変更する 

インストール直後は、ユーザ名"admin"、パスワード"admin"になっていますので、変更します。

管理ユーザの変更は、管理画面にログイン後、「各種ツール」を開き、左フレームのメニューから「ユーザ」、「ユーザ管理」を選択し、「ユーザの追加」をクリックします。

ユーザ登録後、管理権限を与えます。

ここで、登録済みのユーザを削除するのですが、ログインしているユーザの削除はできませんので、一旦ブラウザを落とし、新しい管理ユーザでログインしなおします。

新しい管理ユーザでログイン後、「各種ツール」を開き、左フレームのメニューから「ユーザ」、「ユーザ管理」を選択し、古い管理ユーザである「システム管理者」を選択し、「ユーザ情報」をクリックし、「削除」ボタンで削除します。


 セッションハイジャックを防止する方法 

以下のようにアクセス元のドメインを限定しておくと防止できます。

    :

[Session]

session.referer_check = "tomo.no-ip.com"

    :


 MySQLのrootパスワードの設定 

MySQLのrootユーザには、デフォルトではパスワードが設定されていません。以下の手順で、情報の流出防止のため設定しておきましょう。

# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> set password for root=password ('password');
Query OK, 0 rows affected (0.01 sec)

mysql> \q
Bye
#

 漢字を入力する方法 

以下の2つのサービスを起動します。

# service canna start
# service FreeWnn start

"vi"を起動し、"半角/全角"キーで切り替えて入力することができます。


To previous pageTo home pageMailing to meJump to Top of pageline.gif (927 ツバツイツト)line.gif (927 ツバツイツト)tomo.gif (1144 ツバツイツト)
カスタム検索


Tweet