OS
CentOS 8 MariaDB-10.x - PHP 7.x / 8.0
- 비아웹 오래 전 2022.02.14 16:48 인기
-
- 5,445
- 0
1. 설치 환경
OS : CentOS Linux release 8.2.2004 (Core)
SELINUX : disabled
테스트일자 : 2020.12.01
2. MariaDB.repo 파일 생성
※ 아래 10.3 /10.4 / 10.5 필요한 버전에 맞게 MariaDB.repo파일 생성해주시면 됩니다.
[root@viaweb ~]# vi /etc/yum.repos.d/MariaDB.repo
[MariaDB 10.3]
# MariaDB 10.3 CentOS repository list - created 2020-12-0102:59UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[MariaDB 10.4]
# MariaDB 10.4 CentOS repository list - created 2020-12-0102:59UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[MariaDB 10.5]
# MariaDB 10.5 CentOS repository list - created 2020-12-0102:59UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
3. MariaDB 설치
[root@viaweb ~]# dnf -y install MariaDB-server
4. 자동실행 등록 / 데몬 시작
[root@viaweb ~]# systemct enable mariadb
[root@viaweb ~]# systemctl start mariadb
APACHE 및 PHP 설치 (PHP-7.3 / PHP-7.4 / PHP-8.0)
5. EPEL저장소 / REMI 저장소 설치
[root@viaweb ~]# dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
[root@viaweb ~]# dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
6. 설치 가능한 PHP 버전 확인
[root@viaweb ~]# dnf module list php
Last metadata expiration check:0:54:15 ago on Tue 01 Dec 202012:09:01PMKST.
CentOS-8- AppStream
Name Stream Profiles Summary
php 7.2[d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 8- x86_64
Name Stream Profiles Summary
php remi-7.2 common [d], devel, minimal PHP scripting language
php remi-7.3 common [d], devel, minimal PHP scripting language
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0[e] common [d], devel, minimal PHP scripting language
Hint:[d]efault,[e]nabled,[x]disabled,[i]nstalled
7. 모듈 적용 (필요한 PHP 버전을 선택)
[PHP-7.3]
[root@viaweb ~]# dnf -y module enable php:remi-7.3[PHP-7.4]
[root@viaweb ~]# dnf -y module enable php:remi-7.4[PHP-8.0]
[root@viaweb ~]# dnf -y module enable php:remi-8.0
8. APACHE / PHP 설치
dnf -y install httpd php php-cli php-common php-devel php-ldap php-mbstring php-mcrypt php-mysqlnd php-soap php-gd php-curl php-openssl php-json php-libxml php-xml php-pear php-iconv php-pecl-zip zip unzip php-zip
[root@viaweb ~]# dnf -y install httpd php php-cli php-common php-devel php-ldap php-mbstring php-mcrypt ~~
9. 자동실행 등록 / 데몬 시작
[root@viaweb ~]# systemctl enable httpd
[root@viaweb ~]# systemctl start httpd
cf. 서비스 설정 후 firewalld 나 iptables 허용 해주셔야 원격 서비스 가능합니다.
※ IPTABLES
[root@viaweb ~]# iptables -IINPUT-p tcp --dport 80-j ACCEPT
[root@viaweb ~]# iptables -IINPUT-p tcp --dport 3306-j ACCEPT
※ Firewalld
[root@viaweb ~]# firewall-cmd --permanent --add-port=80/tcp
[root@viaweb ~]# firewall-cmd --permanent --add-port=3306/tcp
[root@viaweb ~]# firewall-cmd --reload
감사합니다.
서버호스팅 비아웹
- 이전글.htaccess: php_value not allowed here 해결책2022.02.14
- 다음글CentOS7 MariaDB-10.3.27 & PHP-7.2.342022.02.14
댓글목록
등록된 댓글이 없습니다.