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?

Amazon EC2 に EC-CUBE 4.3 を github repository からインストールする

Posted at

目標

AmazonEC2(AL2023) + php 8.3 環境に EC-CUBE4.3 を、github repository から インストールする

知識材料

利用環境

今回のゴール

  • Amazon EC2 (AL2023) に php 8.3 環境を構築する
  • EC-CUBE 4.3 をインストールする
  • EC-CUBE 4.3 の管理画面を表示できるようにする

実践

EC2 環境構築

  • インスタンスタイプ/Instance type
    • t4g.small
  • EBS
    • 8GiB

必要なパッケージインストール

php 8.3

sudo dnf install -y php8.3

git

sudo dnf install -y git 

composer

sudo dnf install -y composer 

httpd 自動起動設定 & 起動

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

EC-CUBE4 install

リポジトリクローン

cd /var/www/html

sudo git clone https://github.com/EC-CUBE/ec-cube

(オプション)既存のデータベースインスタンスに EC-CUBE 用のスキーマを作成する場合

sudo vi ./ec-cube/.env

対象データベースの設定を環境変数ファイルに記述する

# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
# For production servers, use: "APP_ENV=prod" and "APP_DEBUG=0"
# For local development, use: "APP_ENV=dev" and "APP_DEBUG=1"
APP_ENV=prod
APP_DEBUG=0
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=^localhost$,^example\.com$
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL={{{ 対象データベースの接続文字列を記述する }}}
# DATABASE_URL=mysql://dbuser:secret@mysql/eccubedb
# DATABASE_URL=postgresql://postgres/eccubedb?user=dbuser&password=secret

# The version of your database engine
DATABASE_SERVER_VERSION=3

# The charset of your database engine
DATABASE_CHARSET=utf8mb4
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
MAILER_DSN=smtp://localhost:25
###< symfony/mailer ###

###> APPLICATION CONFIG ###
# EC-CUBE Configs. The default value is defined in app/config/packages/eccube.yaml.
# Please remove commented out and enable it if you want to change.

#ECCUBE_LOCALE=ja
#ECCUBE_TIMEZONE=Asia/Tokyo
#ECCUBE_CURRENCY=JPY
#ECCUBE_ADMIN_ROUTE=admin
#ECCUBE_USER_DATA_ROUTE=user_data
#ECCUBE_ADMIN_ALLOW_HOSTS=[]
#ECCUBE_ADMIN_DENY_HOSTS=[]
#ECCUBE_FORCE_SSL=false
#ECCUBE_PHPINFO_ENABLED=false
#ECCUBE_TEMPLATE_CODE=default
#ECCUBE_AUTH_MAGIC=<change.me>
#ECCUBE_COOKIE_NAME=eccube
#ECCUBE_COOKIE_PATH=/
#ECCUBE_COOKIE_LIFETIME=0
#ECCUBE_GC_MAXLIFETIME=1440
#ECCUBE_ADMIN_USER=admin
#ECCUBE_ADMIN_PASS=password
#ECCUBE_2FA_ENABLED=true
#ECCUBE_2FA_COOKIE_NAME=eccube_2fa
#ECCUBE_2FA_EXPIRE=14
#ECCUBE_RESTRICT_FILE_UPLOAD=0

###< APPLICATION CONFIG ###

インストールスクリプト実行

cd ec-cube

sudo composer install
sudo php bin/console eccube:install --no-interaction

sudo chown -R apache:apache /var/ww/html/ec-cube

ブラウザで管理画面にアクセス

http://{ホスト or IP}/ec-cube/index.php/admin

  • ログインID
    • admin
  • パスワード
    • password

image.png

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?