第9週-第2期Wordpress&WooCommerceシングルサーバ構成練習
[1シナリオ]シングルサーバ構成
一例でWeb+PHP+DBを構成する
AllnOne: 10.1.1.100
Wordpress v5.8インストール前の準備(推奨)
クラウドFormationスタックの作成
https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/new?stackName=WPLab&templateURL=https:%2F%2Fs3.ap-northeast-2.amazonaws.com%2Fcloudformation.cloudneta.net%2FWordpress%2Faws-wordpress-db2.yaml
[
다음
]をクリックします.
t2.MicroはWooCommerceプラグインをインストールする際、メモリ不足などでインストール自体が正常に行えません
したがって、最も性能の低いT 3はインストール可能である.配布
1時間につき60元ほどの料金が加算されます

Keyname
を選択し、다음
をクリックします.
[
다음
]をクリックします.
[
스택 생성
]をクリックします.
Webサーバのインストール
# 관리자 전환
sudo su -
# 설치
yum install httpd -y
# 서비스 실행
systemctl start httpd && systemctl enable httpd
# 웹서버 버전 확인
httpd -v
# 웹 접속하여 확인
http://EC2_PublicIP/



Test pageが生成されていることがわかります

PHP->PHP拡張版のインストール
# 설치
amazon-linux-extras install php7.4 -y
# PHP 버전 확인
php -v
# PHP Extensions 설치
yum install gcc php-xml php-mbstring php-sodium php-devel php-pear ImageMagick-devel ghostscript -y
# PHP Extensions 정보 확인
php --ini
# PHP Extensions - imagick 설치
## imagick 관련 ini 파일 생성
cat <<EOT> /etc/php.d/40-imagick.ini
; Enable imagick extension module
extension = imagick.so
EOT
## pecl 로 imagick 설치
printf "\n" | pecl install imagick
# php-fpm 재시작으로 imagick 적용
systemctl restart php-fpm
systemctl restart httpd
# PHP Extensions 정보 확인
php --ini
# php info 페이지 생성
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
# phpinfo.php 웹 접속하여 확인
http://EC2_PublicIP/info.php







info.phpページが作成されました

memory limitは128 Mです

オプション)2 m以上のファイルのアップロードに関する設定とメモリのアップグレード->Woomcommerceのインストールに必要
# php.ini 파일 수정
sed -i 's/^upload_max_filesize = 2M/upload_max_filesize = 64M/g' /etc/php.ini
sed -i 's/^post_max_size = 8M/post_max_size = 64M/g' /etc/php.ini
sed -i 's/^max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini
sed -i 's/^memory_limit = 128M/memory_limit = 256/g' /etc/php.ini
# php-fpm 재시작으로 적용
systemctl restart php-fpm

memory limitは128 Mから256 Mに増加

オプション)phpMyAdminをインストールします(失敗した場合は、投稿ではなくサイトに直接アクセスして最初から練習することをお勧めします。)
https://docs.aws.amazon.com/ko_kr/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html#install-phpmyadmin-lamp-server
phpMyAdminはWebベースのデータベース管理ツールで、EC 2インスタンスのMySQLデータベースの表示と編集に使用できます.
# 필요한 종속 항목 설치
sudo yum install php-mbstring php-xml -y
# Apache를 다시 시작
sudo systemctl restart httpd
#php-fpm 를 다시 시작
sudo systemctl restart php-fpm
## Apache 문서 루트로 이동
cd /var/www/html
# phpMyAdmin 최신 릴리스의 소스 패키지 설치
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
# phpMyAdmin 폴더를 생성하고 다음 명령을 사용하여 해당 폴더로 패키지의 압축을 푼다
mkdir phpMyAdmin && tar -xvzf phpMyAdmin-latest-all-languages.tar.gz -C phpMyAdmin --strip-components 1
# 압축 파일 삭제
rm phpMyAdmin-latest-all-languages.tar.gz
# 사이트 접속
http://my.public.dns.amazonaws.com/phpMyAdmin







うん.つながらない

ファイルがありますが...

カタログにページがありますが、見えません.
個人的には、現在のインスタンスにMysqlがインストールされていないことも関係があると思います.次の機会に!

