본문 바로가기
Linux/서버구축 1.2.3...

워드프레스를 위한 Rocky Linux/AlmaLinux 서버 구축 (1)

by aegypius 2024. 10. 7.
728x90
반응형

contabo에 도쿄 리전이 추가된 것은 수개월 전부터 알고는 있었는데...... 추가 서버가 당장 필요한 것도 아니고, 그저  테스트 해 보고 싶은 것들 몇가지와 Rocky Linux와 AlmaLinux 자체에 대한 궁금증이 조금 있었기에 새로운 os의 테스트는 차일피일 미루기만 했다. 그러다가 보름전에 국내 몇몇의 서버호스팅 업체를 둘러보고는 CentOS의 지원종료를 실감했다.

얼마 전(같은데 지난 글을 찾아보니 벌써 3년하고도 6개월이나 지났다) CentOS 8을 테스트 해 본 후로....언젠가는 다른 배포판을 찾아야 할 때가 올 것이라고 글을 남겼는데.....시간이 벌써 이렇게 지나갔고..........지금은.. 그 시점이 되었다.......

Rocky Linux와 AlmaLinux를 만 6일 동안 번갈아가며 테스트 해 본 결과는.....일단 그냥 한 번 써보자~이다. 나 같은 수준의 리눅스 사용자 입장에서는 CentOS와 Rocky와 Alma간의 차이를 못느꼈다. 물론 개인적인 입장에서 아주 심각한 문제점을 발견하기도 했는데......그저 apache와 PHP의 연동이 매끄럽지 못하다..정도로 느낄 뿐이지...정확히 어디에서 발생하는 문제인지조차 파악할 수 없었다. 이 또한 그냥 부딪쳐야 알 수 있을 것이다. 아니면 패키지를 업데이트하다 보면 해결이 될지도?? 모를 일이다......-_-;

이번에는 가상머신 등에 배포판을 설치하는 것은 생략했다. 단지 Rocky Linux와 AlmaLinux가 궁금했기에 VPS에 해당 OS를 선택하고 클릭하는 것으로 설치를 대신했다.

기존에 남겼던 '워드프레스를 위한 리눅스 서버 구축'을 보면서 몇 가지 생략했던 소소한(?) 것들을 채워나가야겠다.

 

(1) 프롬프트의 호스트 이름변경

[계정@기본호스트이름 dir]에서 기본 호스트이름이 너무 길고 거슬린다. 

/etc/hostname을 직접 수정해도 되지만 아마도 리부팅해야 할 것이다.

# hostnamectl set-hostname HOSTNAME 

이렇게 했는데 호스트네임이 즉시 변경되지 않는다....  뭐가 있었던거 같은데 잘 안되서..일단 리부팅했다. -_-;

 

 

(2) selinux의 설정

RockyLinux 9.4 나 Almalinux 9.4 모두 설치 직후의 설정을 보면 selinux가 비활성화(disabled) 상태이다. /etc/selinux/config를 열어서 확인해보자. # sestatus 로도 확인이 조금 빠르다...

 

(3) ssh 포트변경, 작업용 계정 추가

1. firewalld 상태를 확인하여 필요한 조치를 취하자. (설치여부, 실행, 서비스 활성화 등)

2. ssh를 위한 새로운 포트를 열고, ssh의 설정에서 포트를 변경하자.

# firewall-cmd --permanent --zone=public --add-port=xxxxx/tcp
success
# firewall-cmd --reload
success
# firewall-cmd --list-all

3. /etc/ssh/sshd_config의 대략 21번째 줄에서 기본포트를 변경하자.

4. 작업용 계정을 추가하고, sshd_config에 AllowUsers에 추가한 계정을 등록하자.
 : centos 7에서 사용하던 ssh(OpenSSH_7.4p1, OpenSSL 1.0.2k-fips)보다 상위버전(OpenSSH_8.7p1, OpenSSL 3.0.7)이 설치되어 있는데, PAM인증으로 PermitRootLogin without-password이 가능해진거 같다. 이부분은 나중에 생각이 나면 테스트해 볼 수 있겠지만....어차피 AllowUsers를 사용할 계획이고, 여기에 root는 제외될 것이기에 root 로그인은 불가능할 것이다. (위 openssh의 버전은 RockyLinux 9.4를 설치했을 때이며, AlmaLinux 9.4 에서는 버전확인을 못했지만 비슷(?)할 것이다..-_-)

5. sftp의 설정, 두 개 이상의 포트를 열고 사용하는 것에 대해서는 지난번 글을 참고하자. 로키나 알마에서 아직 sftp를 설정하지 않았는데...나중에 필요하면 테스트 해보고...뭔가 추가할 것이 있다면 글을 수정해야겠다... 당장은 vsftp로도 충분하다.

 

(4) 서버의 타임존을 korea(seoul)로 변경,
디렉토리/파일 목록의 날짜를 연-월-일 순으로...
가상메모리(swap) 설정

타임존 설정변경은.........이전글과 같이....

/usr/share/zoneinfo/Asia의 Seoul 파일의 심볼릭링크를 /etc/localtime에 걸어두면 되는데....

# ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

알마리눅스에서는 즉시 적용이 되었는데 록키에서는 안되는 듯 하다. 메모를 안해둬서....-_-;

Rocky Linux라면 아래와 같이 timedatectl을 사용하자.

# timedatectl set-timezone Asia/Seoul

 

파일목록의 날짜형식을 변경하는 것은 centos와 동일하다. 이전글을 참고해도 되는데 핵심은 아래의 한 줄이다.

alias ls='ls --color=auto --time-style=long-iso'

적당한 이름으로 /etc/profile.d에 .sh파일로 저장해두자. 리부팅하면 적용된다.

 

가상메모리(swap)설정은 이전글을 참고하자.

 

 

(5) ftp를 설정하자.(vsftpd)

 

vsftpd의 설정은 이전글을 참고하면 충분하다. 군더더기 빼고 간결하게 정리하면 아래와 같다.

패키지가 설치되어 있는지의 여부는 yum, dnf, rpm 등을 통해서 빠르게 확인할 수 있다.

# yum list installed
# yum list installed 패키지이름
# yum list installed *패키지이름일부*
yum 대신 dnf를 사용할 수 있다.
또한 yum(혹은 dnf) list installed 대신 rpm -qa

 

설치가 안되어 있다면 일단 아래와 같이 설치하자.

[root@rocky /]# yum install vsftpd
Last metadata expiration check: 0:30:00 ago on Mon 07 Oct 2024 10:21:44 AM KST.
Dependencies resolved.
========================================================================================================================================================
 Package                           Architecture                      Version                                 Repository                            Size
