LoginSignup
2
2

More than 5 years have passed since last update.

AWS Linux2 LAMP環境作成手順~簡単版

Posted at

1、Amazon Linux2をインストールする

2、SUに切り替える
sudo su -
3、タイムゾーンを変更する
timedatectl set-timezone Asia/Tokyo
4、Amazon Linux Extras リポジトリの有効化
amazon-linux-extras list
5、表示したmariadbをインストールする
amazon-linux-extras install lamp-mariadb10.2-php7.2
6、Apacheをインストールする
yum -y install httpd-devel mod_ssl zlib-devel
7、PHPをインストールする
yum -y install php php-devel php-pdo php-mysqlnd php-mbstring php-gd
8、MariaDBをインストールする
yum -y install mariadb-devel mariadb-server
9、PHPの設定
vim /etc/php.ini
expose_php = On
 ↓
expose_php = Off

;date.timezone =
 ↓
date.timezone = 'Asia/Tokyo'
10、WordPressをインストールする
cd /var/www/html
wget https://ja.wordpress.org/wordpress-4.9.7-ja.tar.gz
tar xvf wordpress-x.x.x-ja.tar.gz
chown -R apache:apache .

11、MariaDBの起動と自動起動設定
systemctl start mariadb
systemctl enable mariadb
12、Wordpress用のデータベースとユーザーを作成する
mysql
MariaDB [(none)]> create database wordpress default character set utf8;
MariaDB [(none)]> grant all on wordpress.* to wordpress@localhost identified by 'password';
MariaDB [(none)]> flush privileges;
13、Apacheの起動と自動起動設定
systemctl start httpd
systemctl enable httpd
14、WordPressの初期設定

※.参照文章
https://blog.apar.jp/web/9185/
https://qiita.com/cherubim1111/items/4a89856e743f287c599f

2
2
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
2
2