Skip to content
gakigaki edited this page Sep 5, 2022 · 10 revisions

ロリポップ(ハイスピード・プラン)へのインストール方法を説明します。(2021年6月2日時点での情報です)

前提

データベース作成

  • データベースバージョン:5.6
  • データベースホスト:mysqlxxx.xxx.xx
  • データベース名:DB_USER-dbname
  • ユーザー名:DB_USER
  • 接続パスワード:*********

SSH 接続

Connect-CMS インストール用ディレクトリに移動

以下、$ で始まる行はSSH でコマンド操作しているものです。

$ cd /home/users/xx/アカウント/web

Connect-CMSコピー

$ git clone https://github.com/opensource-workshop/connect-cms.git .

.htaccess ファイルをwebディレクトリに配置

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^(.*)$ /public/index.php [R]
</IfModule>

Composerダウンロード

$ curl -sS https://getcomposer.org/installer | /usr/local/php/7.3/bin/php
All settings correct for using Composer
Downloading...

Composer (version 2.0.14) successfully installed to: /home/users/xx/アカウント/web/composer.phar
Use it: php composer.phar

Composerインストール

$ /usr/local/php/7.3/bin/php composer.phar install --no-dev
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 118 installs, 0 updates, 0 removals
  - Installing azuyalabs/yasumi (2.3.0): Downloading (100%)
  - Installing laminas/laminas-zendframework-bridge (1.2.0): Downloading (100%)   - Installing laminas/laminas-eventmanager (3.3.1): Downloading (100%)
  - Installing laminas/laminas-code (3.5.1): Downloading (100%)
・・・・・・・・・・中略・・・・・・・・・・・
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
77 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Connect-CMS初期設定

.設定ファイルのコピーとサイト・キーの生成

$ cp .env.example .env
$ /usr/local/php/7.3/bin/php artisan key:generate

**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes        ← yes を入力

URL、データベース設定
.envの変更点

APP_URL=https://初期ドメイン.jp/public
DB_HOST=mysqlxxx.xxx.xx
DB_DATABASE=DB_USER-dbname
DB_USERNAME=DB_USER
DB_PASSWORD=*********

データベーステーブルの初期構築

$ /usr/local/php/7.3/bin/php artisan migrate

**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes        ← yes を入力

Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (0.01 seconds)
Migrating: 2014_10_12_100000_create_password_resets_table
・・・

データベーステーブルへ初期データ追加

$ /usr/local/php/7.3/bin/php artisan db:seed

**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes        ← yes を入力

Seeding: DefaultPagesTableSeeder
Seeded:  DefaultPagesTableSeeder (0.01 seconds)
Seeding: DefaultUsersTableSeeder
Seeded:  DefaultUsersTableSeeder (0.05 seconds)
Seeding: DefaultUsersRolesTableSeeder
Seeded:  DefaultUsersRolesTableSeeder (0 seconds)
Seeding: DefaultConfigsTableSeeder
Seeded:  DefaultConfigsTableSeeder (0.01 seconds)
Seeding: DefaultPluginsTableSeeder
Seeded:  DefaultPluginsTableSeeder (0 seconds)
Database seeding completed successfully.

サイトにアクセスする

https://初期ドメイン.jp/public

でサイトにアクセスする。

注意点

※ ロリポップ(ハイスピード・プラン)では、公開ディレクトリから非公開ディレクトリへシンボリックリンクを作成しても、ブラウザで閲覧すると、403エラーになるとのことです。
  そのため、.htaccess ファイルで設定やデータを不正に閲覧できないようにしています。

ログイン

初期ID、パスワードは以下の初期データを確認してください。
ログイン後はログインID、パスワードを変更してください。
https://github.com/opensource-workshop/connect-cms/blob/master/database/seeders/DefaultUsersTableSeeder.php

インストール完了

以上で、ロリポップ(ハイスピード・プラン)へのConnect-CMSのインストールは完了です。

アップデート

Connect-CMSは現在(2021-01-04)、活発に開発されているCMSです。
適宜アップデートすることをお勧めします。
アップデート方法は以下のページを参考にしてください。
アップデート方法の php コマンドは /usr/local/php/7.3/bin/php に読み替えて実施してください。
Update (アップデート)

Clone this wiki locally