1. 웹 서버/wordpress 설정
※ 루트 접속 후 selinux 끄기
GCP 인스턴스의 경우 selinux가 활성화되어있다. 이 부분을 유의하자.
$ sudo su -
# setenforce 0
※ httpd, wget 설치
# yum install -y httpd wget
※ php 7.3 리포지토리 구성 후에 설치
# yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install -y epel-release yum-utils
# yum-config-manager --enable remi-php73
# yum install -y php php-cli php-pdo php-fpm php-json php-mysqlnd
※ php 버전 확인
※ wordpress 아카이브 파일 받아온 후 아카이브 압축 해제
# wget https://ko.wordpress.org/latest-ko_KR.tar.gz
# tar zxvf latest-ko_KR.tar.gz
※ wordpress 설정
# cp -a wordpress/* /var/www/html/
# chown apache.apache /var/www/html/*
# cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
# vi /var/www/html/wp-config.php
※ 웹 서버 시작 페이지 파일 설정
# vi /etc/httpd/conf/httpd.conf
※ 웹 서버 실행
# systemctl start httpd
2. DB 설정
※ 루트 로그인 후 mysql 리포지토리 구성
$ sudo su -
# yum install -y http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
※ mysql57 버전 gpgcheck 해제
# vi /etc/yum.repos.d/mysql-community.repo
※ mysql server 설치 및 실행
# yum install -y mysql-community-server
# systemctl start mysqld
※ DB 초기 패스워드 확인
※ 패스워드 변경
# mysql_secure_installation
※ mysql 접속
※ DB, user 생성 및 권한 부여
> create database wordpress;
> create user admin identified by 'It12345!!';
> grant all privileges on wordpress.* to 'admin'@'%' identified by 'It12345!!';
3. 방화벽 설정
※ VPC 네트워크 → 방화벽
※ DB 포트 3306/tcp 오픈
※ 80/tcp, 3306/tcp 포트 오픈 확인
4. 웹 브라우저 접속 테스트
※ 웹 브라우저에 접속하여 wordpress 설치
'Cloud > GCP' 카테고리의 다른 글
6. GCP : Filestore (0) | 2022.07.05 |
---|---|
5. GCP : 인스턴스 CLI로 생성 및 접속 (gcloud CLI) (0) | 2022.07.05 |
4. GCP : VPC 네트워크, 방화벽 생성 (0) | 2022.07.05 |
3. GCP : IAM - 프로젝트 공유 (0) | 2022.06.28 |
1. GCP(Google Cloud Platform) (0) | 2022.06.28 |