리눅스용 APM 설치
앞선 첫 번째 강좌에서 윈도우에 웹서버를 설치해 보았습니다.
이번 강좌에는 리눅스에 APM을 설치하는 법을 배워보겠습니다.
Ubuntu에 APM 설치
Ubuntu 18.04 기준으로 설치를 해보겠습니다. 다른 버전도 이와 같거나 거의 유사한 방법으로 설치가 가능합니다.
$ sudo apt install apache2 mysql-server php7.2 php7.2-mysql
MySQL 초기 설정
MySQL 초기 설정을 진행합니다. 암호 규칙이라던지 MySQL 관리자 계정 root (시스템 root와 다른)의 패스워드를 설정하고 anonymous 사용자를 제거 하는 등의 설정을 합니다.
$ sudo mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: y [y 입력]
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: [1 또는 2 입력]
Please set the password for root here.
New password: [암호 입력]
Re-enter new password: [암호 입력]
Estimated strength of the password: 50
Do you wish to continue with the password provided?
(Press y|Y for Yes, any other key for No) : y [y 입력]
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : y [y 입력]
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? (Press y|Y for Yes, any other key for No) : y [y 입력]
Success.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : y [y 입력]
- 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? (Press y|Y for Yes, any other key for No) : y [y 입력]
Success.
All done!
설치 확인
Apache, PHP, MySQL 모두 잘 설치되었는지 확인을 해보겠습니다.
$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2019-07-16T18:14:45
$ mysqld --version
mysqld Ver 5.7.27-0ubuntu0.18.04.1 for Linux on x86_64 ((Ubuntu))
$ php -v
PHP 7.2.19-0ubuntu0.18.04.2 (cli) (built: Aug 12 2019 19:34:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.19-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies
웹서버 시작/중지/재시작
$ sudo /etc/init.d/apache2 start
[ ok ] Starting apache2 (via systemctl): apache2.service.
$ sudo /etc/init.d/apache2 stop
[ ok ] Stopping apache2 (via systemctl): apache2.service.
$ sudo /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.