【Lighttpd】WordPressやDooPHPを動かす設定

lighttpd

lighttpd

Lighttpdは.htaccessが標準で使えないです。
htscannerを入れると動くようですが、Lighttpdの設定を変更するだけでWordPressやDooPHPが動くようになります。

WordPressでパーマリンクの設定を行わなければ、問題ないかと思いますがメモとして書いておきます。

バーチャルホストの設定で、rewrite部分を追加します。

vim /etc/lighttpd/cond.d/example.com.conf

############WordPressの場合############
$HTTP[“host”] == “dev.example.com”{
server.document-root = “/home/vhosts/example.com/dev/htdocs”
url.rewrite-once = (
“^/(wp-.+).*/?” => “$0”,
“^/(sitemap.xml)” => “$0”,
“^/(xmlrpc.php)” => “$0”,
“^/(.+)/?$” => “/index.php/$1”,
)
}

############DooPHPの場合############
$HTTP[“host”] == “dev.example.com”{
server.document-root = “/home/vhosts/example.com/dev/htdocs”
url.rewrite-once = (
“^/(.+)/?$” => “/index.php/$1”,
)
}

サーバモジュールを有効にします。
vim /etc/lighttpd/lighttpd.conf

server.modules = (
“mod_fastcgi”,
“mod_cgi”,
“mod_rewrite”,
“mod_access”,
“mod_evhost”)

以上でWordPressなどがApacheと同じように動作します。

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x