Skip to content

Instantly share code, notes, and snippets.

@5tigerjelly
Last active January 10, 2020 16:14
Show Gist options
  • Save 5tigerjelly/7e33ce7820b7b326af10bfd62baf3da7 to your computer and use it in GitHub Desktop.
Save 5tigerjelly/7e33ce7820b7b326af10bfd62baf3da7 to your computer and use it in GitHub Desktop.
워드프레스 EC2에 설치하는 방법
//ssh 하기
ssh ec2-user@<-public DNS-> -i seoul-key.pem
//키의 권환 변경하기
chmod 600 seoul-key.pem
//ssh 접속한 이후
sudo su
//아파치 웹서버 설치하기
yum -y install httpd
service httpd start
//PHP 설치하기
yum -y install php php-mysql
service httpd restart
//PHP,아파치 설치 여부 확인하기
cd /var/www/html
vi test.php
i
<?php phpinfo() ?>
esc 키
:wq
//테스트 접속해보기
<-public DNS->/test.php
//접속이 안되면 ec2 보안 룰에서 http 포트 80 열어주기
//MySQL 서버 설치하기
yum -y install mysql-server
service mysqld start
mysqladmin -uroot create blog
mysql_secure_installation
//데이터베이스 유저 생성 및 비밀번호 설정해주기
Enter current password for root: Press return for none
Change Root Password: Y
New Password: Enter your new password
Remove anonymous user: Y
Disallow root login remotely: Y
Remove test database and access to it: Y
Reload privilege tables now: Y
//워드프레스 다운로드하기
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
rm latest.tar.gz
mv wordpress blog
cd blog
mv wp-config-sample.php wp-config.php
vi wp-config.php
i
//데이타베이스 정보입력
define(‘DB_NAME’, ‘blog’);
define(‘DB_USER’, ‘root’);
define(‘DB_PASSWORD’, ‘YOUR_PASSWORD’);
define(‘DB_HOST’, ‘localhost’);
//워드프레스 최대 메모리 설정
define( 'WP_MEMORY_LIMIT', '256M' );
//FTP 연결방법 설정
define('FS_METHOD', 'direct');
esc 키
:wq
//AWS만의 권환 문제 해결하기
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 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment