lighttpd

安裝lighttpd:

[root@localhost ~]# tar zxvf lighttpd-1.4.30.tar.gz

[root@localhost ~]# cd lighttpd-1.4.30

[root@localhost lighttpd-1.4.30]# ./configure --prefix=/usr/local/lighttpd

[root@localhost lighttpd-1.4.30]# make && make install

 

配置lighttpd:

[root@localhost lighttpd-1.4.30]# cp doc/initscripts/rc.lighttpd.redhat /etc/init.d/lighttpd

[root@localhost lighttpd-1.4.30]# chmod a+rx /etc/init.d/lighttpd

[root@localhost lighttpd-1.4.30]# cp -p doc/initscripts/sysconfig.lighttpd /etc/sysconfig/lighttpd

[root@localhost lighttpd-1.4.30]# mkdir -p /etc/lighttpd

[root@localhost lighttpd-1.4.30]# cp -rf doc/config/* /etc/lighttpd/

[root@localhost lighttpd-1.4.30]# chkconfig --add lighttpd

[root@localhost lighttpd-1.4.30]# chkconfig lighttpd on

 

 

[root@localhost ~]# vim +29 /etc/init.d/lighttpd

lighttpd="/usr/sbin/lighttpd"

修改成:

lighttpd="/usr/local/lighttpd/sbin/lighttpd"

 

[root@localhost ~]# mkdir -p /srv/www/htdocs

[root@localhost ~]# mkdir /var/log/lighttpd

[root@localhost ~]# touch /var/log/lighttpdaccess.log

[root@localhost ~]# touch /var/log/lighttpd/error.log

[root@localhost ~]# useradd -s /sbin/nologin lighttpd

[root@localhost ~]# chown -R lighttpd:lighttpd /var/log/lighttpd

 

[root@localhost ~]# vim +93 /etc/lighttpd/lighttpd.conf

server.use-ipv6 = "enable"

修改成:

server.use-ipv6 = "disable"

將壓縮緩存目錄修改到/tmp下

vim /etc/lighttpd/lighttpd.conf +63

var.cache_dir   = "/tmp/cache/lighttpd"

 

 

配置lighttpd modules(/etc/lighttpd/modules.conf)取消需要用到模塊的註釋:mod_rewrite,mod_redirect,mod_access,mod_fastcgi,mod_compress,mod_accesslog

 

修改後:

[root@localhost htdocs]# grep -v "#" /etc/lighttpd/modules.conf | grep -v "^$"

server.modules = (

 "mod_access",

 "mod_redirect",

 "mod_rewrite",

)

include "conf.d/compress.conf"

include "conf.d/fastcgi.conf"

 

配置/etc/lighttpd/conf.d/fastcgi.conf支持PHP

fastcgi.server =(".php"=>

        ("localhost"=>

        (

         "socket"=>"/tmp/php-fastcgi.socket",

        "bin-path"=>"/usr/bin/php-cgi",

        "max-procs"=>2,

        "bin-environment"=>

        (

        "PHP_FCGI_CHILDREN"=>"84",

        "PHP_FCGI_MAX_REQUESTS"=>"1000"

        ),

        "broken-scriptfilename"=>"enable"

        )

        )

        )

修改/etc/php.ini中522行與lighttpd.conf中server.document-root一致:

[root@localhost ~]# vim /etc/php.ini +522

doc_root =/srv/www/htdocs

 

將下載的discuz中的upload文件夾中的所有文件上傳到服務器/srv/www/htdocs目錄中,並將權限改成777

 

本文出自 “網絡收藏夾” 博客,請務必保留此出處http://liyaoyi.blog.51cto.com/442933/784849


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章