본문 바로가기

리눅스

[리눅스] apm 서버 설치(install apm server)

반응형

apm 서버 설치(install apm server)

패키지 설치(라이브러리)

yum -y install gd gd-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel \
fontconfig  fontconfig-devel libxml2 libxml2-devel openssl openssl-devel gmp gmp-devel \
mhash mhash-devel libmcrypt libmcrypt-devel
yum -y install cmake ncurses-devel libtool-ltdl expat-devel pcre-devel

MySQL 설치

useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 mysql
wget http://jaist.dl.sourceforge.net/project/mysql.mirror/MySQL%205.6.21/mysql-5.6.21.tar.gz
tar xvfz mysql-5.6.21.tar.gz
cd mysql-5.6.21
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
cd /usr/local/mysql/
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
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
./mysqld_safe &
mysqladmin -u root password 'mysqladminpw1!'

Apache 설치

- APR 설치

- ARP Util 설치

useradd -c "Apache" -u 48 -s /sbin/nologin apache
wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz
wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
tar xvfz httpd-2.4.9.tar.gz
tar xvfz apr-1.5.1.tar.gz -C httpd-2.4.9/srclib/
tar xvfz apr-util-1.5.2.tar.gz -C httpd-2.4.9/srclib/
mv httpd-2.4.9/srclib/apr-1.5.1 httpd-2.4.9/srclib/apr
mv httpd-2.4.9/srclib/apr-util-1.5.2 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
yum -y install libcurl-devel

PHP 설치

cd /usr/local/mysql
ln -s lib lib64
wget http://kr1.php.net/distributions/php-5.6.4.tar.gz
tar xvfz php-5.6.4.tar.gz
cd xvfz php-5.6.4
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/usr/local/mysql/mysql.sock \
--with-libdir=lib64 \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-libexpat-dir=/usr \
--with-libxml-dir=/usr \
--with-zlib-dir=/usr \
--with-gdbm=/usr \
--with-pcre-regex \
--with-openssl=/usr \
--with-mcrypt \
--with-gettext \
--with-curl \
--with-regex=php \
--with-pdo-mysql \
--enable-ftp \
--enable-mbstring \
--with-mcrypt \
--disable-debug \
--with-libexpat-dir=/usr \
--enable-sockets \
--enable-wddx \
--with-freetype-dir=/usr \
--enable-bcmath \
--enable-mbregex \
--enable-exif \
--enable-gd-native-ttf \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-zip \
--enable-dom
cp php.ini-production /usr/local/php/lib/php.ini
ln -s /usr/local/php/lib/php.ini /etc/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 info 페이지

echo "<?php phpinfo() ?>" > /usr/local/apache2/htdocs/phpinfo.php

 

728x90
반응형