dev-os

[CentOS] APM Source Compile

검은바람 2013. 6. 26. 12:12
반응형

MySQL

yum install zlib curl
yum install gcc g++ cpp gcc-c++
yum install openssl openssl-devel
yum install libtermcap-devel ncurses-devel libc-client-devel bzip2-devel
yum install bison
groupadd mysql
useradd -g mysql mysql
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql/data  -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.socket  
make
make install
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
cp support-files/my-medium.cnf  /etc/my.cnf <---/etc/mysql/my.cnf 일 수도 있다.
cp support-files/mysql.server /etc/init.d/mysqld

vi /etc/init.d/mysqld

--------------------------------------
datadir=/usr/local/mysql/data              <---DB디렉토리 지정 하고 저장
---------------------------------------

# mysql 구동 (시작)  또는 /usr/local/server/mysql/bin/mysqld_safe &
/etc/init.d/mysqld start
chkconfig --add mysqld
/usr/local/mysql/bin/mysqladmin -uroot password 신규비밀번호

---------------------------------------

# vim /etc/rc.local

### MYSQL START ###

if [ -f /etc/rc.d/init.d/mysqld ]; then

        /etc/rc.d/init.d/mysqld start

fi

OR

# ntsysv  <--- mysql 선택 후 확인 

---------------------------------------

 

mysql user 추가

grant all privileges on `dbuser_%`.* to dbuser@localhost identified by 'password' with grant option;

 

 

 

Apache

apr

#cd /usr/local/src

#wget http://mirror.apache-kr.org/apr/apr-1.4.6.tar.gz 

#chmod 755 ./apr-1.4.6.tar.gz

#tar -zvxf ./apr-1.4.6.tar.gz

#cd apr-1.4.6

#./configure

#make

#make install

apr-util

#cd /usr/local/src

#wget http://mirror.apache-kr.org/apr/apr-util-1.5.1.tar.gz 

#chmod 755 ./apr-util-1.5.1.tar.gz

#tar -zvxf ./apr-util-1.5.1.tar.gz

#cd apr-util-1.5.1

#./configure --with-apr=/usr/local/apr

#make

#make install

pcre

#cd /usr/local/src

#wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz

#chmod 755 ./pcre-8.32.tar.gz

#tar -zvxf ./pcre-8.32.tar.gz

#cd pcre-8.32

#./configure --prefix=/usr/local/pcre

#make

#make install

apache

#cd /usr/local/src

#wget http://mirror.apache-kr.org/httpd/httpd-2.4.3.tar.gz 

#chmod 755 ./httpd-2.4.3.tar.gz

#tar -zvxf ./httpd-2.4.3.tar.gz

#cd httpd-2.4.3

#./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --enable-rewrite=shared --enable-expires=shared --enable-headers=shared --enable-so --with-pcre=/usr/local/pcre

#make

#make install

#cp /usr/local/apache/bin/apachectl /etc/init.d/httpd

#vim /etc/init.d/httpd 

    # chkconfig: 2345 90 90

    # description: init file for Apache server daemon

    # processname: /usr/local/apache/bin/apachectl

    # config: /usr/local/apache/conf/httpd.conf

    # pidfile: /usr/local/apache/logs/httpd.pid

# chkconfig --add httpd

#vim /usr/local/apache/conf/httpd.conf

<Directory />
    Options FollowSymLinks
    #AllowOverride None

    AllowOverride All <-- 위줄 주석처리 후 추가

    Order deny,allow
    #Deny from all
    Allow from all <-- 위줄 주석처리 후 추가
</Directory> 

 

PHP

#yum install gd gd-devel

#yum install libpng libpng-devel

#yum install libjpeg libjpeg-devel

#yum install freetype freetype-devel

#yum install fontconfig fontconfig-devel

#yum install libxml2 libxml2-devel

#yum install openssl openssl-devel

#yum install gmp gmp-devel

#yum install libtool libtool-ltdl-devel

#yum install libmcrypt libmcrypt-devel 

#cd /usr/local/src

#wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz

#chmod 755 ./libmcrypt-2.5.7.tar.gz

#tar -zvxf ./libmcrypt-2.5.7.tar.gz

#cd libmcrypt-2.5.7

#./configure --prefix=/usr/local

#make

#make install

php

#cd /usr/local/src

#wget http://kr.php.net/get/php-5.3.10.tar.gz/from/this/mirror

#chmod 755 ./php-5.3.10.tar.gz

#tar -zvxf ./php-5.3.10.tar.gz

#cd php-5.3.10

#./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \

--with-mssql=/usr/local/freetds \
--with-config-file-path=/usr/local/apache/conf \
--disable-debug \
--enable-sockets \
--enable-mod_charset \
--enable-sysvsem=yes \
--enable-sysvshm=yes \
--enable-ftp \
--enable-magic-quotes \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-bcmath \
--with-zlib \
--with-jpeg-dir=/usr \
--with-png-dir=/usr/lib \
--with-freetype-dir=/usr \
--with-libxml-dir=/usr \
--enable-exif \
--with-gd \
--with-freetype-dir \
--with-gettext \
--enable-sigchild \
--enable-mbstring \
--with-mcrypt=/usr/local \

--enable-safe-mode \ <-- 필요할 경우에만 추가하자

--enable-maintainer-zts <-- 아파치 2.4.2부터 멀티스레드 MPM지원 안되서 추가됨. 

#make

#make install

#cp php.ini-recommended /usr/local/apache/conf/php.ini

#cd /usr/local/apache/conf

#vim php.ini

line 226 short_open_tag = Off => short_open_tag = On 

#vim httpd.conf 

 

AddType application/x-httpd-php .php 
AddType application/x-httpd-php-source .phps  

#vim /etc/rc.local

### APACHE START ###
if [ -f /etc/init.d/httpd ]; then
        /etc/init.d/httpd start
fi 

반응형