さくらクラウドにCentOS8のサーバを立てました。
テスト用で使えればよかったので手順の精査とかはできていません。
そのままでは動かないところありますので察してください。
Apache httpd
dnf update -y
dnf install -y httpd postgresql postgresql-server
dnf list installed | grep httpd
httpd -v
systemctl status httpd
systemctl start httpd
systemctl status httpd
which httpd
systemctl is-enabled httpd
systemctl enable httpd
systemctl is-enabled httpd
firewall-cmd --list-all
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
firewall-cmd --list-all
これで /var/www/html/index.html
にファイルを置くとブラウザで表示できる。
PHP
dnf info php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-mysqlnd php-json php-pgsql php-pecl-apcu php-pecl-zendopcache php-mbstring php-intl php-zip
dnf install -y php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-mysqlnd php-json php-pgsql php-pecl-apcu php-pecl-zendopcache php-mbstring php-intl php-zip
dnf list installed | grep php
php -v
cp -p /etc/php.ini /etc/php.ini.bak
echo 'date.timezone = Asia/Tokyo' >> /etc/php.ini
systemctl restart httpd
これで /var/www/html/index.php
にファイルを置くとブラウザで表示できる。
composerのインストール
wget https://getcomposer.org/installer -O composer-installer.php
php composer-installer.php --filename=composer --install-dir=/usr/local/bin
composer --version
rm composer-installer.php
postgres
postgres --version
/usr/bin/postgresql-setup --initdb
# 認証方式の設定
vi /var/lib/pgsql/data/pg_hba.conf
systemctl status postgresql
systemctl start postgresql
systemctl status postgresql
systemctl is-enabled postgresql
systemctl enable postgresql
systemctl is-enabled postgresql
EC-CUBEのインストール
cd /var/www/html
git clone https://github.com/EC-CUBE/ec-cube.git
cd ec-cube
composer install
# DATABASE_URL と DATABASE_SERVER_VERSION を適宜変更
# sed -i -e 's/DATABASE_URL=sqlite:\/\/\/var\/eccube.db/DATABASE_URL=postgres:\/\/postgres@127.0.0.1\/eccube/g' ./.env
# sed -i -e 's/DATABASE_SERVER_VERSION=3/DATABASE_SERVER_VERSION=10/g' ./.env
bin/console e:i --no-interaction