========================================================================================================================================================
Installing:
 vsftpd                            x86_64                            3.0.5-5.el9                             appstream                            157 k

Transaction Summary
========================================================================================================================================================
Install  1 Package

Total download size: 157 k
Installed size: 347 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-3.0.5-5.el9.x86_64.rpm                                                                                            60 kB/s | 157 kB     00:02
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                    51 kB/s | 157 kB     00:03
Rocky Linux 9 - AppStream                                                                                               1.7 MB/s | 1.7 kB     00:00
Importing GPG key 0x350D275D:
 Userid     : "Rocky Enterprise Software Foundation - Release key 2022 <releng@rockylinux.org>"
 Fingerprint: 21CB 256A E16F C54C 6E65 2949 702D 426D 350D 275D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1
  Installing       : vsftpd-3.0.5-5.el9.x86_64                                                                                                      1/1
  Running scriptlet: vsftpd-3.0.5-5.el9.x86_64                                                                                                      1/1
  Verifying        : vsftpd-3.0.5-5.el9.x86_64                                                                                                      1/1

Installed:
  vsftpd-3.0.5-5.el9.x86_64

Complete!
[root@rocky /]#

 

설치가 끝났다면 우선 방화벽에서 ftp포트를 열어줘야 한다. 아래와 같이 하자.

# firewall-cmd --permanent --zone=public --add-service=ftp
success
# firewall-cmd --reload
success
# firewall-cmd --list-all

 

방화벽에서 ftp 서비스가 허용된 것을 확인했다면, 일단 vsftpd를 가동시키자.

# systemctl start vsftpd
# systemctl enable vsftpd
Created symlink.................

 

이 상태에서 ftp로 접속을 시도하면 아래와 같이 모든 창이 다 보일 수 있다.

 

이제 vsfptd의 설정을 변경하자. (/etc/vsftpd/vsftpd.conf 편집)

1. 이전버전과는 다르게 12번째 줄의 anoymous_enable=NO로 설정되어 있어서 그냥 두면 되겠다.

