1
|
vi /usr/local/lighttpd/config/lighttpd.conf
|
1 2 3 4 5 |
var.log_root = "/usr/local/lighttpd/log" var.server_root = "/usr/local/lighttpd" var.state_dir = "/usr/local/lighttpd" var.home_dir = "/usr/local/lighttpd" var.conf_dir = "/usr/local/lighttpd/config" |
1
|
var.cache_dir = "/usr/local/lighttpd/cache" |
1
|
#server.use-ipv6 = "enable"
|
1 2 |
server.username = "lighttpd1" server.groupname = "lighttpd" |
该项为操作权限,不建议使用root。
1
|
server.document-root = server_root + "/webpages" |
1
|
server.stat-cache-engine = "fam" |
1
|
server.max-worker = 4 |
1
|
groupadd lighttpd
|
1
|
useradd -g lighttpd lighttpd1 |
1
|
chown lighttpd1 /usr/local/lighttpd/log |
1
|
cd /usr/local/lighttpd/webpages |
1
|
vim index.html
|
1 2 3 4 5 6 7 8 |
<html> <head> <title>lighttpd test</title> </head> <body> <p>this is a testing</p> </body> </html> |
1
|
/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/config/lighttpd.conf |
1
|
ps -ef | grep lighttpd |
打开浏览器在url处输入:http://IP:80/index.html,可以看到index.html的页面“this is a testing”,则说明运行成功。
1
|
pkill lighttpd
|
1 2 |
vi /usr/local/lighttpd/log/error.log vi /usr/local/lighttpd/log/access.log |
1
|
netstat -anpt | grep 80 |