在Lighttpd中配置支持ShopEx的方法。目前還沒有在lighttpd中配置ShopEx 的偽靜態規則。如果lighttpd的fans的話??梢栽囋嚺渲靡幌拢@里提供一條線索。就是lighttpd的一個第三方模塊:lighttpd-mod-magnet.
這里的操作系統是Linux,所以先弄清楚,Windows是沒有lighttpd的。需要說明的是,Lighttpd的版本必須大于或等于 1.4.12,lua版本必須大于或等于5.1.不過還好,我這次測試是在Debian4下操作的。直接用apt-get命令安裝的軟件。沒有什么問題, 其他系統諸如centos也應該是類似的。這里就只討論在debian環境中的配置。其他系統的只能依照此例進行參考,切不可以盲目執行。
1.首先要先安裝一個Lighttpd模塊,用來解析lua格式文檔。安裝這個模塊的同時會直接安裝好luaapt-get install lighttpd-mod-magnet
2.開啟這個模塊。直接執行命令:
lighty-enable-mod magnet
執行之后,會在/etc/lighttpd/conf-enabled目錄中自動添加模塊配置文件10-magnet.conf.
3.添加參數配置:shopex.lua
cd /etc/lighttpd
wget http://www.xmlchina.org/source/shopex.lua
如果你的網店是放在二級目錄中,請修改shopex.lua文件中的
-- prefix without the trailing slash
local prefix = ''
如您的網店是在shop目錄中,就將local prefix = ''改為local prefix = '/shop'
4.配置lighttpd虛擬主機,這里以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"
}
最后重啟一下就可以了.然后我們進入網站管理后臺開啟偽靜態就可以了.看完了,然后你發現了嗎?那就是不用破解那個亂糟糟的文件了.
新聞熱點
疑難解答