웹마스터 팁

인터넷 서버 소프트웨어 설치는 서버 장애 발생으로 재설치를 하거나 새로 서버를 도입할 때 처음 하는 작업이므로 아주 드물게 하는 작업입니다. 그래서 전문적으로 관리하는 엔지니어가 아닌 이상 매번 설치할 때마다 오래된 기억을 더듬어 작업하게 되며 항상 경험해본 비슷한 실수로 대체적으로 순조롭게 설치 되지 않는 경우가 허다합니다. 요즘은 배포판이 좋아져서 손쉽게 인터넷 서버 운영이 가능하지만 성능을 높이기 위해 소스 컴파일로 설치 한다거나 배포판에 포함되지 않는 다른 기능들을 추가하기 위해 소스 컴파일로 설치할 경우 귀찮음과 난해함으로 골머리가 아플 수 있습니다. 전문적으로 이런 업무를 하는 분들은 아마도 매뉴얼과 매크로가 준비되어 있어 비교적 손쉽게 처리할 수 있는 일인지 모르지만 그렇지 않은 경우 어렵고 복잡한 문제가 됩니다.

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

웹프로그래머의 홈페이지 정보 블로그 http://hompy.info
제목 글쓴이 날짜
회원 순위 공동순위 표시해서 뽑기(원리만 소개) 라르게덴 2009.02.13
주민등록 입력 폼 1.2.0 [55] file 개돌 2009.04.10
개인쪽지발송!~ noirzo 2009.06.23
까오천사님의 만기일 팁을 1.2.4에 맞게 수정했어요. [15] file 도파 2009.08.27
-추가- 당신의 XE 기반 홈페이지를 훅가게 하는 방법 4가지 [26] 老姜君 2009.10.08
Apache,PHP,MySQL,Zend,OpenSSL,PEAR 설치 메모 [1] 엘카 2009.12.03
최신 댓글 보여주는 기능에 관련해 손정호547 2009.12.11
첨부파일이 용량에 따라 등록되기도 하고 안되기도 할 때 해결방법 (웹호스팅) [1] 꽃들 2010.01.02
APM_Setup 7 사용자중에서 첨부 파일 업로드시 100%에서 사라지는 문제 [2] 레드파카 2010.01.04
간단한 시간제한 자료실 만들기 [2] 옥수수밭 2010.03.17
파일 첨부 에러로 고생하시는 분 [2] celli29 2010.05.11
레이아웃 삽입 후 최근 설문조사 가져오기 ilovesyr 2010.05.18
첨부파일 100% 에서 사라지는 문제 저도 해결 [2] 안나오네 2010.06.09
회원확장정보 변수 (출처:sMaker) [5] 시니시즘 2010.07.19
레이아웃 편집, 게시판 상/하단 내용에 위젯 스타일 적용하기 [2] LutZ 2010.09.12
큐브리드(CUBRID) 초보자 학습 자료 및 유용한 링크 정리 file 면스판 2010.11.09
메인화면에 설문조사 위젯(?) 만들기 [3] file 3D매니아 2010.12.14
자동 스크롤 메뉴 (끄기 기능, 무한 스크롤 X) [6] ☺심심 2004.05.02
textarea 입력받는 글자수 제한하는 스크립트 [5] 오기 2002.01.17
문자열 길이(byte)에 따라 자르기... 행복한고니 2002.10.11