메뉴 건너뛰기

CentOS 7, 최신버전 APM(Apache+PHP+MySQL) 소스설치 및 Openssl 설치하기

 

1. CentOS 7 설치

2. MySQL 소스설치(5.7.13)
3. Openssl 소스설치(1.0.2h)
4. 아파치(Apache) 소스설치(2.4.23)
5. PHP 소스설치(5.6.24)

6. APM+OpenSSL 연동하기

 


1. 소스파일 다운로드

http://dev.mysql.com/downloads/

MySQL Community Server(GPL) Download (5.7.13)

Source Code 선택: mysql-version.tar.gz 과 mysql-boost-version.tar.gz 다운로드 후 압축해제

 

캡처-MySQL소스코드.PNG

 


2. 필수 프로그램, 라이브러리 설치
[root@localhost mysql-5.7.13]# yum -y install gcc*
[root@localhost mysql-5.7.13]# yum -y install ncurses ncurses-devel cmake

 

 

3. MySQL 컴파일, 설치

[root@localhost mysql-5.7.13]# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/home/mysql_data \
-DENABLED_LOCAL_INFILE=1 \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=../boost_1_59_0 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DSYSCONFDIR=/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all

 

[root@localhost mysql-5.7.13]# make && make install

 

 

4. MySQL 기타 환경설정

