Linux/CentOS2012. 4. 9. 19:17

yum -y install gcc cpp gcc-c++ compat-gcc-34-g77 flex openssl*
yum -y install libjpeg-devel libpng-devel freetype-devel gd-devel libtermcap-devel ncurses-devel libxml2-devel libc-client-devel bzip2-devel
#yum -y install libtermcap-devel [MYSQL컴파일에_적용]
#yum -y install ncurses-devel
#yum -y install libxml2-devel [PHP컴파일에_적용]
#yum -y install openssl*
#yum -y install libc-client-devel
#yum -y install bzip2-devel
rpm -qa gcc* cpp* compat-gcc* flex* openssl*
rpm -qa libjpeg* libpng* freetype* gd-*

reboot [패키지_변경시_리부팅_필요]

cd /usr/local/src
wget ftp://ftp.neowiz.com/pub/mysql/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz
tar xvzf mysql-5.0.67.tar.gz
wget ftp://ftp.neowiz.com/pub/apache/httpd/httpd-2.2.10.tar.gz
tar xvzf httpd-2.2.10.tar.gz
wget ftp://ftp.neowiz.com/pub/languages/php/php-5.2.6.tar.gz
tar xvzf php-5.2.6.tar.gz
useradd -M -s /bin/false mysql
cd /usr/local/src/mysql-5.0.67
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all
make && make install
ll /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R root.mysql /usr/local/mysql
chown -R mysql /usr/local/mysql/var
vi /etc/skel/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
source ~/.bash_profile
cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
service mysqld start

cd /usr/local/src/httpd-2.2.10
vi /usr/local/src/httpd-2.2.10/server/mpm/prefork/prefork.c
# define DEFAULT_SERVER_LIMIT 2048
vi /usr/local/src/httpd-2.2.10/server/mpm/worker/worker.c
# define DEFAULT_SERVER_LIMIT 512
# define DEFAULT_THREAD_LIMIT 2048
./configure --prefix=/usr/local/apache --enable-mods-shared=all --enable-so --enable-ssl --enable-modules=ssl --enable-rewrite --with-mpm=prefork

make && make install
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
vi /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
chkconfig --list httpd
service httpd start

cd /usr/local/src/php-5.2.6

./configure --with-config-file-path=/etc --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --disable-debug --enable-safe-mode --enable-sockets --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib --with-jpeg-dir --with-png-dir --with-freetype-dir --with-libxml-dir --enable-exif --with-gd --with-ttf --with-gettext --enable-sigchild --enable-mbstring --with-openssl --with-imap --with-imap-ssl --with-kerberos

./configure \
--with-config-file-path=/etc \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--disable-debug \
--enable-safe-mode \
--enable-sockets \
--enable-sysvsem=yes \
--enable-sysvshm=yes \
--enable-ftp \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-bcmath \
--with-zlib \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-libxml-dir \
--enable-exif \
--with-gd \
--with-ttf \
--with-gettext \
--enable-sigchild \
--enable-mbstring \
--with-openssl \
--with-imap \
--with-imap-ssl \
--with-kerberos

make && make install
cp /usr/local/src/php-5.2.6/php.ini-dist /etc/php.ini
vi /usr/local/apache/conf/httpd.conf
User apache
Group apache

ServerName www.hompy.info:80
DocumentRoot "/usr/local/apache/htdocs"

LoadModule ssl_module modules/mod_ssl.so

<IfModule dir_module>
     DirectoryIndex index.html index.htm index.php
</IfModule>

<IfModule mime_module>
     AddType application/x-httpd-php .php .html
     AddType application/x-httpd-php-source .phps
</IfModule>

Include conf/extra/httpd-mpm.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-ssl.conf

service httpd restart
rm /usr/local/apache/htdocs/index.html
echo '<?php phpinfo() ?>' > /usr/local/apache/htdocs/index.php

cd /usr/local/src
tar xvzf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install.sh
# rm /etc/php.ini
# ln -s /usr/local/Zend/etc/php.ini /etc/php.ini

/usr/local/php/bin/pear upgrade-all
/usr/local/php/bin/pear install DB File Mail Mail_Mime
/usr/local/php/bin/pear install MDB2 MDB2_Driver_mysql MDB2_Driver_mysqli
/usr/local/php/bin/pear install HTTP_Request XML_RPC

vi /etc/skel/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/php/bin
vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/php/bin
source ~/.bash_profile

/usr/local/apache/conf/httpd.conf
#Include conf/extra/httpd-ssl.conf

mkdir /usr/local/apache/conf/ssl
cat > /usr/local/apache/conf/ssl/auto.sh
#!/bin/sh
echo "password"
^D
chmod 700 /usr/local/apache/conf/ssl/auto.sh

vi /usr/local/apache/conf/extra/httpd-ssl.conf

#SSLPassPhraseDialog  builtin
SSLPassPhraseDialog  exec:/usr/local/apache/conf/ssl/auto.sh

DocumentRoot "/usr/local/apache/htdocs"
ServerName www.hompy.info:443
ServerAdmin you@hompy.info

SSLCertificateFile /usr/local/apache/conf/ssl/server.crt

SSLCertificateKeyFile /usr/local/apache/conf/ssl/server.key

SSLCertificateChainFile /usr/local/apache/conf/ssl/server-ca.crt

service httpd restart

 

 

그래서 우리의 전문분야는 아니지만 비교적 무난하게 소스 컴파일로 웹 서버와 데이타베이스 서버를 설치하는 데 참고가 될만한 동영상을 준비했습니다. 나름대로의 설치 시나리오를 가지고 진행 과정을 동영상으로 담은 것입니다. 리눅스 배포판 CentOS 5.2 가 설치된 컴퓨터에 Apache, PHP, MySQL 시리즈 APM과 Zend 설치 그리고 요즘 개인정보 보호를 위해 한국정보보호진흥원에서 설치하도록 명시하고 있는 보안서버 적용을 위한 OpenSSL 모듈을 설치하고 셋팅하는 장면입니다.

여러가지 가능성이 고려되지 않은 동영상이므로 관련 기술 문서도 함께 참고하세요.
Apache,PHP,MySQL,Zend,OpenSSL 설치 동영상  - http://hompy.info/527

'Linux > CentOS' 카테고리의 다른 글

php 5.4.0에서 5.3.10으로 다운그레이드  (0) 2012.04.10
php.ini 설정법  (0) 2012.04.10
Gmail for CentOS  (0) 2012.04.03
DNS 설정  (0) 2012.03.30
CentOS에서 rpm 데이터베이스 문제로 yum을 사용할 수 없을때  (0) 2012.03.09
Posted by iWithJoy