> systemctl stop firewalld
> systemctl disable firewalld
> vi /etc/selinux/config
파일 수정 - disabled
> init 6
reboot
> yum install -y epel-release yum-utils
epel-release - epl 이라는 레포지토리를 추가 (extra packages for enterprise linux)
yum-utils - 수동으로 레포지토리를 추가하기 위한 패키지
> yum -y install install
https://rpms.remirepo.net/enterprise/remi-release-7.rpm
패키지 설치
> yum-config-manager --enable remi-php73
php 7.3 버전을 설치하기 위한 remirepo 수동 업데이트 명령어
> yum install -y httpd php php-mysql
httpd 설치 및 php 와 db연동을 위한 패키지 설치
> php -v
php 버전 확인 - 반드시 7.xx Version 이어야 함
> yum install -y wget unzip
웹에서 파일을 받아올 수 있는 패키지와 unzip (압축해제, zip파일 다루는) 할 수 있는 패키지 설치
> ls
ls 명령어로 latest.zip 파일 다운받아졌는지 확인
> unzip latest.zip
압축 해제
> ls
ls 명령어로 wordpress 설치됐는지 확인
> mv ./wordpress/ /var/www/html
wordpress 파일을 /var/www/html 디렉토리로 이동
> rm -rf latest.zip
기존에 다운받은 latest.zip 파일 제거
> ls /var/www/html
wordpress 파일 이동 됐는지 확인
> yum install -y mariadb-server
mariadb 서버 설치
> systemctl restart mariadb
> systemctl enable maradb
> mysql
mysql 명령어를 통해 Mariadb 서버에 접속 - exit 서버 나가기
> mysql_secure_installation
mysql 초기 설치 혹은 재설치 이후에 기본적으로 보안 적용할 수 있는 명령어
> mysql -u root -ptest123
mysql root 계정과 비밀 번호 test123 으로 접속
Mara DB [NONE]> CREATE DATABASE wp_DB;
wp_DB 라는 데이터베이스를 생성하겠다
옵션 1 : grant all privileges on db이름.* to 계정명@'%' identified by '비밀번호';
옵션 2 : grant all privileges on db이름.* to 계정명@'대역대' identified by '비밀번호';
계정명@'%' : 해당 계정이 모든 클라이언트에서 접근 가능하다.
계정명@'localhost' : 해당 계정이 localhost(본인 pc)에서만 접근 가능하다.
- 대역대
-localhost : 로컬에서만 접속 가능, 외부 IP 접근 불가
-% : 모든 외부 IP 접근 가능
-123.123.123.123 : 해당 IP(123.123.123.123)에서만 접근 가능
-123.123.123.% : 123.123.123.xxx(/24) 대역에서만 접근 가능
Mara DB [NONE]> GRNAT ALL PRIVILEGES on wp_DB.* to wpuser@localhost IDENTIFIED by '1234'
모든 권한을 wp_DB의 모든테이블을 DB유저@로컬호스트 에게 부여하겠고,
유저의 비밀번호는 1234 로 설정한다는 뜻이다.
Mara DB [NONE]> show databases;
생성한 데이터 베이스를 볼 수 있는 명령어
Mara DB [NONE]> use wp_DB
wp_DB 라는 데이터 베이스를 사용하겠다.
Mara DB [NONE]> show tables;
DB의 테이블 확인
Mara DB [wp_DB]> exit
데이터베이스 나가기
> cd /var/www/html/wordpress/
wordpress 디렉토리로 이동
> ls
wordpress 파일 내용 보기
참고로 앞에서 /var/www/html 에 wordpress 파일이 있음
> mv wp-config-sample.php wp-config.php
파일명 변경
> vi wp-config.php
wp-config.php 파일을 수정
- DB 이름(name)
- User 이름
- password
> systemctl restart httpd
> systemcrl enable httpd
Chrome 에서 211.183.3.80/wordpress
*7계층인 응용계층에 속한다.
wordpress 서버에서 진행
> yum instal -y vsftpd
vsftpd 설치
> systemctl restart vsftpd
> cd /home/user1
user1의 홈 디렉토리로 이동
> touch ftp-test
테스트 file 하나 생성
> echo ftp-test! > ftp-test
ftp-test! 문장 등록
> cat ftp-test
확인
Client 서버에서 동작
> yum install -y ftp
ftp 명령어 사용하기 위한 패키지 설치
ftp> open 211.183.3.80
user name, password 설정
ftp> ls
ls 명령어를 통해 ftp-test 파일 확인
ftp> get ftp-test
ftp-test 파일 get
ftp> exit
ftp 명령어 나가기
> ls
ls 명령어를 통해 ftp-test파일을 잘 받아 왔는지 확인
Filzilla 설치 후 user name, password port 21번 설정 후 확인해보자!
wordpress 서버에서진행
> yun install -y tftp-server
tftp 서버 패키지 설치
> vi /etc/xinetd.d/tftp
tftp 파일 들여다보가
disable - no 로 수정!
server_args : -s /var/lib/tftpboot 주목
> systemctl restart tftp
> systemctl enable tftp
> cd /var/lib/tftpboot/
tftp 디렉토리로 이동
> touch test-tftp
테스트용 파일 생상
> echo 'test-tftp' > test-tftp
문장 삽입
> ls 로 확인
Client 서버에서 진행
> yum install -y tftp-server
tftp 서버 패키지 설치
> tftp
tftp 실행 후 tftp 서버에 접속 (IP 입력)
> get test-tftp
test 파일 받기
--- 만약 get 명령어가 동작하지 않을 경우 방화벽 혹은 셀리눅스 꺼줘야 함!
> cat test-tftp
제대로 받아 왔는지 결과 확인