MariaDBのインストール
# 설치
amazon-linux-extras install mariadb10.5 -y
# 서비스 시작
systemctl start mariadb && systemctl enable mariadb
# DB root 계정 설정 및 권장 설정
echo -e "\n Y\n n\n Y\n Y\n Y\n Y\n" | /usr/bin/mysql_secure_installation
# DB 에 한글 입력을 위한 설정
sed -i'' -r -e "/\[mysqld\]/a\character-set-server=utf8" /etc/my.cnf.d/mariadb-server.cnf
sed -i'' -r -e "/\[mysqld\]/a\collation-server=utf8_general_ci" /etc/my.cnf.d/mariadb-server.cnf
sed -i'' -r -e "/\[mysqld\]/a\init_connect=\"SET NAMES utf8\"" /etc/my.cnf.d/mariadb-server.cnf
sed -i'' -r -e "/\[mysqld\]/a\init_connect=\"SET collation_connection = utf8_general_ci\"" /etc/my.cnf.d/mariadb-server.cnf
sed -i'' -r -e "/\[client\]/a\default-character-set=utf8" /etc/my.cnf.d/client.cnf
sed -i'' -r -e "/\[mysql\]/a\default-character-set=utf8" /etc/my.cnf.d/mysql-clients.cnf
sed -i'' -r -e "/\[mysqldump\]/a\default-character-set=utf8" /etc/my.cnf.d/mysql-clients.cnf
# root 계정을 외부에서도 접속 가능하게 설정
mysql -e "set password = password('qwe123');"
mysql -uroot -pqwe123 -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'qwe123';"
# wordpressdb 데이터베이스 생성 및 확인
mysql -uroot -pqwe123 -e "CREATE DATABASE wordpressdb"
mysql -uroot -pqwe123 -e "show databases;"
# 서비스 재시작
systemctl restart mariadb
# 버전 확인
mysql --version







Wordpress v5.8インストール
# 다운로드 (둘 중 아무거나)
wget https://ko.wordpress.org/wordpress-latest-ko_KR.zip
wget https://ko.wordpress.org/wordpress-5.8-ko_KR.zip
# 압축 풀기
unzip wordpress-latest-ko_KR.zip
# wp-config.php 파일 복사
cp wordpress/wp-config-sample.php wordpress/wp-config.php
# wp-config.php 파일에 db 접속을 위한 정보 입력
sed -i "s/database_name_here/wordpressdb/g" wordpress/wp-config.php
sed -i "s/username_here/root/g" wordpress/wp-config.php
sed -i "s/password_here/qwe123/g" wordpress/wp-config.php
# wp-config.php 파일에 메모리 상향 설정
cat <<EOT>> wordpress/wp-config.php
define('WP_MEMORY_LIMIT', '256M');
EOT
# 압축 푼 wordpress 파일을 웹 디렉터리에 복사
cp -r wordpress/* /var/www/html/
# 사용자와 권한 설정
chown -R apache /var/www
chgrp -R apache /var/www
chmod 2775 /var/www
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
# 서비스 재시작
systemctl restart httpd






Wordpress Web接続
http://EC2_PublicIP/
WordpressのWebサイトを作成しました
管理者情報の入力->
워드프레스 설치
クリック
ログイン

質す

最初の文章を書く

カチッと鳴らす

别々の招待状を书きましょう(本来は笑いの写真を放したいですが著作権の问题のため...)

完了したら、[->
공개
]をクリックします.
[
공개
]をクリックします.
[
글 보기
]をクリックします.
しびれるような文章を書いた

がいそうへんかん
외모
->테마
をクリックします.
[
새로 추가
]をクリックします.
検索
sydney

[
설치
]をクリックします.
[
활성화
]をクリックします.
乾杯のテーマが変わった

オプション)外観変換2
[Starter Sites]をクリックします.

[
Import
]をクリックします.
[
Import
]をクリックします.
[
View Site
]をクリックします.
もっときれいになった

参考資料:AFOS[2期]活動内容
Reference
この問題について(第9週-第2期Wordpress&WooCommerceシングルサーバ構成練習), 我々は、より多くの情報をここで見つけました https://velog.io/@icebear2n2/9주차-2-Wordpress-WooCommerce-단일서버-구성-실습テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol