0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ConoHa WINGにEC-CUBEをサクッとインストール

Last updated at Posted at 2022-07-19

新規ドメイン、ディレクトリ、データベース作成

ConoHa管理画面

サーバー管理>ドメイン>「+ドメイン」> サブドメインを追加 > 無料独自SSL利用する > 保存=>自動でディレクトリ作られる

サイト管理>「切り替え」ボタン→新規ディレクトリで「切り替え」>データベース>「+データベース」>データベース名、ネームタグ入力→保存
サイト管理>データベース>ユーザー選択>接続先データベース「設定」>一番下の「+」>保存

サーバー管理>ドメイン>作成したドメイン 
ステータス:「設定中」→「稼働中」を確認する
独自SSL:[設定中」→「利用中」を確認する

FTPファイルアップ

FTPサーバーでeccube-x.x.x.tar.gzをルートディレクトリにアップロード

SSHでインストール

SSHでアクセス
現在位置を取得

$ pwd

/home/ユーザー名/public_html

eccube-x.x.x.tar.gzあるディレクトリまでcd

$ cd /home/ユーザー名/public_html/eccube-root

gzファイルを解凍

$ tar -xvf eccube-x.x.x.tar.gz

eccube-x.x.x内に移動

$ cd /home/ユーザー名/public_html/eccube-root/eccube-x.x.x

ファイルを隠しファイルも含めてeccube-x.x.xからeccube-rootに移動

mv * .[^\.]* /home/ユーザー名/public_html/eccube-root
rmdir /home/ユーザー名/public_html/eccube-root/eccube-x.x.x
rm /home/ユーザー名/public_html/eccube-root/eccube-x.x.x.tar.gz

ブラウザ確認&インストール

SSL設定が終わっていることを確認

フロントページ
https://example.com/
管理画面
https://example.com/admin/login
ログインID:admin
パスワード:password

アクセスできなかったら

スクリーンショット 2022-12-05 9.32.11.png

# /var/www/html/example.com/.env
(ドメインでアクセスの場合)
TRUSTED_HOSTS=^example\.com$

(IPアドレスでアクセスの場合)
TRUSTED_HOSTS=^xxx\.xxx\.xxx\.xxx$

EC-CUBEインストール

インストールする

WAF対策

ConoHaのIPアドレスを調べる
管理画面>サーバー管理>契約情報>サーバー情報>スペック

.htaccess に以下を追記

vim root/.htaccess
RewriteRule ^(.*) - [E=HTTPS:on]

<IfModule mod_siteguard.c>
SiteGuard_User_ExcludeSig ip(1.2.3.4)
SiteGuard_User_ExcludeSig ip(xx.xx.xx.xx)
</IfModule>

パーミッション設定

一般ディレクトリ 705

find /var/www/html/example.com -type d -exec chmod 705 {} +

一般ファイル 604

find /var/www/html/example.com -type f -exec chmod 604 {} +

以下ディレクトリ 707

chmod 707 /var/www/html/example.com/
chmod 707 /var/www/html/example.com/app/
chmod 707 /var/www/html/example.com/app/Plugin/
chmod 707 /var/www/html/example.com/app/PluginData/
chmod 707 /var/www/html/example.com/app/proxy/
chmod 707 /var/www/html/example.com/app/template/
chmod 707 /var/www/html/example.com/html/
chmod 707 /var/www/html/example.com/var/
chmod 707 /var/www/html/example.com/vendor/

以下ファイル 606

chmod 606 /var/www/html/example.com/composer.json
chmod 606 /var/www/html/example.com/composer.lock

以下ファイル 400

chmod 400 /var/www/html/example.com/.env
chmod 400 /var/www/html/example.com/.htaccess

サイト設定

ログインフォルダ名を憶測されにくいものに変更

管理画面>設定>システム設定>セキュリティ管理
管理画面URLhoge
SSLを強制✔︎
管理画面URLがhttps://example.com/hoge/loginに変更された

ログイン情報を変更

管理画面>設定>システム設定>メンバー管理

店舗設定

管理画面>店舗設定>基本設定


参考記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?