我使用HHVM作为deamon运行,具有以下配置:
Server {
Port = 80
SourceRoot = /var/www/
}
VirtualHost {
{
Pattern = .*
RewriteRules {
dirindex {
pattern = ^/(.*)/$
to = $1/index.php
qsa = true
}
}
}
}
Extensions {
css = text/css
gif = image/gif
html = text/html
jpe = image/jpeg
jpeg = image/jpeg
jpg = image/jpeg
png = image/png
tif = image/tiff
tiff = image/tiff
txt = text/plain
}
我可以访问/index.php但不能/获取“未找到”。我错过了什么?
答案 0 :(得分:3)
你错过了DefaultDocument,更正如下:
Server {
Port = 80
SourceRoot = /var/www/
DefaultDocument = index.php
}
答案 1 :(得分:2)
这对我有用:
Server {
SourceRoot = /var/www/html/directory
DefaultDocument = index.php
}
我放弃了端口,因为我已经在启动时设置了它:
hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000 --config /etc/hhvm.hdf