LoginSignup
1
0

More than 1 year has passed since last update.

EC2(Amazon Linux 2)でLAMP環境構築

Last updated at Posted at 2022-07-18

1.はじめに

WordPress、Joomla!をインストールする際に使用するLAMP環境をEC2(Amazon Linux 2)で構築します。
インストールするバージョンは下記となります。

# php -v
PHP 8.0.20 (cli) (built: Jun 23 2022 20:34:07) ( NTS )

# mysql --version
mysql  Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)

2.事前作業

1.root昇格

sudo su -

2.yumのパッケージをアップデート

yum -y update

3.Apacheインストール

1.Apacheインストール

yum -y install httpd

2.Apacheのバージョン確認、インストールされている事を確認します。

httpd -v

3.Apache起動

systemctl start httpd

4.MySqlインストール

1.MySqlのEPELリポジトリを追加

yum -y install https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql80-community-release-el7-3.noarch.rpm

2.MySqlインストール

yum -y install mysql-community-server
Public key for mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm is not installedエラーが表示された場合 MySQLのGPGキーの有効期限切れがエラー原因です。

新しいGPGキーをインポートします。

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

3.MySqlのバージョン確認、インストールされている事を確認します。

mysql --version

4.MySql起動

systemctl start mysqld

5.PHPインストール

1.amazon-linux-extrasでphpが管理されているか確認

amazon-linux-extras | grep php

2.PHPインストール

amazon-linux-extras install -y php8.0

3.PHPのバージョン確認、インストールされている事を確認します。

php -v
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