2 분 소요

AMP 또는 APM은 Apache, PHP 및 MySQL 툴킷을 가리키는 표현으로, 솔라리스에서는 AMP라는 패키지 그룹으로 Pre-Build 되어 있습니다.
솔라리스에서는 앞서 나열한 3가지의 패키지와 관련된 모든 관련 패키지를 레포지토리에서 자동으로 설치하는 것이 가능하며, 아래는 Solaris 11.4에서 pkg명령을 통하여 AMP를 설치하는 방법을 소개합니다.

아래는 AMP의 설치에 필요한 패키지 목록 입니다. 먼저 필요 패키지들을 설치합니다.

pkg install system/library/gcc-3-runtime
pkg install developer/library/lint
pkg install developer/gcc-3
pkg install text/gnu-grep
pkg install developer/macro/gnu-m4
pkg install developer/build/gnu-make
pkg install system/library/security/libgcrypt
pkg install library/gnutls
pkg install security/kerberos-5/kdc
pkg install system/library/security/rpcsec
pkg install developer/build/make
pkg install developer/linker
pkg install system/header
pkg install developer/object-file
pkg install developer/library/profiled-libc
pkg install compatibility/ucb
pkg install compatibility/ucb
pkg install library/libxslt
pkg install library/gnutls
pkg install library/security/openssl
pkg install library/pcre

AMP 그룹 설치

pkg install group/feature/amp

Apache의 자동실행 활성화

svcadm -v enable /network/http:apache24

Apache가 정상적으로 실행되었는지 확인합니다.

# svcs http
STATE          STIME             FMRI
online         23:53:22          svc:/network/http:apache24

MySQL의 데이터파일을 안전하고 효율적으로 관리하기 위해, 별도의 파일시스템을 생성합니다.

zfs create rpool/mysql
zfs set mountpoint=/mysql rpool/mysql
chown -R mysql:mysql /mysql/
chmod -R 700 /mysql
zfs set compress=on rpool/mysql

MySQL 데이터를 생성할 타겟 디렉토리를 변경합니다.

svccfg -s mysql:version_57 setprop mysql/data=/mysql
svcadm refresh mysql:version_57

MySQL의 자동실행 활성화 및 실행

svcadm -v enable /application/database/mysql:version_57

MySQL이 정상적으로 실행되었는지 확인 합니다.

# svcs mysql
STATE          STIME             FMRI
online         00:05:06          svc:/application/database/mysql:version_57

MySQL 패스워드 변경

Solaris 11.4부터 pkg명령으로 MySQL을 설치하면 어째서인지 root 패스워드가 기본으로 설정되어 있어 로그인 할 수 없는 문제가 있습니다.
아래의 방법으로 MySQL의 root패스워드를 강제로 변경하도록 합니다.

MySQL서비스를 정지시키고, my.cnf에 skip-grant-tables를 추가하여, 권한을 확인하지 않고 로그인 가능하도록 설정

# svcadm disable mysql
# vim /etc/mysql/5.7/my.cnf
[mysqld]
skip-grant-tables

MySQL에 로그인하여 root 패스워드를 변경

# svcadm enable mysql
# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> UPDATE user SET authentication_string=password('새로운 패스워드') WHERE user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

my.cnf에서 skip-grant-tables 옵션을 삭제

# svcadm disable mysql
# vim /etc/mysql/5.7/my.cnf
[mysqld]
skip-grant-tables # <---- 삭제

MySQL을 정상구동 후, MySQL의 정상접속을 확인

# svadm enable mysql
# mysql -u root -p'새로운 패스워드'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.35

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> \q
Bye

AMP의 구축 작업이 완료 되었습니다.
이제 VirtualHost를 설정하고, 필요한 웹어플리케이션을 업로드하여 서비스를 구축할 수 있습니다.

카테고리: ,

업데이트:

댓글남기기