Centos8 LEMPPJ 

#SELinuxを無効化しアップデート
vi /etc/selinux/config

```
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled　#変更
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

dnf -y update

```

必要な設定をインストール

sudo vi 0S8LEMPJ.sh
```
#nginx:php:mysqlインストール
dnf install vim
dnf remove -y php
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
rpm --import http://rpms.remirepo.net/RPM-GPG-KEY-remi
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf -y install dnf-utils
sudo dnf module install php:remi-7.4
dnf module list php
dnf update
dnf -y install mod_ssl
dnf -y install php php-devel php-mysqlnd php-gd php-pear php-pecl-apc-devel php-pecl-zip php-gd php-zip php-mysqlnd
dnf -y install nginx
systemctl start nginx
systemctl enable nginx
dnf -y update

#開発ツールなど、基本的なパッケージをインストールしておきます。
dnf -y groupinstall base
dnf -y groupinstall development

#Python３系インストールコマンド
dnf install python3

#Djangoのインストールにはpip3を使用します。
dnf install pip3

#Djangoのインストール
pip3 install django


#jsの設定です。
dnf install -y nodejs npm
dnf npm install n -g
dnf install npm
dnf n stable
dnf install nodejs
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
dnf module reset nodejs
sudo dnf module reset nodejs
sudo dnf module enable nodejs:16
sudo dnf module -y install nodejs:16/common
node -v
npm install && npm run dev
source ~/.bashrc

#java
yum install java-11-openjdk
yum install java-11-openjdk-devel
yum install java-11-openjdk-headless

```
sudo chmod u+x 0S8LEMPJ.sh
sudo ./0S8LEMPJ.sh

mysql

```
dnf localinstall https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
dnf repolist enabled | grep "mysql.*-community.*"
dnf module disable mysql
dnf info mysql-community-server
dnf install mysql-community-server

dnf localinstall https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
dnf repolist enabled | grep "mysql.*-community.*"
dnf module disable mysql
dnf info mysql-community-server
dnf install mysql-community-server

#以下のコマンドでMySQLがインストールされていることを確認します。
mysqld --version

パスワード確認
# cat /var/log/mysqld.log | grep password
2019-12-13T06:12:17.402781Z 1 [Note] A temporary password is generated for root@localhost: <初期パスワード>

[root@centos8 ~]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!
sudo mysql -u root -p
パスワード入力

mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';
mysql>flush privileges;
mysql>exit

#mysql起動
systemctl start mysqld

#パスワード再確認
cat /var/log/mysqld.log | grep password
2019-12-13T06:12:17.402781Z 1 [Note] A temporary password is generated for root@localhost: <初期パスワード>

#mysql自動起動設定(再起動してから自動起動有効化)
systemctl restart mysqld
systemctl enable mysqld
```