8. APM(Apache, PHP, Mariadb)을 이용한 웹서버 구축
페이지 정보
작성자 관리자 댓글 1건 조회 12,310회 작성일 19-05-15 08:36본문
8. APM(Apache, PHP, Mariadb)을 이용한 웹서버 구축
1. APT(Advanced Packaging Tool) 업그레이드
APM 을 설치하기에 앞서 APT를 최신버전으로 업그레이드 해준다.
sudo apt-get update 와 sudo apt-get upgrade 를 입력해준다.
root@leelab:~# apt-get update && apt-get upgrade
2. Mariadb 설치
MariaDB 서버를 설치합니다.
root@leelab:~# apt-get install mariadb-server
다음과 같이 명령하여 몇 가지 설정을 합니다.
mysql_secure_installation
첫번째 질문은 root의 비밀번호를 입력하라는 것인데, 비밀번호가 없으므로 그냥 엔터를 누릅니다.
Enter current password for root (enter for none):
root의 비밀번호를 설정합니다.
Set root password? [Y/n]
네 가지 질문이 더 나옵니다. 적절히 설정합니다. 보통 전부 Y를 선택합니다.(Y 입력 없이 엔터를 누르면 Y로 처리됩니다.)
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
root@leelab:~# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n]
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n]
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n]
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
root@leelab:~#
mariadb 재시작시 아래 명령을 사용한다.
root@leelab:~# systemctl restart mariadb
3. Apache2 설치
sudo apt-get install apache2 명령어를 실행한다.
root@leelab:~# apt-get install apache2
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
liblua5.2-0
제안하는 패키지:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom
다음 새 패키지를 설치할 것입니다:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap liblua5.2-0
0개 업그레이드, 9개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
1,713 k바이트 아카이브를 받아야 합니다.
이 작업 후 6,920 k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n]
받기:1 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 libapr1 amd64 1.6.3-2 [90.9 kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 libaprutil1 amd64 1.6.1-2 [84.4 kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.1-2 [10.6 kB]
받기:4 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 libaprutil1-ldap amd64 1.6.1-2 [8,764 B]
받기:5 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 liblua5.2-0 amd64 5.2.4-1.1build1 [108 kB]
받기:6 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2-bin amd64 2.4.29-1ubuntu4.6 [1,072 kB]
받기:7 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2-utils amd64 2.4.29-1ubuntu4.6 [83.5 kB]
받기:8 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2-data all 2.4.29-1ubuntu4.6 [160 kB]
받기:9 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB]
내려받기 1,713 k바이트, 소요시간 1초 (1,800 k바이트/초)
Selecting previously unselected package libapr1:amd64.
(데이터베이스 읽는중 ...현재 178152개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../0-libapr1_1.6.3-2_amd64.deb ...
Unpacking libapr1:amd64 (1.6.3-2) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../1-libaprutil1_1.6.1-2_amd64.deb ...
Unpacking libaprutil1:amd64 (1.6.1-2) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
Preparing to unpack .../2-libaprutil1-dbd-sqlite3_1.6.1-2_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.6.1-2) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../3-libaprutil1-ldap_1.6.1-2_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.6.1-2) ...
Selecting previously unselected package liblua5.2-0:amd64.
Preparing to unpack .../4-liblua5.2-0_5.2.4-1.1build1_amd64.deb ...
Unpacking liblua5.2-0:amd64 (5.2.4-1.1build1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../5-apache2-bin_2.4.29-1ubuntu4.6_amd64.deb ...
Unpacking apache2-bin (2.4.29-1ubuntu4.6) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../6-apache2-utils_2.4.29-1ubuntu4.6_amd64.deb ...
Unpacking apache2-utils (2.4.29-1ubuntu4.6) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../7-apache2-data_2.4.29-1ubuntu4.6_all.deb ...
Unpacking apache2-data (2.4.29-1ubuntu4.6) ...
Selecting previously unselected package apache2.
Preparing to unpack .../8-apache2_2.4.29-1ubuntu4.6_amd64.deb ...
Unpacking apache2 (2.4.29-1ubuntu4.6) ...
libapr1:amd64 (1.6.3-2) 설정하는 중입니다 ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
apache2-data (2.4.29-1ubuntu4.6) 설정하는 중입니다 ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
libaprutil1:amd64 (1.6.1-2) 설정하는 중입니다 ...
Processing triggers for systemd (237-3ubuntu10.21) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
liblua5.2-0:amd64 (5.2.4-1.1build1) 설정하는 중입니다 ...
libaprutil1-ldap:amd64 (1.6.1-2) 설정하는 중입니다 ...
libaprutil1-dbd-sqlite3:amd64 (1.6.1-2) 설정하는 중입니다 ...
apache2-utils (2.4.29-1ubuntu4.6) 설정하는 중입니다 ...
apache2-bin (2.4.29-1ubuntu4.6) 설정하는 중입니다 ...
apache2 (2.4.29-1ubuntu4.6) 설정하는 중입니다 ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.21) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
root@leelab:~#
4. PHP7 설치 및 Mariadb와 연결
sudo apt-get install php libapache2-mod-php php-xml php-gd php-mysql 을 입력해준다.
root@leelab:~# apt-get install php libapache2-mod-php php-xml php-gd php-mysql
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
The following additional packages will be installed:
libapache2-mod-php7.2 php-common php7.2 php7.2-cli php7.2-common php7.2-gd php7.2-json php7.2-mysql
php7.2-opcache php7.2-readline php7.2-xml
제안하는 패키지:
php-pear
다음 새 패키지를 설치할 것입니다:
libapache2-mod-php libapache2-mod-php7.2 php php-common php-gd php-mysql php-xml php7.2 php7.2-cli
php7.2-common php7.2-gd php7.2-json php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml
0개 업그레이드, 16개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
4,121 k바이트 아카이브를 받아야 합니다.
이 작업 후 18.2 M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n]
받기:1 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 php-common all 1:60ubuntu1 [12.1 kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-common amd64 7.2.17-0ubuntu0.18.04.1 [884 kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-json amd64 7.2.17-0ubuntu0.18.04.1 [18.8 kB]
받기:4 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-opcache amd64 7.2.17-0ubuntu0.18.04.1 [165 kB]
받기:5 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-readline amd64 7.2.17-0ubuntu0.18.04.1 [12.2 kB]
받기:6 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-cli amd64 7.2.17-0ubuntu0.18.04.1 [1,406 kB]
받기:7 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libapache2-mod-php7.2 amd64 7.2.17-0ubuntu0.18.04.1 [1,350 kB]
받기:8 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 libapache2-mod-php all 1:7.2+60ubuntu1 [3,212 B]
받기:9 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2 all 7.2.17-0ubuntu0.18.04.1 [9,244 B]
받기:10 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 php all 1:7.2+60ubuntu1 [3,084 B]
받기:11 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-gd amd64 7.2.17-0ubuntu0.18.04.1 [27.2 kB]
받기:12 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 php-gd all 1:7.2+60ubuntu1 [1,996 B]
받기:13 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-mysql amd64 7.2.17-0ubuntu0.18.04.1 [117 kB]
받기:14 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 php-mysql all 1:7.2+60ubuntu1 [2,004 B]
받기:15 http://kr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-xml amd64 7.2.17-0ubuntu0.18.04.1 [108 kB]
받기:16 http://kr.archive.ubuntu.com/ubuntu bionic/universe amd64 php-xml all 1:7.2+60ubuntu1 [2,024 B]
내려받기 4,121 k바이트, 소요시간 1초 (3,951 k바이트/초)
Selecting previously unselected package php-common.
(데이터베이스 읽는중 ...현재 178854개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../00-php-common_1%3a60ubuntu1_all.deb ...
Unpacking php-common (1:60ubuntu1) ...
Selecting previously unselected package php7.2-common.
Preparing to unpack .../01-php7.2-common_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-common (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-json.
Preparing to unpack .../02-php7.2-json_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-json (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-opcache.
Preparing to unpack .../03-php7.2-opcache_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-opcache (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-readline.
Preparing to unpack .../04-php7.2-readline_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-readline (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-cli.
Preparing to unpack .../05-php7.2-cli_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-cli (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php7.2.
Preparing to unpack .../06-libapache2-mod-php7.2_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libapache2-mod-php7.2 (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php.
Preparing to unpack .../07-libapache2-mod-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking libapache2-mod-php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2.
Preparing to unpack .../08-php7.2_7.2.17-0ubuntu0.18.04.1_all.deb ...
Unpacking php7.2 (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php.
Preparing to unpack .../09-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2-gd.
Preparing to unpack .../10-php7.2-gd_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-gd (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php-gd.
Preparing to unpack .../11-php-gd_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-gd (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2-mysql.
Preparing to unpack .../12-php7.2-mysql_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-mysql (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../13-php-mysql_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-mysql (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2-xml.
Preparing to unpack .../14-php7.2-xml_7.2.17-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-xml (7.2.17-0ubuntu0.18.04.1) ...
Selecting previously unselected package php-xml.
Preparing to unpack .../15-php-xml_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-xml (1:7.2+60ubuntu1) ...
php-common (1:60ubuntu1) 설정하는 중입니다 ...
Created symlink /etc/systemd/system/timers.target.wants/phpsessionclean.timer → /lib/systemd/system/phpsessionclean.timer.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
php7.2-common (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/calendar.ini with new version
Creating config file /etc/php/7.2/mods-available/ctype.ini with new version
Creating config file /etc/php/7.2/mods-available/exif.ini with new version
Creating config file /etc/php/7.2/mods-available/fileinfo.ini with new version
Creating config file /etc/php/7.2/mods-available/ftp.ini with new version
Creating config file /etc/php/7.2/mods-available/gettext.ini with new version
Creating config file /etc/php/7.2/mods-available/iconv.ini with new version
Creating config file /etc/php/7.2/mods-available/pdo.ini with new version
Creating config file /etc/php/7.2/mods-available/phar.ini with new version
Creating config file /etc/php/7.2/mods-available/posix.ini with new version
Creating config file /etc/php/7.2/mods-available/shmop.ini with new version
Creating config file /etc/php/7.2/mods-available/sockets.ini with new version
Creating config file /etc/php/7.2/mods-available/sysvmsg.ini with new version
Creating config file /etc/php/7.2/mods-available/sysvsem.ini with new version
Creating config file /etc/php/7.2/mods-available/sysvshm.ini with new version
Creating config file /etc/php/7.2/mods-available/tokenizer.ini with new version
php7.2-readline (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/readline.ini with new version
php7.2-json (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/json.ini with new version
php7.2-opcache (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/opcache.ini with new version
php7.2-mysql (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/mysqlnd.ini with new version
Creating config file /etc/php/7.2/mods-available/mysqli.ini with new version
Creating config file /etc/php/7.2/mods-available/pdo_mysql.ini with new version
php7.2-gd (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/gd.ini with new version
php7.2-xml (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/mods-available/dom.ini with new version
Creating config file /etc/php/7.2/mods-available/simplexml.ini with new version
Creating config file /etc/php/7.2/mods-available/wddx.ini with new version
Creating config file /etc/php/7.2/mods-available/xml.ini with new version
Creating config file /etc/php/7.2/mods-available/xmlreader.ini with new version
Creating config file /etc/php/7.2/mods-available/xmlwriter.ini with new version
Creating config file /etc/php/7.2/mods-available/xsl.ini with new version
php-xml (1:7.2+60ubuntu1) 설정하는 중입니다 ...
php7.2-cli (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
update-alternatives: using /usr/bin/php7.2 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.2 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.2 to provide /usr/bin/phar.phar (phar.phar) in auto mode
Creating config file /etc/php/7.2/cli/php.ini with new version
php-gd (1:7.2+60ubuntu1) 설정하는 중입니다 ...
libapache2-mod-php7.2 (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
Creating config file /etc/php/7.2/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.2
php-mysql (1:7.2+60ubuntu1) 설정하는 중입니다 ...
libapache2-mod-php (1:7.2+60ubuntu1) 설정하는 중입니다 ...
php7.2 (7.2.17-0ubuntu0.18.04.1) 설정하는 중입니다 ...
php (1:7.2+60ubuntu1) 설정하는 중입니다 ...
root@leelab:~#
5. Apache와 Mariadb 적용하기
아파치 웹서버 재시작은 아래 명령을 실행한다.
root@leelab:~# systemctl restart apache2
root@leelab:~# systemctl restart mariadb
root@leelab:~# ps axf
12802 ? Ss 0:00 /usr/sbin/apache2 -k start
12805 ? S 0:00 \_ /usr/sbin/apache2 -k start
12806 ? S 0:00 \_ /usr/sbin/apache2 -k start
12807 ? S 0:00 \_ /usr/sbin/apache2 -k start
12811 ? S 0:00 \_ /usr/sbin/apache2 -k start
12812 ? S 0:00 \_ /usr/sbin/apache2 -k start
12839 ? S 0:00 \_ /usr/sbin/apache2 -k start
12840 ? S 0:00 \_ /usr/sbin/apache2 -k start
12841 ? S 0:00 \_ /usr/sbin/apache2 -k start
15416 ? Ssl 0:00 /usr/sbin/mysqld
6. PHP정보 확인
vi /var/www/html/info.php 를 이용하여 편집기를 연 후 <?php phpinfo(); ?> 를 입력후 저장해준다.
root@leelab:~# vi /var/www/html/info.php
<?php phpinfo(); ?>
http://호스트주소 또는 도메인/info.php 를 통해 현재 서버의 설치된 PHP의 정보를 확인한다.
7. phpmyadmin 설치 및 MySQL과 연결
(1) sudo apt-get install phpmyadmin 을 입력한다.
root@leelab:~# apt-get install phpmyadmin
(2) 설치과정 중 자동으로 구성할 웹 서버를 apache2로 선택해준다.
(3) 설치과정 중 dbconfig-commmon으로 phpmyadmin에 대한 데이터베이스를 구성 하시겠습니까? 라는 물음에 YES 를 선택해준다.
(4) 다음으로 sudo apt-get install php-mbstring php-gettext를 입력한다.
root@leelab:~# apt-get install php-mbstring php-gettext
(5) sudo vi /etc/apache2/apache2.conf 를 통해 편집기를 연 후 맨아래줄에 Include /etc/phpmyadmin/apache.conf 라는구문을 넣어준다.
root@leelab:~# vi /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf
(6) 이제 아파치를 재시작한다.
root@leelab:~# systemctl restart apache2
8. 설치 확인
(1) http://hostaddress 를 통해 아래 사진처럼 나오는지 확인한다.
(2) http://hostaddress/phpmyadmin 를 입력하면 아래처럼 로그인 창이 뜨는데, 이때 ID는 root 이고, Password는 Mariadb설치 과정중 설정했던 패스워드를 입력 해주면 된다.
댓글목록
관리자님의 댓글
관리자 작성일
phpmyadmin 웹페이지 로그인시 아래와 같이 오류가 나타나면
mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'
root@leelab:~# mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 10.1.38-MariaDB-0ubuntu0.18.04.2 Ubuntu 18.04
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 [mysql]> update user set plugin='' where User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [mysql]>
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]>
MariaDB [mysql]> exit
Bye
root@leelab:~#