2. 100, 101, 103번째 줄의 주석을 해제(#제거)하고, 저장한 후에 같은 디렉토리(/etc/vsftpd)에 chroot_list를 빈 파일로 만들어 두자. 아래와 같다.

##### /etc/vsfptd/vsftpd.conf 편집 #####

100: chroot_local_user=YES
101: chroot_list_enable=YES
102: # (default follows)
103: chroot_list_file=/etc/vsftpd/chroot_list
# pwd
/etc/vsftpd
# touch chroot_list

 

3. 위와 같이 편집을 마치고 chroot_list 파일을 생성했다면.... vsftp의 데몬을 다시 실행하자.

# systemctl restart vsftpd

 

4. 이제 ftp로 접속하면 접속이 안될 것이다. /home 디렉토리에서 ftp를 사용하려는 계정의 소유권과 허가권(owner ship, permission)을 root, 755로 변경하자.

# pwd
/home
# chown -R root.root ACCOUNT
# chmod 755 ACCOUNT
#

 

5. 해당 계정으로 ftp접속은 가능하지만 디렉토리에 대한 권한이 없어서 파일을 올리거나, 디렉토리를 생성 할 수 없을 것이다. 계정의 홈디렉토리 내에 "새로운 디렉토리"를 생성하고 이 디렉토리에 대한 소유권은 해당 계정에게 주고, 퍼미션이 755로 되어있는지 확인하자. 해당 계정은 이 디렉토리 내에서 제약없이 ftp를 사용할 수 있다.

여러개의 계정이 존재하고 이중에서 관리자가 사용할 계정이 있다면 chroot_list에 계정을 포함시킬 수 있다. 해당 계정은 모든 디렉토리에 대한 이동 및 읽기 권한(755)이 있기에 유용하게 사용할 수 있다.

6. ftp포트를 변경하자.

기본포트는 21이고, ftp의 데이터는 포트 20을 사용한다. 예전에 작성한 글에서 포트에 대해서 잘 정리된 사이트의 링크를 걸어둔거 같은데 어떤 글인지 찾을 수가 없다. -_-;

일단 두 개 이상의 포트를 방화벽에서 열어두고 다음의 세 줄을 vsftpd.conf에 추가하고 데몬을 다시 실행하자.

# firewall-cmd --permanent --zone=public --add-port=xxxxx/tcp
[OR]
# firewall-cmd --permanent --zone=public --add-port=xxxxx-xxxxx/tcp
# firewall-cmd --reload
# firewall-cmd --list-all
##### vsftpd.conf 편집 #####
#
# 다음의 세 줄을 추가하자
#
listen_port=xxxxx
pasv_min_port=xxxxx
pasv_max_port=xxxxx
#
#
# listen_port는 변경할 ftp의 포트가 되고
# pasv_main_port ~ pasv_max_port는 ftp의 data port의 범위이다
#
# 기본값이 ftp 접속포트는 21이고 데이터포트는 20이므로 참고하여 수정하자.
#

 

7. ftps로 설정을 변경하자.

CentOS 때와 마찬가지로 openssl로 /etc/vsfptd/vsftpd.pem의 유효기간 10년(?)짜리 인증서를 생성할 것이다. 아래와 같다.

# openssl req -x509 -days 3650 -newkey rsa:2048 -nodes -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem

국가 이름부터 마지막의 이메일까지 모두 생략하고 엔터키로 넘겨도 무방하다. 설정한 디렉토리에 의도한 파일이 생성되었는지만 확인하고 이상이 없다면 vsftpd.conf에 다음의 6줄을 추가한 후 vsftpd 데몬을 재시작 하고 접속해보자.

##### vsftpd.conf 추가내용 #####
ssl_enable=YES
rsa_cert_file=/etc/vsftpd/vsftpd.pem
force_local_logins_ssl=YES
force_local_data_ssl=YES
ssl_tlsv1=YES

처음 접속할 때에 아래와 같이 유효하지 않은 인증서라고 나오면 '신뢰함'에 체크하고 예(확인)을 누르자.
(이후 접속은 FTP-Require explicit FTP over TLS를 선택하자.)

"이후 세션에서 인증서 항상 신뢰"를 선택했음에도 접속할 때마다 위의 경고메시지가 나온다면, pc의 ftp-client 프로그램(나는 알이 편하다~ 이거에 익숙해져서...)을 완전히 종료한 후에 다시 실행하여 접속해보자. -_-;

CentOS 7.x 에서 사용하던 vsftpd 3.0.2와 지금 설치한 Rocky Linux에서의 3.0.5는 큰 차이가 없는 듯 하다...

 

 

(6) 네임서버 운영을 위한 bind 설치 (named)

[root@rocky etc]# yum install bind bind-chroot bind-utils
Last metadata expiration check: 3:15:45 ago on Mon 07 Oct 2024 10:21:44 AM KST.
Dependencies resolved.
===========================================================================================================================
 Package                                  Architecture       Version                           Repository             Size
===========================================================================================================================
Installing:
 bind                                     x86_64             32:9.16.23-18.el9_4.6             appstream             490 k
 bind-chroot                              x86_64             32:9.16.23-18.el9_4.6             appstream              16 k
 bind-utils                               x86_64             32:9.16.23-18.el9_4.6             appstream             201 k
Installing dependencies:
 bind-dnssec-doc                          noarch             32:9.16.23-18.el9_4.6             appstream              45 k
 bind-libs                                x86_64             32:9.16.23-18.el9_4.6             appstream             1.2 M
 bind-license                             noarch             32:9.16.23-18.el9_4.6             appstream              13 k
 checkpolicy                              x86_64             3.6-1.el9                         appstream             352 k
 fstrm                                    x86_64             0.6.1-3.el9                       appstream              27 k
 libmaxminddb                             x86_64             1.5.2-3.el9                       appstream              33 k
 libuv                                    x86_64             1:1.42.0-2.el9_4                  appstream             146 k
 policycoreutils-python-utils             noarch             3.6-2.1.el9                       appstream              71 k
 protobuf-c                               x86_64             1.3.3-13.el9                      baseos                 34 k
 python3-audit                            x86_64             3.1.2-2.el9                       appstream              82 k
 python3-bind                             noarch             32:9.16.23-18.el9_4.6             appstream              61 k
 python3-distro                           noarch             1.5.0-7.el9                       appstream              36 k
 python3-libsemanage                      x86_64             3.6-1.el9                         appstream              79 k
 python3-ply                              noarch             3.11-14.el9.0.1                   baseos                103 k
 python3-policycoreutils                  noarch             3.6-2.1.el9                       appstream             2.0 M
 python3-setools                          x86_64             4.4.4-1.el9                       baseos                551 k
 python3-setuptools                       noarch             53.0.0-12.el9_4.1                 baseos                838 k
Installing weak dependencies:
 bind-dnssec-utils                        x86_64             32:9.16.23-18.el9_4.6             appstream             114 k

Transaction Summary
===========================================================================================================================
Install  21 Packages

Total download size: 6.5 M
Installed size: 21 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): protobuf-c-1.3.3-13.el9.x86_64.rpm                                                  18 kB/s |  34 kB     00:01
(2/21): python3-ply-3.11-14.el9.0.1.noarch.rpm                                              99 kB/s | 103 kB     00:01
(3/21): python3-setools-4.4.4-1.el9.x86_64.rpm                                             173 kB/s | 551 kB     00:03
(4/21): python3-distro-1.5.0-7.el9.noarch.rpm                                               80 kB/s |  36 kB     00:00
(5/21): python3-setuptools-53.0.0-12.el9_4.1.noarch.rpm                                    233 kB/s | 838 kB     00:03
(6/21): checkpolicy-3.6-1.el9.x86_64.rpm                                                   565 kB/s | 352 kB     00:00
(7/21): python3-audit-3.1.2-2.el9.x86_64.rpm                                               183 kB/s |  82 kB     00:00
(8/21): policycoreutils-python-utils-3.6-2.1.el9.noarch.rpm                                108 kB/s |  71 kB     00:00
(9/21): bind-utils-9.16.23-18.el9_4.6.x86_64.rpm                                           311 kB/s | 201 kB     00:00
(10/21): python3-policycoreutils-3.6-2.1.el9.noarch.rpm                                    1.9 MB/s | 2.0 MB     00:01
(11/21): bind-libs-9.16.23-18.el9_4.6.x86_64.rpm                                           2.8 MB/s | 1.2 MB     00:00
(12/21): bind-dnssec-utils-9.16.23-18.el9_4.6.x86_64.rpm                                   250 kB/s | 114 kB     00:00
(13/21): bind-chroot-9.16.23-18.el9_4.6.x86_64.rpm                                          71 kB/s |  16 kB     00:00
(14/21): bind-9.16.23-18.el9_4.6.x86_64.rpm                                                1.8 MB/s | 490 kB     00:00
(15/21): python3-bind-9.16.23-18.el9_4.6.noarch.rpm                                        241 kB/s |  61 kB     00:00
(16/21): bind-license-9.16.23-18.el9_4.6.noarch.rpm                                         50 kB/s |  13 kB     00:00
(17/21): bind-dnssec-doc-9.16.23-18.el9_4.6.noarch.rpm                                     191 kB/s |  45 kB     00:00
(18/21): libuv-1.42.0-2.el9_4.x86_64.rpm                                                   614 kB/s | 146 kB     00:00
(19/21): python3-libsemanage-3.6-1.el9.x86_64.rpm                                          327 kB/s |  79 kB     00:00
(20/21): libmaxminddb-1.5.2-3.el9.x86_64.rpm                                               138 kB/s |  33 kB     00:00
(21/21): fstrm-0.6.1-3.el9.x86_64.rpm                                                      112 kB/s |  27 kB     00:00
---------------------------------------------------------------------------------------------------------------------------
Total                                                                                      1.0 MB/s | 6.5 MB     00:06
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                   1/1
  Installing       : bind-license-32:9.16.23-18.el9_4.6.noarch                                                        1/21
  Installing       : protobuf-c-1.3.3-13.el9.x86_64                                                                   2/21
  Installing       : fstrm-0.6.1-3.el9.x86_64                                                                         3/21
  Installing       : libmaxminddb-1.5.2-3.el9.x86_64                                                                  4/21
  Installing       : libuv-1:1.42.0-2.el9_4.x86_64                                                                    5/21
  Installing       : bind-libs-32:9.16.23-18.el9_4.6.x86_64                                                           6/21
  Installing       : bind-utils-32:9.16.23-18.el9_4.6.x86_64                                                          7/21
  Installing       : python3-setuptools-53.0.0-12.el9_4.1.noarch                                                      8/21
  Installing       : python3-setools-4.4.4-1.el9.x86_64                                                               9/21
  Installing       : python3-distro-1.5.0-7.el9.noarch                                                               10/21
  Installing       : bind-dnssec-doc-32:9.16.23-18.el9_4.6.noarch                                                    11/21
  Installing       : python3-libsemanage-3.6-1.el9.x86_64                                                            12/21
  Installing       : python3-audit-3.1.2-2.el9.x86_64                                                                13/21
  Installing       : checkpolicy-3.6-1.el9.x86_64                                                                    14/21
  Installing       : python3-policycoreutils-3.6-2.1.el9.noarch                                                      15/21
  Installing       : policycoreutils-python-utils-3.6-2.1.el9.noarch                                                 16/21
  Installing       : python3-ply-3.11-14.el9.0.1.noarch                                                              17/21
  Installing       : python3-bind-32:9.16.23-18.el9_4.6.noarch                                                       18/21
  Installing       : bind-dnssec-utils-32:9.16.23-18.el9_4.6.x86_64                                                  19/21
  Running scriptlet: bind-32:9.16.23-18.el9_4.6.x86_64                                                               20/21
  Installing       : bind-32:9.16.23-18.el9_4.6.x86_64                                                               20/21
  Running scriptlet: bind-32:9.16.23-18.el9_4.6.x86_64                                                               20/21
  Installing       : bind-chroot-32:9.16.23-18.el9_4.6.x86_64                                                        21/21
  Running scriptlet: bind-chroot-32:9.16.23-18.el9_4.6.x86_64                                                        21/21
  Verifying        : python3-setuptools-53.0.0-12.el9_4.1.noarch                                                      1/21
  Verifying        : python3-setools-4.4.4-1.el9.x86_64                                                               2/21
  Verifying        : protobuf-c-1.3.3-13.el9.x86_64                                                                   3/21
  Verifying        : python3-ply-3.11-14.el9.0.1.noarch                                                               4/21
  Verifying        : python3-distro-1.5.0-7.el9.noarch                                                                5/21
  Verifying        : checkpolicy-3.6-1.el9.x86_64                                                                     6/21
  Verifying        : python3-audit-3.1.2-2.el9.x86_64                                                                 7/21
  Verifying        : python3-policycoreutils-3.6-2.1.el9.noarch                                                       8/21
  Verifying        : policycoreutils-python-utils-3.6-2.1.el9.noarch                                                  9/21
  Verifying        : bind-utils-32:9.16.23-18.el9_4.6.x86_64                                                         10/21
  Verifying        : bind-libs-32:9.16.23-18.el9_4.6.x86_64                                                          11/21
  Verifying        : bind-dnssec-utils-32:9.16.23-18.el9_4.6.x86_64                                                  12/21
  Verifying        : bind-chroot-32:9.16.23-18.el9_4.6.x86_64                                                        13/21
  Verifying        : bind-32:9.16.23-18.el9_4.6.x86_64                                                               14/21
  Verifying        : python3-bind-32:9.16.23-18.el9_4.6.noarch                                                       15/21
  Verifying        : bind-license-32:9.16.23-18.el9_4.6.noarch                                                       16/21
  Verifying        : bind-dnssec-doc-32:9.16.23-18.el9_4.6.noarch                                                    17/21
  Verifying        : libuv-1:1.42.0-2.el9_4.x86_64                                                                   18/21
  Verifying        : python3-libsemanage-3.6-1.el9.x86_64                                                            19/21
  Verifying        : libmaxminddb-1.5.2-3.el9.x86_64                                                                 20/21
  Verifying        : fstrm-0.6.1-3.el9.x86_64                                                                        21/21

