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

?

공부 게시판

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

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views928129
    read more
  2. [U2L] Unix to Linux 기대효과 분석

    Date2023.05.16 Category유닉스/리눅스 ByJaeSoo Views1259
    Read More
  3. 리눅스 inodes full 이슈 해결 방법

    Date2023.05.02 Category유닉스/리눅스 ByJaeSoo Views169
    Read More
  4. inode full

    Date2023.05.01 Category유닉스/리눅스 ByJaeSoo Views115
    Read More
  5. 마이크로서비스 아키텍처(MSA) 개념 소개

    Date2023.01.26 Category유닉스/리눅스 ByJaeSoo Views170
    Read More
  6. 리눅스(Linux) 디렉토리 구조

    Date2016.10.20 Category유닉스/리눅스 ByJaeSoo Views693
    Read More
  7. ssh서버가 비밀번호를 거부했습니다. 다시 시도하십시오.

    Date2016.08.23 Category유닉스/리눅스 ByJaeSoo Views302
    Read More
  8. [리눅스] IP 설정 변경 하기

    Date2016.08.23 Category유닉스/리눅스 ByJaeSoo Views326
    Read More
  9. 리눅스 설치후 초기설정해야 할 것들 [2]

    Date2016.07.13 Category유닉스/리눅스 ByJaeSoo Views400
    Read More
  10. 리눅스 설치후 초기설정해야 할 것들 [1]

    Date2016.07.13 Category유닉스/리눅스 ByJaeSoo Views360
    Read More
  11. 쉘 프로그래밍을 이용한 시스템 관리 기법

    Date2016.05.12 Category유닉스/리눅스 ByJaeSoo Views679
    Read More
  12. AIX 자주 쓰이는 관리 명령 모음

    Date2016.05.12 Category유닉스/리눅스 ByJaeSoo Views615
    Read More
  13. AIX 시스템상의 core, SMT(Simultaneous Multi Threading) 수 확인하기

    Date2016.05.12 Category유닉스/리눅스 ByJaeSoo Views695
    Read More
  14. 리눅스 호스트명 변경

    Date2016.05.11 Category유닉스/리눅스 ByJaeSoo Views728
    Read More
  15. AIX 서버 기초

    Date2016.05.11 Category유닉스/리눅스 ByJaeSoo Views631
    Read More
  16. AIX Admin Study 교육 자료

    Date2016.05.11 Category유닉스/리눅스 ByJaeSoo Views716
    Read More
  17. 성능 엔지니어링 대한 접근 방법 (Performance tuning)

    Date2016.05.05 Category유닉스/리눅스 ByJaeSoo Views874
    Read More
  18. Linux/Unix용 nmon 설치 및 구성

    Date2016.05.04 Category유닉스/리눅스 ByJaeSoo Views773
    Read More
  19. [AIX] 파일시스템 관리 (du, df)

    Date2016.05.04 Category유닉스/리눅스 ByJaeSoo Views770
    Read More
  20. IBM AIX Admin (사용자 DISK 관리)

    Date2016.05.04 Category유닉스/리눅스 ByJaeSoo Views686
    Read More
  21. [UNIX] 유닉스 기본명령어

    Date2016.05.04 Category유닉스/리눅스 ByJaeSoo Views562
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

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

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

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

JServer.kr

제이서버 메타블로그

재수 티스토리


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

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너