換Apache To Lighttpd

OK 很簡單~~
ports 裝一裝後
我只用了幾個用得到的mod
“mod_alias”,”mod_access”,”mod_fastcgi”,”mod_simple_vhost”,”mod_accesslog”
就這些
我是先讓lighttpdapache 並用
把lighttpd 開81 port 去run 看看有沒有問題 ::-p:
沒問題的話~~再把apache 停掉 然後把lighttpd 的port 改成80 就好了。
然後因為有用fastcgi
所以把他原本comment 起來的fastcgi 部份拿掉comment
至於virtual host 的部份
Manual 上有寫到
DocumentRoot = server-root + hostname + document-root

server-root + hostname + document-root

然後每個virtual host 的設定用
$HTTP["host"] == “host”{
}
來區別
範例如下~~
$HTTP["host"] == “blog.abcd.tw”{
simple-vhost.server-root = “/usr/local/web/”
simple-vhost.default-host = “abcd”
simple-vhost.document-root = “/wordpress/”
alias.url = ( “/file/” => “/home/file/” )
accesslog.filename = “/var/log/lighttpd_blog.abcd.tw_access.log”
}
#這個的Document = /usr/local/web/abcd/wordpress/

$HTTP["host"] == “www.abcd.tw”{
simple-vhost.server-root = “/usr/local/web/”
simple-vhost.default-host = “”
simple-vhost.document-root = “/”
alias.url = ( “/photo/” => “/usr/local/web/gallery/”,”/abcd/” => “/usr/local/www/abcd/” )
}
這個的Document = /usr/local/web/

ok 就這麼簡單~~(哈~因為我目前只用到這些~什麼access, rewrite 之類的我都沒用到,所以很簡單) ::-p:

This entry was posted in FreeBSD and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word