Installed:
  bind-32:9.16.23-18.el9_4.6.x86_64                          bind-chroot-32:9.16.23-18.el9_4.6.x86_64
  bind-dnssec-doc-32:9.16.23-18.el9_4.6.noarch               bind-dnssec-utils-32:9.16.23-18.el9_4.6.x86_64
  bind-libs-32:9.16.23-18.el9_4.6.x86_64                     bind-license-32:9.16.23-18.el9_4.6.noarch
  bind-utils-32:9.16.23-18.el9_4.6.x86_64                    checkpolicy-3.6-1.el9.x86_64
  fstrm-0.6.1-3.el9.x86_64                                   libmaxminddb-1.5.2-3.el9.x86_64
  libuv-1:1.42.0-2.el9_4.x86_64                              policycoreutils-python-utils-3.6-2.1.el9.noarch
  protobuf-c-1.3.3-13.el9.x86_64                             python3-audit-3.1.2-2.el9.x86_64
  python3-bind-32:9.16.23-18.el9_4.6.noarch                  python3-distro-1.5.0-7.el9.noarch
  python3-libsemanage-3.6-1.el9.x86_64                       python3-ply-3.11-14.el9.0.1.noarch
  python3-policycoreutils-3.6-2.1.el9.noarch                 python3-setools-4.4.4-1.el9.x86_64
  python3-setuptools-53.0.0-12.el9_4.1.noarch

Complete!
[root@rocky etc]#

 

bind도 9.11.4에서 9.16.23으로 업데이트 되었다. 설치가 완료되었다면 포트 53(tcp/udp)을 열어두고 데몬 서비스를 활성화 하자.

# firewall-cmd --permanent --zone=public --add-port=53/tcp
success
# firewall-cmd --permanent --zone=public --add-port=53/udp
success
# firewall-cmd --reload
# 
# systemctl start named
# systemctl enable named
#

 

/etc/named.conf의 수정은 centos 때와 다를것이 없다. 아래와 같이 수정하자.

##### named.conf 편집 #####

11: listen-on port 53 { 127.0.0.1; };    =>   listen-on port 53 { any; };
12: listen-on-v6 port 53 { ::1; };       =>   listen-on-v6 port 53 { none; };
19: allow-query     { localhost; };      =>   allow-query     { any; };

recursion yes;                           =>   recursion no;

allow-transfer { none; };                =>   추가
allow-query-cache { any; };              =>   추가
version "any-sting";                     =>   추가

 

이제 /etc/sysconfig/named를 열어서 아래와 같이 가장 마지막 줄에 OPTIONS="-4"를 추가하자.

# BIND named process options
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# OPTIONS="whatever"     --  These additional options will be passed to named
#                            at startup. Don't add -t here, enable proper
#                            -chroot.service unit file.
#
# NAMEDCONF=/etc/named/alternate.conf
#                        --  Don't use -c to change configuration file.
#                            Extend systemd named.service instead or use this
#                            variable.
#
# DISABLE_ZONE_CHECKING  --  By default, service file calls named-checkzone
#                            utility for every zone to ensure all zones are
#                            valid before named starts. If you set this option
#                            to 'yes' then service file doesn't perform those
#                            checks.
OPTIONS="-4"

 

수정사항이 있다면 named 데몬을 재실행 해야한다. (systemctl restart named)

