Successfully reported this slideshow.
Your SlideShare is downloading. ×

[설치의 정석] EC2에서 워드프레스 설치하기

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 11 Ad

More Related Content

Slideshows for you (20)

Similar to [설치의 정석] EC2에서 워드프레스 설치하기 (20)

Advertisement

More from Jay Park (20)

Recently uploaded (20)

Advertisement

[설치의 정석] EC2에서 워드프레스 설치하기

  1. 1. [설치의 정석] EC2에서 워드프레스 설치하기 박재호(jrogue@gmail.com)
  2. 2. 참고 자료 • <컴퓨터 vs 책> 블로그 • http://jhrogue.blogspot.com/ • OKdevTV 유튜브 방송 • 오늘자 방송: https://www.youtube.com/watch?v=T8FWtyrC1i0&list=PLdntWJk2tJPJe12 b_ZV4RnUlMLymtHkvG&index=2 • 설치의 정석 리스트: • https://www.youtube.com/playlist?list=PLdntWJk2tJPJe12b_ZV4RnUlMLymtHkvG • 슬라이드 셰어 • https://www.slideshare.net/jrogue/presentations • ASCIINEMA • https://asciinema.org/~jrogue
  3. 3. 오늘 소개할 내용 • EC2에서 워드프레스 설치하기 • LAMP 스택 + WP • 데이터베이스 구성과 설정 파일 • 주의: • 최소 단계로 꼭 필요한 프로그램만 설치한다 • 내가 무엇인지 모르는 행위는 하지 않는다!!!
  4. 4. EC2 설정(1) • 설치의 정석이므로… EC2는 plain vanilla
  5. 5. EC2 설정(2) • 보안 그룹에 80(HTTP) 추가
  6. 6. 몇 가지 힌트 • LAMP 설치 과정에서 단계별로 점검해야 한다! • 어디서 잘못되었는지 초기에 인지할 필요가 있음 • 접근 허가에 특히 주의! /var/www/html • 참고: https://chmodcommand.com/chmod-2775/ • WP salt에 주의 • https://kinsta.com/knowledgebase/wordpress-salts/ • 로그인할 때 브라우저 쿠키에 안전하게 저장할 목적으로 사용하는 키 • 플러그인으로 처리할 수도 있지만… 정석이니까 wp-config.php에서 수작 업으로 편집
  7. 7. 스크립트(1) $ sudo yum update -y $ sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2 $ sudo yum install -y httpd mariadb-server $ sudo systemctl start httpd $ sudo systemctl enable httpd $ sudo systemctl is-enabled httpd 1단계_ LAMP 설치 $ curl localhost $ sudo usermod –a –G apache ec2-user $ exit # 다시 로그인 한다 $ groups $ sudo chown –R ec2-user:apache /var/www $ sudo chmod 2775 /var/www && find /var/www –type d –exec sudo chmod 2775 {} ; $ find /var/www –type f –exec sudo chmod 0664 {} ; $ cd /var/www $ echo “<?php phpinfo(); ?>” > /var/www/html/phpinfo.php $ curl localhost/phpinfo.php $ rm /var/www/html/phpinfo.php 2단계_ 그룹 추가 후 아파치 디렉토리 접근 권한 변경
  8. 8. 스크립트(2) $ sudo systemctl start mariadb $ sudo mysql_secure_installation $ sudo systemctl enable mariadb $ sudo yum install php-mbstring -y $ sudo systemctl restart httpd $ sudo systemctl restart php-fpm $ cd /var/www/html $ wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz $ mkdir phpMyAdmin && tar xvpfz phpMyAdmin-latest-all-languages.tar.gz -C phpMyAdmin --strip-components 1 $ rm phpMyAdmin-latest-all-languages.tar.gz $ sudo systemctl start mariadb $ curl localhost/phpMyAdmin 3단계_ MariaDB 설정, phpMyAdmin 설치 $ cd $ mkdir src $ cd src $ wget https://wordpress.org/latest.tar.gz $ tar xvpfz latest.tar.gz $ mysql -u root -p mysql> CREATE USER ‘wpuser'@'localhost' IDENTIFIED BY 'your_strong_password'; mysql> CREATE DATABASE `wpdb`; mysql> GRANT ALL PRIVILEGES ON `wpdb`.* TO ‘wpuser’@’localhost’; mysql> FLUSH PRIVILEGES; mysql> exit 4단계_ WP 설치
  9. 9. 스크립트(3) $ cd wordpress/ $ cp wp-config-sample.php wp-config.php $ wget --output-document=salt.txt https://api.wordpress.org/secret-key/1.1/salt/ $ vi wp-config.php define('DB_NAME’, wpdb'); --> 수정 define('DB_USER', ‘wpuser'); --> 수정 define('DB_PASSWORD', 'your_strong_password'); --> 수정 <<<<<<<<<<<<<<< 앞서 wget으로 얻은 salt.txt 내용으로 변경한다 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> define( 'AUTH_KEY', 'put your unique phrase here' ); define( 'SECURE_AUTH_KEY', 'put your unique phrase here' ); define( 'LOGGED_IN_KEY', 'put your unique phrase here' ); define( 'NONCE_KEY', 'put your unique phrase here' ); define( 'AUTH_SALT', 'put your unique phrase here' ); define( 'SECURE_AUTH_SALT', 'put your unique phrase here' ); define( 'LOGGED_IN_SALT', 'put your unique phrase here' ); define( 'NONCE_SALT', 'put your unique phrase here' ); 5단계_ WP 설치 $ cd .. $ cp -a wordpress/ /var/www/html/ $ sudo vi /etc/httpd/conf/httpd.conf <Directory "/var/www/html"> 영역에서 다음을 수정 AllowOverride None → ALL $ sudo systemctl restart httpd 6단계_ WP 설정
  10. 10. 웹 브라우저에서 확인
  11. 11. 보면서 따라해봅시다~~~ • https://asciinema.org/a/rTBOUOLRJErrmJtYjYwNtjmID

×