한국어

tc_backup

HowTo: Setup Lighttpd + PHP + eAccelerator

This guide will teach you how to install lighttpd with php support and eAccelerator



1st thing we need to do is to create a directory where we will download all the installtion files into it.

mkdir /root/installers
cd /root/installers



1. Download Lighttpd

wget http://www.lighttpd.net/download/lighttpd-1.4.15.tar.gz



2. Download PHP & FastCGI

wget http://www.fastcgi.com/dist/fcgi.tar.gz
wget http://il2.php.net/get/php-4.4.6.tar.gz/from/www.php.net/mirror



3. Download eAccelerator

wget http://bart.eaccelerator.net/source/0.9.5/eaccelerator-0.9.5.tar.bz2



4. Make Sure the following packages installed. pcre-devel, libpng-devel, libjpeg-devel,lib-gd

up2date -i pcre-devel libpng-devel libjpeg-devel lib-gd



5. Create the directories for compiling lighty

mkdir -p /www/service/
mkdir -p /www/service/logs
mkdir -p /www/service/config



6. Untar all packages

tar xzvfp lighttpd-1.4.15.tar.gz
tar xzvfp fcgi.tar.gz
tar xzvfp php-4.4.6.tar.gz
tar xjvfp eaccelerator-0.9.5.tar.bz2



7. Comiple Lighttpd

cd lighttpd-1.4.15/
./configure --prefix=/www/service
make
make install



8.a. Comiple FastCGI

cd ..
cd cd fcgi-2.4.0/
./configure
make
make install



8.b. Compile PHP (Here is disabled pear support '--without-pear') you can remove it if you need pear support

cd ..
cd php-4.4.6/
./configure --enable-fastcgi --with-curl --with-mysql=/usr/local/mysql \
           --enable-sysvshm --enable-sysvsem --enable-sysvmsg --with-gd \
           --with-zlib --without-pear
make
make install



9. create a copy for php.ini

cp -a php.ini-recommended /usr/local/lib/php/php.ini



10. Compile eAccelerator

cd ..
cd eaccelerator-0.9.5
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install



11. Add eAccelerator Config to php.ini (add the lines into the end of the php file)

vi /usr/local/lib/php/php.ini

zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so"
eaccelerator.shm_size="16"
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"




10 . Make sure it's working type (php -v) you should get something like this.

php -v
PHP 4.4.6 (cgi-fcgi) (built: Apr 29 2007 17:14:12)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
   with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator



11. Create Lighttpd Config Files.

cp -a /root/installers/lighttpd-1.4.15/doc/lighttpd.conf /www/service/config/



12. Edit Lighttpd config file (vi /www/service/config/lighttpd.conf)

vi /www/service/config/lighttpd.conf



12.a. Add the following line into the end of the file.

  #fastcgi.debug = 1
     fastcgi.server = (".php" =>
        ("lighttpd-php" =>
           ("socket" => "/tmp/lighttpd-php.sock",
            "bin-path" => "/usr/local/bin/php",
                    "max-procs" => 2,
                    "bin-environment" => (
                      "PHP_FCGI_CHILDREN" => "16",
                      "PHP_FCGI_MAX_REQUESTS" => "10000"
                    ),
                    "bin-copy-environment" => (
                      "PATH", "SHELL", "USER"
                    )
           )
     )
  )



13. Try IT

/www/service/sbin/lighttpd -f /www/service/config/lighttpd.conf

http://www.82i.com/@/zboard.php?id=faq&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=41

분류 :
Linux
태그 :
조회 수 :
18831
등록일 :
2008.04.06
21:49:50 (*.234.246.12)
엮인글 :
http://www.rain9.com/xe/tc_backup/2342/a7e/trackback
게시글 주소 :
http://www.rain9.com/xe/tc_backup/2342
List of Articles
번호 제목 글쓴이 날짜 조회 수
80 Linux 아파치 DoS 방어 엔신 2008-04-06 28605
79 Linux 리눅스에서 text 인코딩 한꺼번에 바꾸기 엔신 2008-04-06 11723
78 Linux 아파치 2.x 에서의 트래픽 제한 엔신 2008-04-06 11373
77 Linux mod_cband 제한 관련내용 엔신 2008-04-06 9089
76 Linux lighttpd + php fastcgi + xcache 설치하기 엔신 2008-04-06 13486
» Linux HowTo: Setup Lighttpd + PHP + eAccelerator 엔신 2008-04-06 18831
74 Linux RRDTool 엔신 2008-04-06 17087
73 Linux CentOS (Redhat Enterprise)에서 lighttpd 설치 엔신 2008-04-06 16898
72 Linux lighttpd 웹서버설치 엔신 2008-04-06 9882
71 Linux SSH클라이언트 접속시 한글깨짐문제 - /etc/sysconfig/i18n [1] 엔신 2008-04-06 18302
70 Programming 입력 받을때 주의 엔신 2008-04-06 11117
69 Linux mod_security를 통한 방화벽구축 엔신 2008-04-05 19668
68 Security 키사 엔신 2008-04-02 8279
67 Linux 하나의 계정에 여러개 도메인 포워딩하여 각각 사이트 구현하기 엔신 2008-04-01 13026
66 Security 보안서버구축가이드_v10(초안) file 엔신 2008-03-25 9709
65 Linux 검색로봇을 막는 방법 robots.txt 엔신 2008-03-24 14710
64 Linux [apache] 검색로봇 차단법 엔신 2008-03-24 22278
63 DBMS show variables 변경하기 5.0 기준 서버 변수 변경하기 엔신 2008-03-21 17556
62 파일내 문자열 검색(find, xargs) 엔신 2008-03-15 13037
61 Linux 사랑비 설치시 테이블 생성 실패 [2] 엔신 2008-03-14 13907