named의 설치와 기본 설정은 여기서 마치고 도메인 설정에 대한 부분은 밑에서 다시 정리하자.

 

 

(7) 웹서버 운영을 위한 apache 설치 (httpd)

 

이제 apache를 dnf로 설치해보자. 물론 yum 을 사용해도 상관없다. 

[root@rocky /]# dnf install httpd*
Last metadata expiration check: 4:19:58 ago on Mon 07 Oct 2024 10:21:44 AM KST.
Dependencies resolved.
===========================================================================================================================
 Package                          Architecture          Version                             Repository                Size
===========================================================================================================================
Installing:
 httpd                            x86_64                2.4.57-11.el9_4.1                   appstream                 44 k
 httpd-core                       x86_64                2.4.57-11.el9_4.1                   appstream                1.4 M
 httpd-devel                      x86_64                2.4.57-11.el9_4.1                   appstream                190 k
 httpd-filesystem                 noarch                2.4.57-11.el9_4.1                   appstream                 11 k
 httpd-manual                     noarch                2.4.57-11.el9_4.1                   appstream                2.2 M
 httpd-tools                      x86_64                2.4.57-11.el9_4.1                   appstream                 79 k
Installing dependencies:
 apr                              x86_64                1.7.0-12.el9_3                      appstream                122 k
 apr-devel                        x86_64                1.7.0-12.el9_3                      appstream                218 k
 apr-util                         x86_64                1.6.1-23.el9                        appstream                 94 k
 apr-util-bdb                     x86_64                1.6.1-23.el9                        appstream                 12 k
 apr-util-devel                   x86_64                1.6.1-23.el9                        appstream                 70 k
 cyrus-sasl                       x86_64                2.1.27-21.el9                       baseos                    71 k
 cyrus-sasl-devel                 x86_64                2.1.27-21.el9                       appstream                102 k
 expat-devel                      x86_64                2.5.0-2.el9_4.1                     appstream                 51 k
 libdb-devel                      x86_64                5.3.28-53.el9                       appstream                 38 k
 mailcap                          noarch                2.1.49-5.el9                        baseos                    32 k
 openldap-devel                   x86_64                2.6.6-3.el9                         appstream                684 k
 rocky-logos-httpd                noarch                90.15-2.el9                         appstream                 24 k
Installing weak dependencies:
 apr-util-openssl                 x86_64                1.6.1-23.el9                        appstream                 14 k
 mod_http2                        x86_64                2.0.26-2.el9_4                      appstream                162 k
 mod_lua                          x86_64                2.4.57-11.el9_4.1                   appstream                 58 k

Transaction Summary
===========================================================================================================================
Install  21 Packages

Total download size: 5.6 M
Installed size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): mailcap-2.1.49-5.el9.noarch.rpm                                                     17 kB/s |  32 kB     00:01
(2/21): cyrus-sasl-2.1.27-21.el9.x86_64.rpm                                                 33 kB/s |  71 kB     00:02
(3/21): rocky-logos-httpd-90.15-2.el9.noarch.rpm                                            11 kB/s |  24 kB     00:02
(4/21): expat-devel-2.5.0-2.el9_4.1.x86_64.rpm                                              68 kB/s |  51 kB     00:00
(5/21): mod_lua-2.4.57-11.el9_4.1.x86_64.rpm                                                85 kB/s |  58 kB     00:00
(6/21): httpd-tools-2.4.57-11.el9_4.1.x86_64.rpm                                            87 kB/s |  79 kB     00:00
(7/21): httpd-2.4.57-11.el9_4.1.x86_64.rpm                                                  66 kB/s |  44 kB     00:00
(8/21): httpd-devel-2.4.57-11.el9_4.1.x86_64.rpm                                           210 kB/s | 190 kB     00:00
(9/21): httpd-filesystem-2.4.57-11.el9_4.1.noarch.rpm                                       24 kB/s |  11 kB     00:00
(10/21): apr-util-openssl-1.6.1-23.el9.x86_64.rpm                                           32 kB/s |  14 kB     00:00
(11/21): apr-util-bdb-1.6.1-23.el9.x86_64.rpm                                               26 kB/s |  12 kB     00:00
(12/21): apr-util-devel-1.6.1-23.el9.x86_64.rpm                                            148 kB/s |  70 kB     00:00
(13/21): httpd-manual-2.4.57-11.el9_4.1.noarch.rpm                                         1.4 MB/s | 2.2 MB     00:01
(14/21): apr-util-1.6.1-23.el9.x86_64.rpm                                                  375 kB/s |  94 kB     00:00
(15/21): libdb-devel-5.3.28-53.el9.x86_64.rpm                                              151 kB/s |  38 kB     00:00
(16/21): mod_http2-2.0.26-2.el9_4.x86_64.rpm                                               649 kB/s | 162 kB     00:00
(17/21): apr-devel-1.7.0-12.el9_3.x86_64.rpm                                               880 kB/s | 218 kB     00:00
(18/21): apr-1.7.0-12.el9_3.x86_64.rpm                                                     494 kB/s | 122 kB     00:00
(19/21): openldap-devel-2.6.6-3.el9.x86_64.rpm                                             2.5 MB/s | 684 kB     00:00
(20/21): cyrus-sasl-devel-2.1.27-21.el9.x86_64.rpm                                         403 kB/s | 102 kB     00:00
(21/21): httpd-core-2.4.57-11.el9_4.1.x86_64.rpm                                           2.9 MB/s | 1.4 MB     00:00
---------------------------------------------------------------------------------------------------------------------------
Total                                                                                      902 kB/s | 5.6 MB     00:06
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                   1/1
  Installing       : apr-1.7.0-12.el9_3.x86_64                                                                        1/21
  Installing       : apr-util-bdb-1.6.1-23.el9.x86_64                                                                 2/21
  Installing       : apr-util-1.6.1-23.el9.x86_64                                                                     3/21
  Installing       : apr-util-openssl-1.6.1-23.el9.x86_64                                                             4/21
  Installing       : apr-devel-1.7.0-12.el9_3.x86_64                                                                  5/21
  Installing       : httpd-tools-2.4.57-11.el9_4.1.x86_64                                                             6/21
  Installing       : libdb-devel-5.3.28-53.el9.x86_64                                                                 7/21
  Running scriptlet: httpd-filesystem-2.4.57-11.el9_4.1.noarch                                                        8/21
  Installing       : httpd-filesystem-2.4.57-11.el9_4.1.noarch                                                        8/21
  Installing       : expat-devel-2.5.0-2.el9_4.1.x86_64                                                               9/21
  Installing       : rocky-logos-httpd-90.15-2.el9.noarch                                                            10/21
  Running scriptlet: cyrus-sasl-2.1.27-21.el9.x86_64                                                                 11/21
  Installing       : cyrus-sasl-2.1.27-21.el9.x86_64                                                                 11/21
  Running scriptlet: cyrus-sasl-2.1.27-21.el9.x86_64                                                                 11/21
  Installing       : cyrus-sasl-devel-2.1.27-21.el9.x86_64                                                           12/21
  Installing       : openldap-devel-2.6.6-3.el9.x86_64                                                               13/21
  Installing       : apr-util-devel-1.6.1-23.el9.x86_64                                                              14/21
  Installing       : mailcap-2.1.49-5.el9.noarch                                                                     15/21
  Installing       : httpd-core-2.4.57-11.el9_4.1.x86_64                                                             16/21
  Installing       : mod_lua-2.4.57-11.el9_4.1.x86_64                                                                17/21
  Installing       : httpd-2.4.57-11.el9_4.1.x86_64                                                                  18/21
  Running scriptlet: httpd-2.4.57-11.el9_4.1.x86_64                                                                  18/21
  Installing       : mod_http2-2.0.26-2.el9_4.x86_64                                                                 19/21
  Installing       : httpd-devel-2.4.57-11.el9_4.1.x86_64                                                            20/21
  Installing       : httpd-manual-2.4.57-11.el9_4.1.noarch                                                           21/21
  Running scriptlet: httpd-2.4.57-11.el9_4.1.x86_64                                                                  21/21
  Running scriptlet: httpd-manual-2.4.57-11.el9_4.1.noarch                                                           21/21
  Verifying        : mailcap-2.1.49-5.el9.noarch                                                                      1/21
  Verifying        : cyrus-sasl-2.1.27-21.el9.x86_64                                                                  2/21
  Verifying        : rocky-logos-httpd-90.15-2.el9.noarch                                                             3/21
  Verifying        : expat-devel-2.5.0-2.el9_4.1.x86_64                                                               4/21
  Verifying        : mod_lua-2.4.57-11.el9_4.1.x86_64                                                                 5/21
  Verifying        : httpd-tools-2.4.57-11.el9_4.1.x86_64                                                             6/21
  Verifying        : httpd-devel-2.4.57-11.el9_4.1.x86_64                                                             7/21
  Verifying        : httpd-2.4.57-11.el9_4.1.x86_64                                                                   8/21
  Verifying        : httpd-manual-2.4.57-11.el9_4.1.noarch                                                            9/21
  Verifying        : httpd-filesystem-2.4.57-11.el9_4.1.noarch                                                       10/21
  Verifying        : apr-util-openssl-1.6.1-23.el9.x86_64                                                            11/21
  Verifying        : apr-util-devel-1.6.1-23.el9.x86_64                                                              12/21
  Verifying        : apr-util-bdb-1.6.1-23.el9.x86_64                                                                13/21
  Verifying        : apr-util-1.6.1-23.el9.x86_64                                                                    14/21
  Verifying        : libdb-devel-5.3.28-53.el9.x86_64                                                                15/21
  Verifying        : mod_http2-2.0.26-2.el9_4.x86_64                                                                 16/21
  Verifying        : apr-devel-1.7.0-12.el9_3.x86_64                                                                 17/21
  Verifying        : apr-1.7.0-12.el9_3.x86_64                                                                       18/21
  Verifying        : openldap-devel-2.6.6-3.el9.x86_64                                                               19/21
  Verifying        : cyrus-sasl-devel-2.1.27-21.el9.x86_64                                                           20/21
  Verifying        : httpd-core-2.4.57-11.el9_4.1.x86_64                                                             21/21

