This procedure manual is for installing KLab's Android / iOS test application distribution tool ʻEM Launcher` on CentOS8.
__ * The version of CentOS used when writing this procedure is 8.1.1911
. __
__ * Please log in as the root
user and execute all the following processes. __
Firewall setup
Open the http (80) port.
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld
Install required packages
Add the EPEL repository.
dnf -y install epel-release
Add the Remi repository.
dnf -y install http://rpms.famillecollet.com/enterprise/remi-release-8.rpm
Install PHP 7.4.
dnf -y module install php:remi-7.4
Install other packages.
dnf -y install httpd mariadb-server memcached php-gd php-mbstring php-xml php-pecl-imagick php-pecl-memcached php-pecl-zip php-pdo php-mysqlnd git
Install Composer.
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer`
Deploy codes
Clone the emlauncher from GitHub.
cd /var/www/html
git clone https://github.com/KLab/emlauncher.git
Initialize and update the submodule.
cd emlauncher
git submodule init && git submodule update
Install the related packages in Composer.
composer install
Adjust the permissions so that Apache can access the emlauncher.
chown -R apache:apache /var/www/html/emlauncher
Apache setup
php-fpm
is used in CentOS8, it will be an error if it is described in .htaccess
, so it is necessary to comment out the setting in .htaccess
and set it in /etc/php.ini
. there is.Edit ʻemlauncher /web/.htaccess`.
vim /var/www/html/emlauncher/web/.htaccess
Comment out the following content.
```
#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
```
Edit /etc/php.ini
.
vim /etc/php.ini
Set the commented out settings in .htaccess
as follows.
```
short_open_tag = On
max_execution_time = 300
max_input_time = 300
memory_limit = 4G
post_max_size = 4G
upload_max_filesize = 4G
```
Edit the Apache configuration file /etc/httpd/conf/httpd.conf
.
vim /etc/httpd/conf/httpd.conf
Modify as follows.
```
SetEnv MFW_ENV 'ec2'
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride All
...Abbreviation...
</Directory>
```
Enable httpd.
systemctl start httpd && systemctl enable httpd
Database setup
Enable Database.
systemctl start mariadb && systemctl enable mariadb
Create a dbauth
file that contains your Database username and password.
echo 'emlauncher:password' > /var/www/html/dbauth
__ * Please replace the password
part above before executing. __
Modify the xxxxxxxx
part in ʻemlauncher /data/sql/database.sql to match the password for
dbauth`.
vim /var/www/html/emlauncher/data/sql/database.sql
Stream the emlauncher database settings to MySQL.
mysql -u root < /var/www/html/emlauncher/data/sql/database.sql
mysql -u root emlauncher < /var/www/html/emlauncher/data/sql/tables.sql
Memcache setup
Enable Memcache.
systemctl start memcached && systemctl enable memcached
Setup bundletool for Android App Bundle
I don't need a keystore to re-sign the APK, so I'll skip it.
mfw_serverevn_config.php
Copy config / mfw_serverenv_config_sample.php
and replace$ serverenv_config ['ec2'] ['database'] ['authfile']
with the path of the dbauth
file created in 5.
cd /var/www/html/emlauncher/config
cp mfw_serverenv_config_sample.php mfw_serverenv_config.php
vim mfw_serverenv_config.php
Rewrite the dbauth
file path.
````
'authfile' => '/var/www/html/dbauth',
````
emlauncher_config.php
Create a storage directory.
mkdir /var/www/html/emlauncher-files
Adjust the permissions so that Apache can access the storage directory.
chown -R apache:apache /var/www/html/emlauncher-files
Copy config / emlauncher_config_sample.php
and rewrite it for your environment.
cd /var/www/html/emlauncher/config
cp emlauncher_config_sample.php emlauncher_config.php
vim emlauncher_config.php
Modify as follows.
```
'storage_class' => 'LocalFile',
'path' => '/var/www/html/emlauncher-files',
'url_prefix' => '../../../emlauncher-files',
```
When the EM Launcher login page "http: // virtual machine address (192.168.xxx.xxx) /emlauncher/web/login" is displayed on your browser, the installation of EM Launcher is complete.
Connect to Mysql. The password is the password set in dbauth
.
mysql -u emlauncher -p emlauncher
Register the user's mail in the ʻuser_pass` table.
INSERT INTO user_pass (mail) VALUES ('[email protected]');
__ * Please replace [email protected]
with your own email and execute. __
Exit from Mysql.
exit
Reset your password from forgot password
on the EM Launcher login page.
Install postfix.
dnf -y install postfix
Enable postfix.
systemctl start postfix && systemctl enable postfix
Temporarily disable SELinux.
setenforce 0
Disable it permanently by editing the SELinux configuration file.
vim /etc/selinux/config
Change SELINUX
from ʻenforcing to
disable.
SELINUX=disable`
In my case, it was caused by Outbound Port 25 Blocking, so I solved it by forwarding it with Gmail.
To transfer from Postfix, enable "Insecure App Access" on the Security Settings Page of your Gmail account for forwarding.
Add the setting to forward by Gmail to the postfix configuration file.
vim /etc/postfix/main.cf
Add the following settings at the very end.
```
# Gmail
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_tls_CApath = /etc/pki/tls/certs/ca-bundle.crt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
```
Set up your Gmail account information for forwarding.
vim /etc/postfix/sasl_passwd
Replace the email and password below with the contents below.
[smtp.gmail.com]:587 [email protected]:password
Create a database from your Gmail account information file.
postmap hash:/etc/postfix/sasl_passwd
Delete the file containing your Gmail account and password.
rm -f /etc/postfix/sasl_passwd
Restart psotfix.
systemctl restart postfix
Recommended Posts