LoginSignup
1
0

More than 3 years have passed since last update.

EMLauncherをCentOS8にInstall

Posted at

EMLauncherをCentOS8にInstall

CentOS8を最小構成でインストールした状態を前提に記載します。
CentOS内でEMLauncherを動かして、パッケージをLocalFileにアップロードするように環境設定します。

次のサイトを参考にさせて頂きました。
1. GitHub KLab/emlauncherのREADME
※この記事は、 GitHub KLab/emlauncherのREADMEを元に、CentOS8用に修正、加筆させて頂きました。
2. EMLauncherをVagrant/CentOS環境で試してみる(未完成)

Install required packages

// remiリポジトリの追加
// ※標準のPHPパッケージには"php-pecl-imagick php-pecl-memcached"がないのでremiをインストールする必要がある。
# dnf install httpd mariadb-server memcached

// インストールするPHPのバージョンを指定
// ※ "dnf list | grep remi | grep php" でインストール可能なPHPバージョンを確認できる。
# dnf module install -y php:remi-7.4
// ※既にPHPがインストールされている場合は、"dnf module disable php"を実行し無効化することが出来る。
# dnf install  php-gd php-mbstring php-xml php-pecl-imagick php-pecl-memcached php-pecl-zip php-pdo php-mysqlnd git

# curl -sS https://getcomposer.org/installer | php
# cp composer.phar /usr/local/bin/composer

Deploy codes

# cd /var/www//html
# git clone https://github.com/KLab/emlauncher.git
# cd emlauncher
# git submodule init
# git submodule update
# composer install
# cd /var/www//html
# chown -R apache:apache emlauncher

Apache setup

// /var/www/html/emlauncher/web/.htaccess内の下記の内容をコメントアウトして/etc/php.iniに記載
// ※CentOS8ではphp-fpmが使用されているので、htaccess内で記載するとエラーになるため
// .htaccessでコメントにする内容
#php_flag short_open_tag On
#php_value memory_limit "4G"
#php_value upload_max_filesize "4G"
#php_value post_max_size "4G"
#php_value max_execution_time 300
#php_value max_input_time 300

// /etc/php.iniで記載する内容の差分
# diff php.ini.orig php.ini
187c187,188
< short_open_tag = Off
---
> ;short_open_tag = Off
> short_open_tag = On
388c389,390
< max_execution_time = 30
---
> ;max_execution_time = 30
> max_execution_time = 300
398c400,401
< max_input_time = 60
---
> ;max_input_time = 60
> max_input_time = 300
409c412,413
< memory_limit = 128M
---
> ;memory_limit = 128M
> memory_limit = 4G
694c698,699
< post_max_size = 8M
---
> ;post_max_size = 8M
> post_max_size = 4G
846c851,852
< upload_max_filesize = 2M
---
> ;upload_max_filesize = 2M
> upload_max_filesize = 4G

/etc/httpd/conf/httpd.confを編集します。

// 下記の内容を追加
SetEnv MFW_ENV 'ec2'
<Directory "/var/www/html">
  // 次の2か所を変更
  Options FollowSymLinks
  AllowOverride All
  ...略...
</Directory>
# sudo systemctl start httpd
# sudo systemctl enable httpd

Database setup

# sudo systemctl start mariadb
# sudo systemctl enable mariadb

DBのユーザ名、パスワードを書いたファイルを作成します。
例:

// DB名:パスワード
# echo 'emlauncher:sample_password' > $HOME/dbauth

data/sql/database.sqlの中身をdbauthのパスワードを合わせて修正し、MySQLに流します。

# mysql -uroot < /path/to/emlauncher/data/sql/database.sql
# mysql -uroot emlauncher < /path/to/emlauncher/data/sql/tables.sql

Memcache setup

# sudo systemctl start memcached
# sudo systemctl enable memcached

Configuration

mfw_serverevn_config.phpを編集

# /var/www/html/emlauncher/config
# cp emlauncher_config_sample.php emlauncher_config.php

// 例:編集する内容の差分
// アップロードするパッケージの保管場所を"/var/www/html/emlauncher-files"とする場合
# diff emlauncher_config_sample.php emlauncher_config.php 
67c67,68
<               'storage_class' => 'S3',
---
>               //'storage_class' => 'S3',
>               'storage_class' => 'LocalFile',
96c97,98
<                       'path' => '/path/to/directory',
---
>                       //'path' => '/path/to/directory',
>                       'path' => '/var/www/html/emlauncher-files',
99c101,102
<                       'url_prefix' => '/path/for/url',
---
>                       //'url_prefix' => '/path/for/url',
>                       'url_prefix' => '/emlauncher-files',

mfw_serverenv_config.php を編集

# cd /var/www/html/emlauncher/config
# cp mfw_serverenv_config_sample.php mfw_serverenv_config.php 
// 例:編集する内容の差分
# diff mfw_serverenv_config_sample.php mfw_serverenv_config.php 
23c23,24
<                       'authfile' => '/path/to/dbauth-file',
---
>                       //'authfile' => '/path/to/dbauth-file',
>                       'authfile' => '/home/emlauncher/dbauth',

Setup bundletool for Android App Bundle

※この手順に関しては、行っていないので、必用であれば、GitHub KLab/emlauncherのREADMEを参照して下さい。

postfixとファイアウォールの設定

EMLauncherはsendmailを使用するので、メールが送信できるように、postfixをインストール、設定して下さい。
必用に応じて、ファイアウォールのhttps, httpのポート開放を行って下さい。

※EMLauncherから"forgot password"等でメールを送る際、"mb_send_mail faild"となる場合はSELinuxで引っかかっているので、次のコマンドを実行してみて下さい。

# setsebool -P httpd_can_sendmail=1

Complete

ブラウザでインスタンスにHTTPでアクセスします。 EMLauncherのログインページが表示されたら完了です。
http://hostname/emlauncher/web

ユーザの登録

// MySQLでemlauncherデータベースに対して、下記のコマンドでユーザ登録を行う。
INSERT INTO user_pass (mail) VALUES ('hogeuser@hogehoge.jp');

ユーザ登録後、ブラウザで、EMLauncherを開き"forgot password"からパスワードの設定を行う。

CentOS7にインストールする場合

// yumでパッケージのインストールを下記のように行って下さい。
# yum -y  install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install --enablerepo=remi,remi-php74  php-gd php-mbstring php-xml php-pecl-imagick php-pecl-memcached php-pecl-zip php-pdo php-mysqlnd git php
1
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
1
0