Installed:
  apr-1.7.0-12.el9_3.x86_64                  apr-devel-1.7.0-12.el9_3.x86_64        apr-util-1.6.1-23.el9.x86_64
  apr-util-bdb-1.6.1-23.el9.x86_64           apr-util-devel-1.6.1-23.el9.x86_64     apr-util-openssl-1.6.1-23.el9.x86_64
  cyrus-sasl-2.1.27-21.el9.x86_64            cyrus-sasl-devel-2.1.27-21.el9.x86_64  expat-devel-2.5.0-2.el9_4.1.x86_64
  httpd-2.4.57-11.el9_4.1.x86_64             httpd-core-2.4.57-11.el9_4.1.x86_64    httpd-devel-2.4.57-11.el9_4.1.x86_64
  httpd-filesystem-2.4.57-11.el9_4.1.noarch  httpd-manual-2.4.57-11.el9_4.1.noarch  httpd-tools-2.4.57-11.el9_4.1.x86_64
  libdb-devel-5.3.28-53.el9.x86_64           mailcap-2.1.49-5.el9.noarch            mod_http2-2.0.26-2.el9_4.x86_64
  mod_lua-2.4.57-11.el9_4.1.x86_64           openldap-devel-2.6.6-3.el9.x86_64      rocky-logos-httpd-90.15-2.el9.noarch

Complete!
[root@rocky /]#

 

설치가 끝났다면 바로 실행시킨 후에 상태를 살펴보자.

# systemctl start httpd
# systemctl status httpd
● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled)
     Active: active (running) since Mon 2024-10-07 14:43:52 KST; 2min 7s ago
       Docs: man:httpd.service(8)
   Main PID: 4703 (httpd)
     Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec:   0 B/sec"
      Tasks: 177 (limit: 36040)
     Memory: 34.5M
        CPU: 276ms
     CGroup: /system.slice/httpd.service
             ├─4703 /usr/sbin/httpd -DFOREGROUND
             ├─4704 /usr/sbin/httpd -DFOREGROUND
             ├─4705 /usr/sbin/httpd -DFOREGROUND
             ├─4706 /usr/sbin/httpd -DFOREGROUND
             └─4707 /usr/sbin/httpd -DFOREGROUND

Oct 07 14:43:52 rocky systemd[1]: Starting The Apache HTTP Server...
Oct 07 14:43:52 rocky httpd[4703]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, >
Oct 07 14:43:52 rocky httpd[4703]: Server configured, listening on: port 80
Oct 07 14:43:52 rocky systemd[1]: Started The Apache HTTP Server.
[root@rocky /]#

AH00558은 httpd.conf를 열어서 100번째 줄의 ServerName의 주석을 해제하고 서버에서 운영중인 도메인이나 서버의 ip 혹은 loopback 주소(127.0.0.1)을 넣어서 해결할 수 있다. 그냥 둬도 아무 문제는 없다.

