LAMP Setup and Setting
이번글에선 MariaDB와 PHP를 설치 하는 방법을 알아보고
LAMP Setup 글을 마치도록 하자.
Step 1 MariaDB Install & Setting
MariaDB란? (링크 추가예정)
dnf install mariadb-server
위 명령어를 입력해 MairaDB를 설치한다.
systemctl enable mariadb.service
systemctl start mariadb
systemctl status mariadb
위 명령어를 입력하여 MariaDB를 실행한 뒤
잘 작동되고 있는지 확인해 보자.
mysql_secure_installation
위 명령어를 입력하여 MariaDB에 보안 설정을 해줘야 하는데
먼저 Enter current password for root (enter for none) :
이라고 나온 부분은 그냥 Enter로 넘어간다.
다음으로 Set root passwrod? 라고 물어 보는 곳에서 Y를 입력한 뒤
원하는 비밀번호를 입력한다.
Remove anonymous users? : 익명 사용자를 제거 할 것이냐고 물어보는 것이다.
Disallow root login remotely? : 원격으로 root에 로그인 할수 있게 할 것인지 물어보는 것이다.
Remove test database and access to it? : “test” DB를 제거 할 것인지 물어보는 것이다.
Reload privilege tables now? : 테이블을 지금 reload 할 것인지 물어보는 것이다.
이렇게 까지 하면 설정한 비밀번호로 SQL에 접근 할 수 있다.
Step 2 PHP Install
PHP 란? (링크 추가예정)
PHP는 아래 설치 과정을 그대로 따라가기만 하면 된다.
dnf install php php-common
dnf install php-mysql php-pdo php-gd php-mbstring
systemctl restart httpd
Apache를 재시작 시킨 후에
cd /var/www/html/
위 명령어를 통해 html 폴더로 이동한 후
vi info.php
또는
gedit info.php
위 명령어를 입력한 뒤에 info.php 파일 안에 아래 코드를 입력해 주자.
<?php phpinfo(); ?>
파일을 저장하고 파일을 빠져나온 뒤
자신의 IP뒤에 info.php를 붙여 웹 브라우저 주소창에 입력하면
위와 같이 PHP의 정보가 뜨게 되며 PHP와 MariaDB 설치는 모두 완료되며
LAMP가 모두 갖추어 졌다.
AMP을 쓰며 도움 받은 사이트
http://www.tecmint.com/install-lamp-apache-mariadb-and-php-on-fedora-23/
“[Fedora] MariaDB & PHP 설치”에 대한 한개의 댓글