友声网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
开启左侧

Linux中web服务器Lighttp的安装与配置

[复制链接]
卡卡北 发表于 2019-1-23 11:32 | 显示全部楼层 |阅读模式
早期的vps只有32兆内存,跑apache是不可能了,当时跑nginx也不好,所以使用了lighttpd,这里简单的讲下如何安装使用



1、lighttp的安装
在安装时一定要有“mode-rewrite”这个选项

2、lighttp的安装配置

             #cp   doc/sysconfig.lighttp   /etc/sysconfig/lighttp

             #mkdir   /etc/lighttp

             #cp  doc/lighhtpd.conf  /etc/lighttp/lighttpd.conf

             #cp doc/rc.lilghttpd   /etc/init.d/lighttp

              修改/etc/init.d/lighttp,把

                   LIGHTTP_BIN=/usr/sbin/lighttp

              改为LIGHTTP_BIN=安装目录/sbin/lighttp



3、配置服务

             服务的配置文件为"/etc/lighttp/lighttp.conf"

             1)  server.modules

                       取消需要用到模块的注释, mod_rewrite, mod_access, mod_fastcgi, mod_simple_vhost, mod_cgi,

                         mod_compress, mod_accesslog等。

             2) server.document-root, server.error-log,  accesslog.filename需要指定相应的目录



             3) 用什么权限来运行 lighttp

                    server.usename="nobody"

                    server.groupame="nobody"



             4) 指定静态文件压缩

                    #mkdir    /installpath/compress

                    #chmod   777   /installpath/compress

                     添加以下几项:

                     compress.cache-dir=/installpath/compress/

                     compress filetype=("text/plain", "text/html", "text/JavaScript", "text/css")

                  可以指定静态源类型使用压缩方式传输,节省带宽

              5)  server.port=81

              6)  #$HTTP["url"] =~"/.pdf$"{

                   #server.range-requests="disabel",

                   #}   

4、优化

               最大连接数

                     修改server.max-fds的值,                 默认为1024

RSS|无图版|手机版|友声网 ( 鲁ICP备15020090号-1 )|网站地图 | 点击这里给我发消息 |

GMT+8, 2024-4-24 03:51 , Processed in 0.030657 second(s), 7 queries , MemCache On.

Powered by Discuz! X

© ys166.com

快速回复 返回顶部 返回列表