웹서버가 사용하는 포트를 방화벽에서 허용해야 한다. 이번(?)에는 80, 443포트를 직접 열어두는 것이 아닌 serive로 http와 https를 허용할 것이다. 뭐로 하든지 상관은 없다.

[root@rocky conf]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@rocky conf]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@rocky conf]# firewall-cmd --reload
success
[root@rocky conf]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: cockpit dhcpv6-client ftp http https ssh
  ports: xxxxx/tcp xxxxx-xxxxx/tcp 53/tcp 53/udp
  protocols:
  forward: yes
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
[root@rocky conf]#

 

pc의 웹브라우저에 서버의 ip를 넣고 접속을 시도하면 아래와 같은 화면이 보인다.(아파치의 버전업을 실감하고 있다..)

It work!에서 Testing 123...그리고 또다른 변신이다...-_-;

 

 

(8) MariaDB 10.5.x 설치

Rocky Linux 9.4나 AlmaLinux 9.4에서 yum이나 dnf로 mariadb를 설치하면 10.5.22(AlmaLinux도 같은 버전이었던거 같다)가 설치된다.

처음 Rocky Linux에서는 mariadb.org에서 제공하는 MariaDB server Repositories를 통해서 설치했고, 두 번째 AlmaLinux에서는 그냥 yum(dnf)로 설치했었다. 이번에는 Rocky Linux에서 역시 repo를 통하여 설치해 보려고 한다. 버전은 동일한 10.5 이다. mariadb.org에서의 화면은 아래와 같다.

MariaDB 10.5를 설치할 계획이기에 distribution은 CentoOS 7을, MariaDB Server version은 10.5를 선택했다. 이럴거면 그냥 yum install mariadb....를 실행했어도...-_-;

회색 박스의 내용이 잘 안보이는데...주석 제외하고 핵심내용은 아래와 같다.

[mariadb]
name = MariaDB
baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.5/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1

 

이제 mariadb를 설치해보자

[root@rocky yum.repos.d]# dnf clean all
nn files removed
[root@rocky yum.repos.d]# dnf install MariaDB-server MariaDB-client
Last metadata expiration check: 0:02:30 ago on Mon 07 Oct 2024 04:23:31 PM KST.
Dependencies resolved.
=================================================================================================================================================================================
 Package                                          Architecture                      Version                                           Repository                            Size
=================================================================================================================================================================================
Installing:
 MariaDB-client                                   x86_64                            10.5.26-1.el9                                     mariadb                              8.4 M
 MariaDB-server                                   x86_64                            10.5.26-1.el9                                     mariadb                               18 M
Installing dependencies:
 MariaDB-common                                   x86_64                            10.5.26-1.el9                                     mariadb                               88 k
 MariaDB-shared                                   x86_64                            10.5.26-1.el9                                     mariadb                              118 k
 boost-program-options                            x86_64                            1.75.0-8.el9                                      appstream                            106 k
 galera-4                                         x86_64                            26.4.19-1.el9                                     mariadb                              1.4 M
 libaio                                           x86_64                            0.3.111-13.el9                                    baseos                                23 k
 libtirpc                                         x86_64                            1.3.3-8.el9_4                                     baseos                                93 k
 lsof                                             x86_64                            4.94.0-3.el9                                      baseos                               238 k
 perl-DBI                                         x86_64                            1.643-9.el9                                       appstream                            700 k
 perl-DynaLoader                                  x86_64                            1.47-481.el9                                      appstream                             24 k
 perl-File-Copy                                   noarch                            2.34-481.el9                                      appstream                             19 k
 perl-Math-BigInt                                 noarch                            1:1.9998.18-460.el9                               appstream                            188 k
 perl-Math-Complex                                noarch                            1.59-481.el9                                      appstream                             45 k
 perl-Sys-Hostname                                x86_64                            1.23-481.el9                                      appstream                             16 k
 rsync                                            x86_64                            3.2.3-19.el9                                      baseos                               393 k
 socat                                            x86_64                            1.7.4.1-5.el9_4.2                                 appstream                            299 k
 tar                                              x86_64                            2:1.34-6.el9_4.1                                  baseos                               876 k

Transaction Summary
=================================================================================================================================================================================
Install  18 Packages

Total download size: 31 M
Installed size: 210 M
Is this ok [y/N]: y
Downloading Packages:
(1/18): MariaDB-common-10.5.26-1.el9.x86_64.rpm                                                                                                   60 kB/s |  88 kB     00:01
(2/18): MariaDB-shared-10.5.26-1.el9.x86_64.rpm                                                                                                  124 kB/s | 118 kB     00:00
(3/18): MariaDB-client-10.5.26-1.el9.x86_64.rpm                                                                                                  2.0 MB/s | 8.4 MB     00:04
(4/18): galera-4-26.4.19-1.el9.x86_64.rpm                                                                                                        704 kB/s | 1.4 MB     00:01
(5/18): libaio-0.3.111-13.el9.x86_64.rpm                                                                                                          19 kB/s |  23 kB     00:01
(6/18): MariaDB-server-10.5.26-1.el9.x86_64.rpm                                                                                                  3.1 MB/s |  18 MB     00:05
(7/18): libtirpc-1.3.3-8.el9_4.x86_64.rpm                                                                                                         56 kB/s |  93 kB     00:01
(8/18): lsof-4.94.0-3.el9.x86_64.rpm                                                                                                             255 kB/s | 238 kB     00:00
(9/18): rsync-3.2.3-19.el9.x86_64.rpm                                                                                                            553 kB/s | 393 kB     00:00
(10/18): perl-Math-BigInt-1.9998.18-460.el9.noarch.rpm                                                                                           164 kB/s | 188 kB     00:01
(11/18): socat-1.7.4.1-5.el9_4.2.x86_64.rpm                                                                                                      643 kB/s | 299 kB     00:00
(12/18): tar-1.34-6.el9_4.1.x86_64.rpm                                                                                                           376 kB/s | 876 kB     00:02
(13/18): perl-Sys-Hostname-1.23-481.el9.x86_64.rpm                                                                                                62 kB/s |  16 kB     00:00
(14/18): perl-Math-Complex-1.59-481.el9.noarch.rpm                                                                                               188 kB/s |  45 kB     00:00
(15/18): perl-DBI-1.643-9.el9.x86_64.rpm                                                                                                         435 kB/s | 700 kB     00:01
(16/18): perl-File-Copy-2.34-481.el9.noarch.rpm                                                                                                   79 kB/s |  19 kB     00:00
(17/18): boost-program-options-1.75.0-8.el9.x86_64.rpm                                                                                           422 kB/s | 106 kB     00:00
(18/18): perl-DynaLoader-1.47-481.el9.x86_64.rpm                                                                                                  36 kB/s |  24 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                            3.1 MB/s |  31 MB     00:09
MariaDB                                                                                                                                           14 kB/s |  15 kB     00:01
Importing GPG key 0x1BB943DB:
 Userid     : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
 Fingerprint: 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB
 From       : https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Key imported successfully
