< 참고사이트 >
http://tdoodle.tistory.com/29
https://kldp.org/node/122815
< Version >
Mysql - 5.6.16
Httpd - 2.4.7
php - 5.5.9
< Mysql - 5.6.16 >
* 먼저 기존의 mysql 패키지가 설치되어 있을 경우 삭제한다.
yum groupinstall "Development Tools" "Development Libraries" -y
# userdel -r mysql 또는 userdel mysql
# mkdir /apm
# wget http://download.softagency.net/MySQL/Downloads/MySQL-5.6/mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz
# tar xvzf mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz
# cd /apm/mysql
< mysql 5.6.17 >
# useradd -M -s /bin/nologin mysql
-->mysql 계정은 mysql DB 운영을 위해서만 필요한 시스템 계정이므로 이런식으로 계정을 생성하는 것이 보안상 안전하며 패스워드도 부여할 필요가 없다.
# useradd -M -s /bin/false mysql
-M : 홈 디렉터리 없이 만드는 옵션
-s : 쉘 미사용 옵션
# yum install -y cmake
* cmake : Cross-Platform Makefile Generaot
< cmake를 이용한 컴파일 >
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/var -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
* Cmake
# make && make install
** 재 컴파일 시 # make clean 후 재 컴파일
<환경설정 파일을 복사>
- mysql에서 사용할 환경 설정 파일을 /etc 디렉터리에 복사
- mysql에서는 사용자의 시스템에 맞게 적절한 샘플파일을 제공한다.
# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
# vi /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
# vi /etc/my.cnf
<mysql 디렉터리 권한 설정>
# chown -R root.mysql /usr/local/mysql --> mysql 디렉터리 권한 주기
# chown -R mysql.mysql /usr/local/mysql/data --> DB 서버가 구동되는 필요한 DB가 있는 디렉터리에 권한 주기
# groupadd mysql
< mysqld 데몬 chkconfig 설정 >
# cp support-files/mysql.server /etc/init.d/mysqld
# vi /etc/init.d/mysqld
basedir=
datadir=
* datadir=/usr/local/mysql/data ( datadir 부분에 mysql data 경로 입력 )
# chmod 755 /etc/init.d/mysqld
# /usr/local/mysql/bin/mysql_secure_installation
# chkconfig --add mysqld
# chkconfig mysqld on
< Database 생성 >
# cd /usr/local/mysql/scripts/
# ./mysql_install_db --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
pid 관련 error 날 경우 권한 설정 다시 한 뒤에 mysqld 데몬 시작
# service mysqld start
< 공유라이브러리 설정 파일에 mysql 라이브러리 경로 추가 ># cat /etc/ld.so.conf
< mysql 접속 시 패스워드 부여 -> 최소한의 보안설정 ># mysqladmin -u root password thwndspt1234
< mysql 접속 ># mysql -u root -p
--> 패스워드를 부여 했다면 항상 다음과 같이 실행해야한다.
Apache 2.4.3
<httpd-2.4.3 설치 소스 컴파일>
# wget http://apache.mirror.cdnetworks.com/httpd/httpd-2.4.12.tar.gz
# wget wget http://mirror.apache-kr.org/apr/apr-1.5.1.tar.gz
# wget http://mirror.apache-kr.org/apr/apr-util-1.5.4.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
//httpd-2.4.x 버전 설치시 apr과 apr-util, pcre을 별도로 설치해주어야 한다.
# tar xvfj apr-1.4.6.tar.bz2
# tar xvfj apr-util-1.4.1.tar.bz2
# tar xvfj httpd-2.4.3.tar.bz2
다운, 압축해제 후 디렉토리 생성 모습.
우선 apr과 apr-util을 설치하자.
복사
# mv apr-1.4.6 httpd-2.4.3/srclib/apr
# mv apr-util-1.4.1 httpd-2.4.3/srclib/apr-util
이제 Pcre를 설치해 보자.
# tar xvfz pcre-8.10.tar.gz
# cd pcre-8.10
# ./configure --enable-static=yes --enable-utf8=yes --enable-unicode-properties=yes
# make && make install
./configure --prefix=/usr/local/apache --enable-modules=all --with-included-apr --enable-mpm=worker --enable-suexec --enable-rewrite --with-pcre=/usr/local/pcre --enable-unique-id --enable-so
pcre 설치가 완료 되었으면
# cd httpd-2.4.3
# ./buildconf
# ./configure --prefix=/usr/local/apache2 --enable-modules=all --with-included-apr --enable-mpm=worker --enable-suexec --enable-rewrite
apache 데몬을 올려보자.
# /usr/local/apache2/bin/apachectl start
==================================================
# yum install -y libicu-dev*
# yum install -y libtermcap-devel
# yum -y install gd gd2 gd-devel gd2-devel wget pcre openssl* perl libaio
# yum -y install –enablerepo=c6-media install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel libtool libtool-libs openldap openldap-devel nss_ldap openldap-clients openldap-servers libtool-ltdl libtool-ltdl-devel bison
# make && make install
# wget https://acelnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
# cd libltdl/
# ./configure --prefix=/usr/local/php \ --with-libdir=lib64 \--with-config-file-path=/usr/local/php/etc \--with-mysql=/home/mysql \--with-mysqli=/home/mysql/bin/mysql_config \--with-apxs2=/usr/local/apache/bin/apxs \--with-pear=/usr/share/php \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--with-libxml-dir=/usr \--enable-xml \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--enable-maintainer-zts \--enable-opcache \--with-curl \--enable-mbregex \--enable-fpm \--enable-mbstring \--with-mcrypt \--with-gd \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-ldap \--with-ldap-sasl \--with-xmlrpc \--enable-zip \--enable-soap \--with-bz2 \--enable-static \--enable-intl \--enable-exif \--with-pdo-mysql=/home/mysql \--with-gettext \--enable-opcache=no \--with-iconv=/usr/lib/
./configure --prefix=/usr/local/php \--with-libdir=lib64 \--with-config-file-path=/usr/local/php/etc \--with-mysql=/usr/local/mysql \--with-mysqli=/usr/local/mysql/bin/mysql_config \--with-apxs2=/usr/local/apache/bin/apxs \--with-pear=/usr/share/php \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--with-libxml-dir=/usr \--enable-xml \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--enable-maintainer-zts \--enable-opcache \--with-curl \--enable-mbregex \--enable-fpm \--enable-mbstring \--with-mcrypt \--with-gd \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-ldap \--with-ldap-sasl \--with-xmlrpc \--enable-zip \--enable-soap \--with-bz2 \--enable-static \--enable-intl \--enable-exif \--with-pdo-mysql=/usr/local/mysql \--with-gettext \--enable-opcache=no \--with-iconv=/usr/local/lib64
# make && make install
# vi /usr/local/apache/htdocs/phpinfo.php
<?phpinfo(); ?>
:wq
http://server_IP/phpinfo.php ----> 확인
=============================================================================
<Zend 설치>
cd /usr/local/src
tar xvfz ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-x86_64
./install
'OS' 카테고리의 다른 글
CentOS Cacti 구축_최신 (0) | 2015.01.21 |
---|---|
APM 설치 ( apache / mysql 5.1.73 / php 5.2.9 (0) | 2015.01.15 |
my.cnf 위치 찾기 (0) | 2015.01.10 |
centos vim 설치 (0) | 2015.01.09 |
my.cnf 위치 확인 (0) | 2015.01.02 |