RadarURL

유닉스/리눅스
2014.05.22 18:58

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

조회 수 1385 추천 수 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 927827
1786 유닉스/리눅스 CentOS Network 설정 file JaeSoo 2014.05.26 1155
1785 업무 Reseller(리셀러), Distributor(디스트리뷰터), Vender(벤더), Dealer(딜러) 차이 JaeSoo 2014.05.23 1570
1784 유닉스/리눅스 RHEL 6.5 에서 bmc-watchdog[xxxx]: Log 가 발생되면서 rebooting 되는 문제 JaeSoo 2014.05.22 1692
1783 유닉스/리눅스 RHEL5, 6 Ctrl + Alt + Del 키 막기 file JaeSoo 2014.05.22 1235
1782 유닉스/리눅스 Linux YUM 을 이용하여 보안 업데이트를 진행해 보자 JaeSoo 2014.05.22 1264
1781 유닉스/리눅스 Red Hat RHN 등록이 왜? 안될까? ( RHN connection refused ) JaeSoo 2014.05.22 1125
1780 유닉스/리눅스 RHEL 6.5 Release… JaeSoo 2014.05.22 11671
» 유닉스/리눅스 sulinux 2.0 + APM + Zend + eaccelerator + nginx + mrtg JaeSoo 2014.05.22 1385
1778 유닉스/리눅스 SULinux 2.0 GUI 버전 - GUI가 편하긴 하구나... file JaeSoo 2014.05.22 1525
1777 유닉스/리눅스 sulinux APMtools 설치 위치 정리 file JaeSoo 2014.05.22 1513
1776 유닉스/리눅스 howto: RHEL6 x86_64 + APM + mediawiki + CKEditor + IPA(LDAP) file JaeSoo 2014.05.22 1882
1775 유닉스/리눅스 RedHat 계정 만들기 ( 평가용 서브스크립션 다운로드 ) JaeSoo 2014.05.22 1274
1774 웹 프로그래밍 php 웹사이트에서 파일을 업로드 하는중 100%에서 멈춰버리는 현상 해결 JaeSoo 2014.05.16 2609
1773 응용 프로그래밍 개발자&웹퍼블리셔 운영서버 배포관리는 어떻게 하시고 계신가요? file JaeSoo 2014.05.15 1287
1772 모바일 스마트폰 CPU 성능 비교 및 분석 [엑시노스,스냅드래곤,Omap(오맵),테그라] - 리뉴얼 file JaeSoo 2014.05.15 1726
1771 응용 프로그래밍 버전관리 - 형상관리, 소스세이프, CVS, Subversion(SVN), GIT, mercurial(hg), Perforce JaeSoo 2014.05.15 1755
1770 응용 프로그래밍 빌드를 자동화하라 (Automate the Build) JaeSoo 2014.05.15 1129
1769 응용 프로그래밍 단일화된 소스 저장소를 유지하라. (Maintain a Single Source Repository.) JaeSoo 2014.05.15 1417
1768 응용 프로그래밍 지속적인 통합으로 피처요구사항 빌드하기 (Building a Feature with Continuous Integration) JaeSoo 2014.05.15 1310
1767 응용 프로그래밍 지속적인 통합 (Continuous Integration) file JaeSoo 2014.05.15 1176
Board Pagination Prev 1 ... 30 31 32 33 34 35 36 37 38 39 ... 124 Next
/ 124


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

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

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

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

JServer.kr

제이서버 메타블로그

재수 티스토리


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

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너