Importing GPG key 0xC74CD1D8:
 Userid     : "MariaDB Signing Key <signing-key@mariadb.org>"
 Fingerprint: 177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8
 From       : https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                         1/1
  Installing       : MariaDB-shared-10.5.26-1.el9.x86_64                                                                                                                    1/18
  Running scriptlet: MariaDB-shared-10.5.26-1.el9.x86_64                                                                                                                    1/18
  Installing       : MariaDB-common-10.5.26-1.el9.x86_64                                                                                                                    2/18
  Installing       : perl-Sys-Hostname-1.23-481.el9.x86_64                                                                                                                  3/18
  Installing       : rsync-3.2.3-19.el9.x86_64                                                                                                                              4/18
  Installing       : libaio-0.3.111-13.el9.x86_64                                                                                                                           5/18
  Installing       : boost-program-options-1.75.0-8.el9.x86_64                                                                                                              6/18
  Installing       : perl-File-Copy-2.34-481.el9.noarch                                                                                                                     7/18
  Installing       : perl-Math-Complex-1.59-481.el9.noarch                                                                                                                  8/18
  Installing       : perl-Math-BigInt-1:1.9998.18-460.el9.noarch                                                                                                            9/18
  Installing       : perl-DynaLoader-1.47-481.el9.x86_64                                                                                                                   10/18
  Installing       : perl-DBI-1.643-9.el9.x86_64                                                                                                                           11/18
  Installing       : MariaDB-client-10.5.26-1.el9.x86_64                                                                                                                   12/18
  Installing       : socat-1.7.4.1-5.el9_4.2.x86_64                                                                                                                        13/18
  Installing       : tar-2:1.34-6.el9_4.1.x86_64                                                                                                                           14/18
  Installing       : libtirpc-1.3.3-8.el9_4.x86_64                                                                                                                         15/18
  Installing       : lsof-4.94.0-3.el9.x86_64                                                                                                                              16/18
  Running scriptlet: galera-4-26.4.19-1.el9.x86_64                                                                                                                         17/18
  Installing       : galera-4-26.4.19-1.el9.x86_64                                                                                                                         17/18
  Running scriptlet: galera-4-26.4.19-1.el9.x86_64                                                                                                                         17/18
  Running scriptlet: MariaDB-server-10.5.26-1.el9.x86_64                                                                                                                   18/18
usermod: no changes

  Installing       : MariaDB-server-10.5.26-1.el9.x86_64                                                                                                                   18/18
  Running scriptlet: MariaDB-server-10.5.26-1.el9.x86_64                                                                                                                   18/18


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at https://mariadb.com/kb

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/


  Verifying        : MariaDB-client-10.5.26-1.el9.x86_64                                                                                                                    1/18
  Verifying        : MariaDB-common-10.5.26-1.el9.x86_64                                                                                                                    2/18
  Verifying        : MariaDB-server-10.5.26-1.el9.x86_64                                                                                                                    3/18
  Verifying        : MariaDB-shared-10.5.26-1.el9.x86_64                                                                                                                    4/18
  Verifying        : galera-4-26.4.19-1.el9.x86_64                                                                                                                          5/18
  Verifying        : libaio-0.3.111-13.el9.x86_64                                                                                                                           6/18
  Verifying        : libtirpc-1.3.3-8.el9_4.x86_64                                                                                                                          7/18
  Verifying        : lsof-4.94.0-3.el9.x86_64                                                                                                                               8/18
  Verifying        : tar-2:1.34-6.el9_4.1.x86_64                                                                                                                            9/18
  Verifying        : rsync-3.2.3-19.el9.x86_64                                                                                                                             10/18
  Verifying        : perl-Math-BigInt-1:1.9998.18-460.el9.noarch                                                                                                           11/18
  Verifying        : perl-DBI-1.643-9.el9.x86_64                                                                                                                           12/18
  Verifying        : socat-1.7.4.1-5.el9_4.2.x86_64                                                                                                                        13/18
  Verifying        : perl-Sys-Hostname-1.23-481.el9.x86_64                                                                                                                 14/18
  Verifying        : perl-DynaLoader-1.47-481.el9.x86_64                                                                                                                   15/18
  Verifying        : perl-Math-Complex-1.59-481.el9.noarch                                                                                                                 16/18
  Verifying        : perl-File-Copy-2.34-481.el9.noarch                                                                                                                    17/18
  Verifying        : boost-program-options-1.75.0-8.el9.x86_64                                                                                                             18/18

Installed:
  MariaDB-client-10.5.26-1.el9.x86_64              MariaDB-common-10.5.26-1.el9.x86_64        MariaDB-server-10.5.26-1.el9.x86_64        MariaDB-shared-10.5.26-1.el9.x86_64
  boost-program-options-1.75.0-8.el9.x86_64        galera-4-26.4.19-1.el9.x86_64              libaio-0.3.111-13.el9.x86_64               libtirpc-1.3.3-8.el9_4.x86_64
  lsof-4.94.0-3.el9.x86_64                         perl-DBI-1.643-9.el9.x86_64                perl-DynaLoader-1.47-481.el9.x86_64        perl-File-Copy-2.34-481.el9.noarch
  perl-Math-BigInt-1:1.9998.18-460.el9.noarch      perl-Math-Complex-1.59-481.el9.noarch      perl-Sys-Hostname-1.23-481.el9.x86_64      rsync-3.2.3-19.el9.x86_64
  socat-1.7.4.1-5.el9_4.2.x86_64                   tar-2:1.34-6.el9_4.1.x86_64

Complete!
[root@rocky yum.repos.d]#

 

설치가 완료되었으면 실행을 시켜보자.

[root@rocky yum.repos.d]# systemctl start mariadb
[root@rocky yum.repos.d]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.26-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

그리고 서버를 리부팅 하는 일이 많지는 않지만...혹시 놓칠 수 있으니 다음 한 줄을 잊지 말자....

# systemctl enable mariadb

CentOS 때에도 글을 남겼지만 예전의 암호를 입력하는 로그인 방식으로의 전환과 원격접속 설정은 지난번 글을 참고하자.

 

728x90
반응형

댓글