centOS 7 최소 설치 후 APM 소스 설치
APM 설치
패키지 업데이트
# yum -y install glibc bash
의존 라이브러리 설치
# yum -y install wget cmake ncurses-devel libtool-ltdl expat-devel db4-devel pcre-devel openssl-devel
[MySQL 설치]
# useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 mysql
# tar xvfz mysql-5.6.23.tar.gz
# cd mysql-5.6.23
# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DSYSCONFDIR=/etc \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
# gmake; gmake install
#chown -R mysql /usr/local/mysql
#chown -R mysql /usr/local/mysql/data
#chgrp -R mysql /usr/local/mysql
설치된 mysql디렉토리에 권한 부여를 해준다.
# cd /usr/local/mysql/
# ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
# pwd
/usr/local/mysql
# mv my.cnf /etc/my.cnf
#vi /etc/my.cnf
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
# ln -s /usr/local/mysql/bin/mysqldump /usr/sbin/mysqldump
# ln -s /usr/local/mysql/bin/mysql_config /usr/sbin/mysql_config
# ln -s /usr/local/mysql/bin/mysqladmin /usr/sbin/mysqladmin
# ln -s /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 24 mysqld off
# service mysqld restart
# mysqladmin -u root password "mysqladminpw1!"
공유 라이브러리 추가
# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
# ldconfig
의존 라이브러리 설치
# yum -y install make gcc gcc-c++ autoconf automake libtool pkgconfig findutils
# yum -y install zlib-devel openldap-devel pcre-devel openssl-devel libxml2-devel
[Apache 설치]
# useradd -c "Apache" -u 48 -s /sbin/nologin apache
# wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
# tar xvfz httpd-2.4.9.tar.gz
[APR 설치]
# wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
# tar xvfz apr-1.5.1.tar.gz
# mv apr-1.5.1 httpd-2.4.9/srclib/apr
[APR-util 설치]
# wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
# tar xvfz apr-util-1.5.4.tar.gz
# mv apr-util-1.5.4 httpd-2.4.9/srclib/apr-util
# cd httpd-2.4.9
# ./configure \
--prefix=/usr/local/apache2 \
--with-pcre \
--with-libxml2 \
--with-ssl \
--with-z \
--with-mpm=worker \
--with-included-apr \
--enable-so \
--enable-rewrite \
--enable-ssl \
--enable-proxy \
--enable-file-cache \
--enable-cache \
--enable-file-cache \
--enable-modules=all \
--enable-mods-shared=all
# make; make install
# ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
# vi /usr/local/apache2/bin/apachectl
# chkconfig: 35 20 80 <--추가
# description: Apache Web Service <--추가
공유 라이브러리 추가
# echo "/usr/local/apache2/modules" >>/etc/ld.so.conf
# ldconfig
의존 라이브러리 설치
# yum -y install libxml2-devel bzip2-devel libcurl-devel gdbm-devel libvpx yum install libvpx-devel libjpeg-turbo-devel libpng-devel libXpm libXpm-devel freetype-devel t1lib t1lib-devel gmp-devel libc-client libc-client-devel pam-devel libicu libicu-devel openldap-devel readline-devel libedit-devel libtidy libtidy-devel libxslt libxslt-devel
# yum -y libexif-devel libmcrypt-devel php-mbstring gd-devel php-mysql
[PHP 설치]
# wget http://kr1.php.net/distributions/php-5.6.4.tar.gz
# cd php-5.6.4
# ./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--enable-mod-charset \
--with-charset=utf8 \
--with-config-file-path=/usr/local/php/lib \
--enable-sigchild \
--with-libxml-dir \
--with-openssl \
--with-zlib \
--with-zlib-dir \
--with-bz2 \
--enable-calendar \
--with-curl --enable-dba \
--with-gdbm \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--enable-gd-native-ttf \
--with-gettext \
--with-imap-ssl \
--with-kerberos \
--enable-mbstring \
--with-mhash \
--with-mcrypt \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--enable-sockets \
--with-regex=php \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx
# make; make install
# cp php.ini-production /usr/local/php/lib/php.ini
# vi /usr/local/apache2/conf/httpd.conf
DirectoryIndex index.html index.php <--추가
AddType application/x-httpd-php .php .html <--추가
AddType application/x-httpd-php-source .phps <--추가
PHP TEST 페이지
# echo "<?php phpinfo() ?>" > /usr/local/apache2/htdocs/phpinfo.php