[root@localhost mysql-5.7.9]# useradd -M mysql -u 27 >& /dev/null
[root@localhost mysql-5.7.9]# chown -R root:mysql /usr/local/mysql
[root@localhost mysql-5.7.9]# cd /usr/local/mysql
[root@localhost mysql]# chmod 700 support-files/mysql.server
[root@localhost mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysql
[root@localhost mysql]# ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc3.d/S97mysql
[root@localhost mysql]# cp support-files/mysql.server /usr/bin/

 

[root@localhost mysql]# vi /etc/my.cnf

[client]
default-character-set = utf8
port = 3306
socket = /tmp/mysql.sock
default-character-set = utf8

[mysqld]
socket=/tmp/mysql.sock
datadir=/home/mysql_data
basedir = /usr/local/mysql
#user = mysql
#bind-address = 0.0.0.0
#
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M

#dns query
skip-name-resolve

#connection
max_connections = 1000
max_connect_errors = 1000
wait_timeout= 60

#slow-queries
#slow_query_log = /home/mysql_data/slow-queries.log
#long_query_time = 3
#log-slow-queries = /free/mysql_data/mysql-slow-queries.log

##timestamp
explicit_defaults_for_timestamp

symbolic-links=0

### log
log-error=/home/mysql_data/mysqld.log
pid-file=/tmp/mysqld.pid

###chracter
character-set-client-handshake=FALSE
init_connect = SET collation_connection = utf8_general_ci
init_connect = SET NAMES utf8
character-set-server = utf8
collation-server = utf8_general_ci

symbolic-links=0

##Password Policy
#validate_password_policy=LOW
#validate_password_policy=MEDIUM

### MyISAM Spectific options
default-storage-engine = myisam
key_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1

### INNODB Spectific options
#default-storage-engine = InnoDB
#skip-innodb
#innodb_additional_mem_pool_size = 16M
#innodb_buffer_pool_size = 1024MB
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_write_io_threads = 8
#innodb_read_io_threads = 8
#innodb_thread_concurrency = 16
#innodb_flush_log_at_trx_commit = 1
#innodb_log_buffer_size = 8M
#innodb_log_file_size = 128M
#innodb_log_files_in_group = 3
#innodb_max_dirty_pages_pct = 90
#innodb_lock_wait_timeout = 120

[mysqldump]
default-character-set = utf8
max_allowed_packet = 16M

[mysql]
no-auto-rehash
default-character-set = utf8

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
 

[root@localhost mysql]# cd /home

[root@localhost home]# mkdir mysql_data

[root@localhost mysql_data]# /usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/home/mysql_data

2016-07-23 23:34:42 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

 

실제 해당 디렉토리에 mysql install 되었는지 확인

[root@localhost ~]# ls -l /home/mysql_data

합계 469064

-rw-r----- 1 mysql mysql 56 2015-11-27 10:02 auto.cnf

-rw------- 1 root root 1675 2015-11-27 10:02 ca-key.pem

-rw------- 1 root root 944 2015-11-27 10:02 ca-req.pem

-rw------- 1 root root 1070 2015-11-27 10:02 ca.pem

-rw------- 1 root root 1078 2015-11-27 10:02 client-cert.pem

-rw------- 1 root root 1679 2015-11-27 10:02 client-key.pem

-rw------- 1 root root 948 2015-11-27 10:02 client-req.pem

-rw-r----- 1 mysql mysql 407 2015-11-27 10:02 ib_buffer_pool

-rw-r----- 1 mysql mysql 134217728 2015-11-27 10:02 ib_logfile0

-rw-r----- 1 mysql mysql 134217728 2015-11-27 10:02 ib_logfile1

-rw-r----- 1 mysql mysql 134217728 2015-11-27 10:02 ib_logfile2

-rw-r----- 1 mysql mysql 77594624 2015-11-27 10:02 ibdata1

drwxr-x--- 2 mysql mysql 4096 2015-11-27 10:02 mysql

-rw-r----- 1 mysql mysql 407 2015-11-27 10:02 mysqld.log

drwxr-x--- 2 mysql mysql 4096 2015-11-27 10:02 performance_schema

-rw------- 1 root root 1078 2015-11-27 10:02 server-cert.pem

-rw------- 1 root root 1675 2015-11-27 10:02 server-key.pem

-rw------- 1 root root 948 2015-11-27 10:02 server-req.pem

drwxr-x--- 2 mysql mysql 12288 2015-11-27 10:02 sys

 

 

5. 설치완료. mysql 시작

[root@localhost ~]# mysql.server start

Starting MySQL. SUCCESS!

 

 

6. mysql root user 패스워드 설정

mysql root 접속을 위해서 패스워드가 필요 ( 데이터베이스 생성시 자동으로 암호가 지정된다 )

[root@localhost ~]# cat /root/.mysql_secret

# Password set for user 'root@localhost' at 2015-11-27 09:51:39

GGWBtXdowyXN

 

기록된 패스워드를 가지고 mysql 접속을 진행. 접속 후 환경설정을 확인하려면 에레메시지가 발생

You must reset your password using ALTER USER statement before executing this statement.S

root 패스워드를 변경

 

[root@localhost mysql_data]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.13

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

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> \s
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '변경할패스워드';
Query OK, 0 rows affected (0.00 sec)

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

mysql> quit
Bye

 

[root@localhost mysql_data]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.13 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

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> \s
--------------
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.13, for Linux (x86_64) using  EditLine wrapper

Connection id:          5
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.13 Source distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /tmp/mysql.sock
Uptime:                 2 min 1 sec

Threads: 1  Questions: 10  Slow queries: 0  Opens: 114  Flush tables: 1  Open tables: 39  Queries per second avg: 0.082
--------------

mysql> quit
Bye

 

 

이제 환경에 맞게 my.cnf 를 변경하면서 운용

 

 

참고자료: http://xinet.kr/?p=991

참고자료: http://dev.mysql.com/doc/refman/5.7/en/installing-source-distribution.html

번호 제목 글쓴이 날짜 조회 수
34 git, github 사용하기. vscode에서 github 연동하기(2023.02.09) file 관리자 2023.02.08 1298
33 록키리눅스(Rocky Linux) 네트워크 설정하기 - nmcli, nmtui file 관리자 2023.02.01 35627
32 CentOS 종료 대비, 록키 리눅스(Rocky Linux) 설치하기 file 관리자 2023.01.27 1360
31 플래시 설치파일 file 관리자 2021.01.13 356
30 tar 압축하면서 다른 디렉토리에 풀기 file 관리자 2020.11.14 475
29 리눅스 하드디스크 추가 관리자 2019.02.12 1431
28 [MySQL]ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 관리자 2018.12.23 1295
27 [리눅스]phpinfo() 실행 시 하얀 화면이 나타날 경우 대처방법 file 관리자 2018.12.13 3703
26 [리눅스]rsync 설정 후, crontab 스케줄 등록 관리자 2018.08.28 2740
25 [리눅스][XE]백업복구(서버이관) 시 오류-03.사이트 메뉴 편집, 사이트 디자인 설정 출력 안되는 현상 file 관리자 2018.08.27 11124
24 [리눅스][XE]백업복구(서버이관) 시 오류-02.아파치 rewrite에러 file 관리자 2018.08.27 516
23 [리눅스][XE]백업복구(서버이관) 시 오류-01.No matching DirectoryIndex (index.html) fonud 오류 file 관리자 2018.08.27 1461
22 [리눅스][XE][오류]msg_is_not_administrator file 관리자 2018.08.08 1242
21 [리눅스]CentOS에서 하드디스크 추가 관리자 2018.03.21 8843
20 [리눅스]리눅스 파일 압축 암호 설정 및 해제(ZIP) 관리자 2017.07.30 18083
19 [리눅스]CentOS 7,최신 APM 소스설치-5) PHP, gd library jpeg support file 관리자 2017.02.21 1853
18 [리눅스]CentOS 7 root password 분실 file 관리자 2016.12.27 6353
17 [리눅스]vsftpd ftp 파일전송오류(451 Failure writing to local file) 관리자 2016.12.20 4117
16 [리눅스]APM(apache+php+mysql) 다른서버로 이관하기(백업-복구하기) 관리자 2016.09.12 4673
15 [리눅스]XE(XpressEngine)설정 file 관리자 2016.07.26 684