wget http://kr2.php.net/get/php-5.2.0.tar.gz/from/this/mirror tar xvfz php-5.2.0.tar.gz cd php-5.2.0 ./configure --prefix=/usr/local/php --with-exec-dir=/usr/bin --with-mysql --with-sqlite --with-config-file-path=/etc --disable-debug --enable-sockets --with-png-dir=/usr/lib --with-freetype-dir=/usr/include/freetype2 --enable-mod-charset --enable-calendar --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-magic-quotes --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib --with-jpeg-dir=/usr/src --with-gd --with-ttf --with-gettext --enable-sigchild --with-libxml-dir=/usr/local/src/libxml2-2.6.11 --with-zlib-dir=/usr/local/src/zlib-1.2.1 --with-iconv --enable-fastcgi --enable-force-cgi-redirect make make install
[xcache-common] zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so [xcache.admin] xcache.admin.auth = On xcache.admin.user = "관리자 아이디" xcache.admin.pass = "md5 hash 비밀번호" [xcache] xcache.shm_scheme = "mmap" xcache.size = 64M xcache.count = 4 xcache.slots = 8K xcache.ttl = 0 xcache.gc_interval = 0 xcache.var_size = 64M xcache.var_count = 4 xcache.var_slots = 8K xcache.var_ttl = 0 xcache.var_maxttl = 0 xcache.var_gc_interval = 300 xcache.test = Off xcache.readonly_protection = On ;xcache.mmap_path = "/tmp/xcache" xcache.mmap_path = "/dev/zero" xcache.coredump_directory = "" xcache.cacher = On xcache.stat = On xcache.optimizer = On [xcache.coverager] xcache.coverager = On xcache.coveragedump_directory = ""
wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz tar xvfz lighttpd-1.4.18.tar.gz cd lighttpd-1.4.13 ./configure --with-pcre make make install cp doc/lighttpd.conf /etc
server.modules = (
"mod_rewrite",
# "mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
"mod_auth",
# "mod_status",
# "mod_setenv",
"mod_fastcgi",
# "mod_proxy",
"mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
"mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog"
)
server.document-root = "/home/..../public_html"; # document root 지정
server.error_log = "/var/log/lighttpd/error.log"; # 에러 로그 저장. 디렉토리 생성해주세요.
index-file.name = ( "index.php", "index.html", "index.htm", "default.htm") # index file 지정
mimetype.assign = ... # 그냥 두시면 됩니다.
accesslog.filename = "/var/log/lighttpd/access.log"; # access log 저장
url.access-deny = ( "~", ".inc") # 특정 파일 형식에 대해 접근 금지 시킬 수 있습니다.
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) # mod_fastcgi나 mod_cgi 사용시 지정될 파일입니다.
# 아파치의 vhost와 같은 정의를 아래와 같이 쉽게 할 수 있습니다. 도메인에 대한 document-root 지정
# 1개 이상의 vhost일 경우 아래 3라인을 복사해서 주죽 써나가시면 됩니다.
# 좀 더 쉽게 하려면 가상호스트 모듈 mod_evhost를 이용하면 됩니다.
$HTTP["host"] == "www2.zerophp.com" {
server.document-root = "/home/DOMAINS/WWW"
}
# mod_evhost 사용시 vhost 지정
# %3 는 subdomain 1의 이름입니다. 아래와 같은 패턴이 정의되어 있습니다.
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
evhost.path-pattern = "/var/www/hosts/%3/"
server.username = "nobody" # 웹서버가 사용한 uid
server.groupname = "nobody" # 웹서버가 사용할 gif
# 아래가 php의 fastcgi 연결 부분입니다.
# 다른 부분은 그대로 두고 --enable-fastcgi, --enable-force-cgi-redirect 옵션으로 컴파일한 php 실행 파일 경로만 신경쓰시면 됩니다.
fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/var/run/lighttpd/php-fastcgi.socket", "bin-path" => "/usr/local/php/bin/php" )))
일단 php with fastcgi, xcache, lighttpd 설치와 설정에 대해서 간단히 적었습니다.
더 상세히 적고 싶지만 저 역시 아직 공부하는 중이라 필요한 부분들만 적었습니다.
서버 관리를 하신다면 그렇게 어렵지 않을 거라 생각합니다.
참고로.. 제로보드XE에서 주소를 이쁘게 하는 mod_rewrite를 lighttpd에서도 쓸수 있는데 이걸 각 서브도메인별로 지정하는걸 모르겠네요.
일단 저는 lighttpd.conf에 지정해 놓았습니다.
먼저 server.module에서 mod_rewrite를 사용하게 해 놓으시구요.
url.rewrite = (
"^/([a-zA-Z0-9_]+)/files/attach/images/(.*)" => "./files/attach/images/$2",
"^/([a-zA-Z0-9_]+)/modules/(.*)" => "./modules/$2",
"^/([a-zA-Z0-9_]+)/common/(.*)" => "./common/$2",
"^/([a-zA-Z0-9_]+)/([[:digit:]]+)page$" => "./index.php?mid=$1&page=$2",
"^/rss/([[:digit:]]+){0,14}/([[:digit:]]+){0,14}/([[:digit:]]+)$" => "./index.php?module=rss&act=rss&start_date=$1&end_date=$2&page=$3",
"^/rss/([[:digit:]]+)$" => "./index.php?module=rss&act=rss&page=$1",
"^/rss$" => "./index.php?module=rss&act=rss",
"^/admin$" => "./index.php?module=admin",
"^/([a-zA-Z0-9_]+)/api$" => "./index.php?mid=$1&act=api",
"^/([[:digit:]]+)$" => "./index.php?document_srl=$1",
"^/([[:digit:]]+)/([a-zA-Z0-9_]+)$" => "./index.php?document_srl=$1&act=$2",
"^/([[:digit:]]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$" => "./index.php?document_srl=$1&act=$3&key=$2",
"^/([a-zA-Z0-9_]+)/([[:digit:]]+)$" => "./index.php?mid=$1&document_srl=$2",
"^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$" => "./index.php?mid=$1&act=$2",
"^/([a-zA-Z0-9_]+)/page/([[:digit:]]+)$" => "./index.php?mid=$1&page=$2",
"^/([a-zA-Z0-9_]+)/category/([[:digit:]]+)$" => "./index.php?mid=$1&category=$2",
"^/([a-zA-Z0-9_]+)/category/([[:digit:]]+)/page/([[:digit:]]+)$" => "./index.php?mid=$1&category=$2&page=$3",
"^/([a-zA-Z0-9_]+)/([[:digit:]]+)/([[:digit:]]+)$" => "./index.php?mid=$1&search_target=regdate&search_keyword=$2$3",
"^/([a-zA-Z0-9_]+)/([[:digit:]]+)/([[:digit:]]+)/([[:digit:]]+)$" => "./index.php?mid=$1&search_target=regdate&search_keyword=$2$3$4",
"^/([a-zA-Z0-9_]+)/tag/(.*)$" => "./index.php?mid=$1&search_target=tag&search_keyword=$2",
"^/([a-zA-Z0-9_]+)/writer/(.*)$" => "./index.php?mid=$1&search_target=nick_name&search_keyword=$2",
"^/([a-zA-Z0-9_]+)(/){0,1}$" => "./index.php?mid=$1" )
로 입력해 놓았습니다.
일단 제로보드XE가 각 서브도메인의 document root에 위치한다고 가정하고 적은것이고 잘 동작하더군요.
저도 어제부터 알아보기 시작한거라 더 유용하거나 상세한 내용 찾게 되면 추가하도록 하겠습니다.
TagList
AttachmentFile List
<a
href="http://e.chinahotel.com/shanghai-hotels">shanghai
hotel</a>
<a
href="http://e.chinahotel.com/guangzhou-hotels">guangzhou
hotel</a>
<a href="http://e.chinahotel.com/shenzhen-hotels">shenzhen
hotel</a>
<a
href="http://e.chinahotel.com/Beijing-hotels">beijing hotel</a>
<a href="http://www.chinahotel.com">china hotel</a>
<a href="http://e.chinahotel.com/">guangzhou hotel</a>
<a href="http://e.chinahotel.com/">shenzhen</a>
<a href="http://e.chinahotel.com/">shanghai hotel</a>
<a href="http://e.chinahotel.com/">beijing hotel</a>
<a href="http://www.xzxinda.com/">回转支承</a>
<a href="http://www.xzxinda.com/">转盘轴承</a>
<a href="http://www.xzxinda.com/">slewing ring</a>
<a href="http://www.xzxinda.com/">slewing bearing</a>
<a href="http://www.xzxinda.com/">slewing bearings</a>
<a href="http://www.xzxinda.com/default2.aspx">slewing
ring</a>
<a href="http://www.xzxinda.com/default2.aspx">slewing
bearing</a>
<a href="http://www.xzxinda.com/default2.aspx">slewing
bearings</a>
$HTTP["host"] == "domain" {
server.document-root = "/home/test/public_html"
accesslog.filename = "/var/log/lighttpd/domain-access.log"
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "/var/run/lighttpd/php-fastcgi-domain.socket", # 소켓 파일명 지정
"bin-path" => "/usr/bin/php-cgi -c /etc/php-domain.ini", # php.ini 파일명 위치 지정
"min-procs" => 1,
"max-procs" => 1, # 기본값 4
)
)
)
}각 호스트 별로 PHP 환경 설정하기.
일단 lighttpd+php(fastcgi)+eaccelerator+zend optimizer로 운영중입니다.
apache+php+ea+zend에 비해서는 빠른 느낌이 들긴 하는데... 솔직히 잘 모르겠네요.
xcache에 대해서 좀 더 파봐야 할것 같네요.