在Lighttpd中配置支持ShopEx的方法。目前還沒有在lighttpd中配置ShopEx 的偽靜態(tài)規(guī)則。如果lighttpd的fans的話。可以試試配置一下,這里提供一條線索。就是lighttpd的一個(gè)第三方模塊:lighttpd-mod-magnet.
這里的操作系統(tǒng)是Linux,所以先弄清楚,Windows是沒有l(wèi)ighttpd的。需要說明的是,Lighttpd的版本必須大于或等于 1.4.12,lua版本必須大于或等于5.1.不過還好,我這次測試是在Debian4下操作的。直接用apt-get命令安裝的軟件。沒有什么問題, 其他系統(tǒng)諸如centos也應(yīng)該是類似的。這里就只討論在debian環(huán)境中的配置。其他系統(tǒng)的只能依照此例進(jìn)行參考,切不可以盲目執(zhí)行。
1.首先要先安裝一個(gè)Lighttpd模塊,用來解析lua格式文檔。安裝這個(gè)模塊的同時(shí)會(huì)直接安裝好luaapt-get install lighttpd-mod-magnet
2.開啟這個(gè)模塊。直接執(zhí)行命令:
lighty-enable-mod magnet
執(zhí)行之后,會(huì)在/etc/lighttpd/conf-enabled目錄中自動(dòng)添加模塊配置文件10-magnet.conf.
3.添加參數(shù)配置:shopex.lua
cd /etc/lighttpd
wget http://www.xmlchina.org/source/shopex.lua
如果你的網(wǎng)店是放在二級目錄中,請修改shopex.lua文件中的
-- prefix without the trailing slash
local prefix = ''
如您的網(wǎng)店是在shop目錄中,就將local prefix = ''改為local prefix = '/shop'
4.配置lighttpd虛擬主機(jī),這里以test.xmlchina.org為例
## test.xmlchina.org
$HTTP["host"] =~ "test.xmlchina.org" {
magnet.attract-physical-path-to = ( "/etc/lighttpd/shopex.lua" )
server.document-root = "/home/xmlchina/shop/public_html"
index-file.names = ( "index.php" )
server.errorlog = "/var/log/lighttpd/test.xmlchina.org-error.log"
accesslog.filename = "/var/log/lighttpd/test.xmlchina.org-access.log"
}
最后重啟一下就可以了.然后我們進(jìn)入網(wǎng)站管理后臺(tái)開啟偽靜態(tài)就可以了.看完了,然后你發(fā)現(xiàn)了嗎?那就是不用破解那個(gè)亂糟糟的文件了.
新聞熱點(diǎn)
疑難解答
圖片精選