공부합시다!/LInux

Rocky9: Wordpress + PHP8.0 + MySQL8.0

간서치 2023. 8. 25. 17:39
728x90

Rocky9에 wordpress와 MySQL을 설치해서 Connection 하는 과정입니다.

2Tier 구성.

 

1. Rocky9-1

 

# dnf install -y wget tar httpd

# wget https://ko.wordpress.org/wordpress-5.7.8-ko_KR.tar.gz

# tar xvfz wordpress-5.7.8-ko_KR.tar.gz

# cp -ar wordpress/* /var/www/html/

# cp /var/www/html/{wp-config-sample.php,wp-config.php}

# sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php/g' /etc/httpd/conf/httpd.conf

# dnf install -y php php-common php-opcache php-cli php-gd php-curl php-mysqlnd

# systemctl enable --now httpd

# firewall-cmd --add-port=80/tcp

# sed -i 's/database_name_here/wordpess/g' /var/www/html/wp-config.php
# sed -i 's/username_here/root/g' /var/www/html/wp-config.php
# sed -i 's/password_here/It12345!/g' /var/www/html/wp-config.php
# sed -i 's/localhost/10.0.0.12/g' /var/www/html/wp-config.php

# dnf install -y mysql

 

2. Rocky9-2

 

# dnf install -y mysql-server
# systemctl start mysqld


# mysql_secure_installation 

mysql> 패스워드 설정 여부: y

mysql> 패스워드 강도: 2

mysql> 패스워드 입력: 8글자 이상, 대소문자, 숫자, 특수기호 -> It12345!

mysql> 적용여부: y

mysql> anonymous 계정 삭제: y

mysql> root 사용자의 원격 로그인 불허: No

mysql> test database 삭제 여부: y

mysql> 권한테이블 reload: y


# mysql -uroot -p

패스워드: It12345!

mysql> select host,user from mysql,user;

mysql> create user 'root'@'%' identified by 'It12345!';

mysql> grant all privileges on *.* to 'root'@'%';

mysql> flush privileges
firewall-cmd --add-port=3306/tcp

 

3. Rocky9-1

 

# mysql -uroot -pIt12345! -h 10.0.0.12

mysql> create database wordpress;

exit

 

4. Host PC or VM W10에서 http://10.0.0.11 접속 테스트

 

 

 

 

728x90