RadarURL

유닉스/리눅스
2014.05.22 18:58

sulinux 2.0 + APM + Zend + eaccelerator + nginx + mrtg

조회 수 1386 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

# 아래 작업에 대한 책임은 전적으로 본인에게 있습니다.

# nginx 는 정적서비스용입니다.

# mrtg 는 테스트가 필요합니다.

# Zend 는 php 5.2 버젼에 적용됩니다. 5.3는 아직 지원되지 않습니다.

# eaccelerator 에 대한 부분은 본인 필요에 따라 설치바랍니다.

# 기타 라이브러리는 본인이 설치해야 합니다.





#sulinux 2.0 설치후 작업
#sulinux 2.0 + APM + Zend + eaccelerator + nginx + mrtg

#시간 맞춤
rdate -s time.bora.net && /sbin/clock -w
ntpdate -b -s time.kriss.re.kr && /sbin/clock -w

crontab -e
*/30 * * * * rdate -s time.bora.net && /sbin/clock -w
*/30 * * * * ntpdate -b -s time.kriss.re.kr && /sbin/clock -w
/etc/init.d/crond restart

#yum 전체 업데이트
yum update -y

#한글 처리 UTF-8 -> EUC-KR
vi /etc/sysconfig/i18n
LANG="ko_KR.EUC-KR"
SUPPORTED="ko_KR.UTF-8:ko_KR:ko"
SYSFONT="latarcyrheb-sun16"

#APM 설치 Apache_2.2.16 + PHP_5.2.14 + MySQL_5.1.51
/root/bin/apmtools

#젠드설치
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
tar xvfz ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install.sh
cd ..
rm -Rf ZendOptimizer-3.3.3-linux-glibc23-i386*

#eaccelerator 설치
wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2
tar xvfj eaccelerator-0.9.6-rc1.tar.bz2
cd eaccelerator-0.9.6-rc1
export PHP_PREFIX="/usr/local/php/"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install

#아래는 확인해둘것 extension_dir= 에 입력
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
chown nobody:nobody /tmp/eaccelerator

vi /usr/local/php/lib/php.ini
#[Zend] ;반드시 Zend 전에 입력
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
extension="eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path="/usr/local/apache/htdocs"

/etc/init.d/httpd restart

#모듈 설치 확인
php -v
PHP 5.2.2 (cli) (built: Mar 29 2010 18:45:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-rc1, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

#관리자 페이지 설정
vi control.php
$auth = true;
$user = "admin";
$pw = "tnghkrl";

cp control.php /usr/local/apache/htdocs/control.php

#설치파일 삭제
cd ..
rm -Rf eaccelerator-0.9.6-rc1*

#아파치 재실행
/etc/init.d/httpd restart

#nginx 설치
wget http://nginx.org/download/nginx-0.8.54.tar.gz
tar xvzf nginx-0.8.54.tar.gz
cd nginx-0.8.54
./configure --pid-path=/usr/local/nginx/logs/nginx.pid --sbin-path=/usr/local/sbin/nginx --with-md5=/usr/lib --with-sha1=/usr/lib --with-http_ssl_module --with-http_dav_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module
make
make install

vi /etc/rc.d/init.d/nginx

#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /var/run/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/local/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"


lockfile=/var/lock/subsys/nginx

start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
$nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}

stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}

restart() {
configtest || return $?
stop
start
}

reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}

force_reload() {
restart
}

configtest() {
$nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
status $prog
}

rh_status_q() {
rh_status >/dev/null 2>&1
}

case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac

chmod 750 /etc/rc.d/init.d/nginx

vi /usr/local/nginx/conf/nginx.conf

#CPU코어 갯수 * CPU 갯수
worker_processes 1;

#max_clients = worker_processes * worker_connections
events {
worker_connections 1024;
}

# keepalive 설정
http {
...

keepalive_timeout 5 5;
keepalive_requests 5;

...

#서비스 포터 설정
server {

...

listen 5135;
server_name localhost;

location / {

root /usr/local/apache/htdocs;

index index.html index.htm, index.php;

expires 24h;

}

...

}
}

#이미지 서비스용 포트
setup -> 방화벽 설정 -> 사용자설정 -> 그외의 포트 -> 5135:tcp

/etc/init.d/iptables restart

cd ..
rm -Rf nginx-0.8.54*

#cacti 설치
wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
tar xvzf cacti-0.8.7g.tar.gz
cd cacti-0.8.7g




#mrtg
yum install net-snmp

vi /etc/snmp/snmpd.conf
com2sec network 192.168.163.135 public

group notConfigGroup v2c notConfigUser
group rwgroup v1 local
group rwgroup v2c local
group rwgroup v1 network
group rwgroup v2c network

view all included .1 80
view systemview included system
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

access rwgroup "" any noauth exact all all all
access rogroup "" any noauth exact systemview none none

/etc/init.d/snmpd restart

wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.17.0.tar.gz
tar xvzf mrtg-2.17.0.tar.gz
cd mrtg-2.17.0
./configure --prefix=/usr/local/mrtg/
make && make install

vi /root/mrtg.sh
#!/bin/sh
/usr/bin/cfgmaker --global 'WorkDir: /usr/local/apache/htdocs/' --global 'Language: korean' --global 'Options[_]: bits,growright' -output /usr/local/apache/htdocs/mrtg.cfg public@192.168.163.135
/usr/bin/indexmaker --title "mrtg.kantukan.co.kr" --output /usr/local/apache/htdocs/index.htm /usr/local/apache/htdocs/mrtg.cfg
/usr/bin/mrtg /usr/local/apache/htdocs/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
chmod 700 mrtg.sh

*/5 * * * * su - root -c '/home/mrtg/public_html/mrtg.sh' >& mrtg.log


출처 : http://lcm790203.blogspot.kr/2011/01/sulinux-20-apm-zend-eaccelerator-nginx.html

?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 928144
» 유닉스/리눅스 sulinux 2.0 + APM + Zend + eaccelerator + nginx + mrtg JaeSoo 2014.05.22 1386
11 웹서버,WAS 504 Gateway Time-out using Nginx JaeSoo 2014.04.09 2032
10 웹서버,WAS Nginx, FastCGI 지시어 및 설명 (504 Gateway Time-out 관련 설정 등) JaeSoo 2014.04.09 2184
9 웹서버,WAS Nginx Log에서 upstream timed out (110: Connection timed out) while reading response header from upstream JaeSoo 2014.04.08 3403
8 웹서버,WAS nginx 504 gateway time-out JaeSoo 2014.04.08 1777
7 웹서버,WAS Nginx SERverSETting JaeSoo 2014.04.07 1699
6 웹서버,WAS Nginx에서 php 외에 추가로 여러 확장자를 처리 방법 JaeSoo 2013.06.11 4875
5 웹서버,WAS Nginx 설치 (간략) JaeSoo 2013.06.11 5006
4 웹서버,WAS Apache vs Nginx 성능을 밝혀라! file JaeSoo 2013.05.28 5992
3 웹서버,WAS 아파치 2.4는 러시안 강호 NGINX를 넘을 수 있는가? file JaeSoo 2013.05.28 4428
2 웹 프로그래밍 apache용 ewrite rule (htaccess)을 nginx rewrite rule로 변환 JaeSoo 2013.04.06 4798
1 웹 프로그래밍 강력한 웹서버 NGINX JaeSoo 2012.11.20 5067
Board Pagination Prev 1 Next
/ 1


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너