Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

클라우드 엔지니어 꿈나무

Wordpress + Php 8.0 Mysql 8.0 설치 및 실행 - Rocky 9 본문

Linux

Wordpress + Php 8.0 Mysql 8.0 설치 및 실행 - Rocky 9

새싹싹이 2023. 8. 26. 14:56

Wordpress + Php 8.0 Mysql 8.0 설치 및 실행

웹 사이트에서 콘텐츠를 생성, 관리할 수 있는 시스템 소프트웨어 (인터넷 필요)

php 프로그래밍 언어와 mysql 데이터베이스가 기반

설치 파일 wget httpd tar php

 

1. 시나리오 (서버가 rocky9-2)

1-2. rocky9-1 설정

● wordpress 다운 - wget https://ko.wordpress.org/wordpress-5.7.8-ko_KR.tar.gz

 

●아카이브 해제 - tar xvfz wordpress-5.7.8-ko_KR.tar.gz

●http 로 wordpress 를 실행해야 하니 복사 cp -ar wordpress/* /var/www/html/

●원본 파일 보존을 위하여 복사 - cp /var/www/html/{wp-config-sample.php,wp-config.php}

●형식에 맞게 파일 변경

방법 1. vi /etc/httpd/conf/httpd.conf

방법 2. sed 입력

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

 - sed(stream editor) : 입력되어 있는 텍스트를 원하는 텍스트로 편집 옵선

 -

-i(in-place) : 파일 수정 s/원래문자열/대체문자열/

 - -s는 substitute g 플래그는 모든 일치하는 부분을 대체 

● php 설치 dnf install -y php php-common php-opcache php-cli php-gd php-curl php-mysqlnd

● systemctlt enable --now httpd

● 포트 열기 firewall-cmd --add-port=80/tcp

permanent 아니니 reload 금지

● user 정보 입력

방법 1. vi /var/www/html/wp-config.php

방법 2. sed 입력

sed -i 's/database_name_here/wordpress/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

● mysql 설치 dnf install -y sql

 

1-2. rocky9-2 설정

● mysql-server 다운

● systemctl start mysqld

● 보안 설정 mysql_secure_installation

● mysql 계정 설정

로그인 mysql -u root -p

계정 생성 create user 'root'@'%' identified by 'It12345!' ;

권한 주기 grant all privileges on *.* to 'root'@'%' ;

*데이터 베이스 이름

*테이블 이름

root라는 사용자가 @ 접근

% 모든 원격지

설정 사항 적용

● 방화벽 설정 (포트 열기) - 원격제어 firewall-cmd --add-port=3306/tcp

 

1-3. rocky9-1 (mysql 확인)

● 로그인 mysql -uroot -pIt12345! -h10.0.0.12

● 데이터도 입력하면 반영되는 것을 확인할 수 있다.

 

1-4. 인터넷 창

● rocky9-1의 IP 주소인 10.0.0.11을 입력