# DNS Build # Step 1 : Base Image Install FROM rockylinux:9
# Step 2 : Bind Package Install RUN dnf install -y bind bind-utils bind-libs RUN dnf install -y net-tools RUN sed -i 's/127.0.0.1/any/g' /etc/named.conf RUN sed -i 's/localhost/any/g' /etc/named.conf RUN systemctl enable named
step2) 사용자 및 접속 허용 호스트 확인 :select user,host from mysql.user;
step3) 사용자 계정, 접속 허용 호스트 (모두), 비밀번호 생성 :create user root@'%' identified by "It12345!"; step4) 사용 가능한 모든 권한 부여 :grant all privileges on *.* to root@'%';
step5)사용자 및 접속 허용 호스트 확인 :select user,host from mysql.user;
step6) 종료 : exit
2.5. 방화벽 설정
step1) 포트 개방 :firewall-cmd --permanent --add-port=3306/tcp step2) 설정 저장 : firewall-cmd --reload
3. 리눅스 DB 클라이언트 구축 : Rocky9-1-1
3.1. 설치 :dnf install -y mysql
3.2. mysql 접속 :mysql -uroot -pIt12345! -h 10.10.10.2
3.7. httpd.conf 파일 수정 : sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php/g' /etc/httpd/conf/httpd.conf 3.8. 워드프레스 파일 복사 : cp -ar wordpress/* /var/www/html/ 3.9. php 설치 : dnf install -y php php-cli php-gd php-opcache php-curl php-mysqlnd 3.10. wp-config-sample.php 파일 복사 :cp /var/www/html/{wp-config-sample.php,wp-config.php}
3.11. wp-config.php 파일 수정 step1) sed -i 's/database_name_here/wordpress/g' /var/www/html/wp-config.php step2) sed -i 's/username_here/root/g' /var/www/html/wp-config.php step3) sed -i 's/password_here/It12345!/g' /var/www/html/wp-config.php step4) sed -i 's/localhost/10.10.10.2/g' /var/www/html/wp-config.php
3.12. http 서비스 구동 :systemctl start httpd 3.13. 방화벽 설정
step1) 80번 포트 개방 : firewall-cmd --permanent --add-port=80/tcp step2) 저장 : firewall-cmd --reload