centos手动编译lighttpd
安装必要的软件:
1 | yum -y install glib2-devel openssl-devel pcre-devel bzip2-devel gzip-devel |
安装Lighttpd: 到http://www.lighttpd.net/下载最新版,现在最新版是1.4.28.
1 | cd /usr/local/src |
配置Lighttpd:
1 | sed -e 's/FOO/lighttpd/g' doc/rc.lighttpd.redhat > /etc/init.d/lighttpd |
创建符号链接:
1 | ln -s /usr/local/sbin/lighttpd /usr/sbin/lighttpd |
为Lighttpd建立用户和用户组:
1 | groupadd lighttpd |
为Lighttpd建立文件夹和设置所有权:
1 | mkdir /var/log/lighttpd |
修改配置文件:
1 | vi /etc/lighttpd/lighttpd.conf |
启动Lighttpd:
1 | service lighttpd start |
设置根目录文件夹:
1 | server.document-root = "/srv/www/htdocs/" |
设置用户名和组:
1 | perl -i -p -e 's/#server.username = "wwwrun"/server.username = "lighttpd"/g;' /etc/lighttpd/lighttpd.conf |
设置pid文件:
1 | server.pid-file = "/var/run/lighttpd.pid" |