lighttpd 记录

lighttpd 记录

参考文章

ubuntu下安装lighttpd
https://www.cnblogs.com/chengliu/p/3636372.html

lighttpd交叉编译及使用
https://xugaoxiang.blog.csdn.net/article/details/88526586

http://wiki.ubuntu.org.cn/Lighttpd
http://www.acmesystems.it/foxg20_cgi

Lighttpd源码分析_高群凯.pdf

web开发的RFC 开发文档
RFC 822 ,RFC1034 ,RFC1035,RFC1738,RFC2068

文件位置

/var/www/html/index.lighttpd.html

/var/log/lighttpd/error.log

2021-07-09 18:02:08: (log.c.164) server started
2021-07-09 18:05:24: (server.c.1558) server stopped by UID = 0 PID = 1
2021-07-12 09:55:52: (log.c.164) server started

Log files are placed in /var/log/lighttpd, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/lighttpd.
在这里插入图片描述

ubuntu 下面安装

sudo apt-get install lighttpd #安装lighttpd
安装后系统会自动启动lighttpd,打开http://localhost 便是,如果你之前有装Apache,那默认主页换成 http://localhost/index.lighttpd.html 。

web服务器的根目录是在 /var/www/ ,图片目录是:/usr/share/images/,配置文件是在/etc/lighttpd/lighttpd.conf。

重启lighttpd的命令

sudo /etc/init.d/lighttpd restart

Lighttpd默认页面

Placeholder page
The owner of this web site has not put up any web pages yet. Please come back later.

You should replace this page with your own web pages as soon as possible.
Unless you changed its configuration, your new server is configured as follows:
Configuration files can be found in /etc/lighttpd. Please read /etc/lighttpd/conf-available/README file.
The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
CGI scripts are looked for in /usr/lib/cgi-bin, which is where Ubuntu packages will place their scripts. You can enable cgi module by using command "lighty-enable-mod cgi".
Log files are placed in /var/log/lighttpd, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/lighttpd.
The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
You can enable user directories by using command "lighty-enable-mod userdir"
About this page
This is a placeholder page installed by the Ubuntu release of the Lighttpd server package.

This computer has installed the Ubuntu operating system, but it has nothing to do with the Ubuntu Project. Please do not contact the Ubuntu Project about it.

If you find a bug in this Lighttpd package, or in Lighttpd itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Ubuntu Bug Tracking System.
11

最近搭建的静态资源服务器使用的是lighttpd,每天要产生上百M的access.log日志文件,如何对日志按天进行分割呢?

常规的办法是自己写一个脚本,然后添加cron任务,或者使用第三方的工具定时切割日志文件。

但是,linux已经给大家提供了一个日志管理软件Logrotate,其实功能很强大、配置也很简单,不过好像大部分人都喜欢折腾,完全忽视了它的存在。

22

符合X/Open技术规范的UNIX版本自备了一个数据库dbm。它使用hash表来保存非结构化数据,不支持SQL。它只是一个存储检索数据的例程。数据以key/data对的形式存储在文件中。规范中允许把关键字/数据对的长度限制为1023个字节,但通常实现时不限制。关键字的取值被用作存储数据的索引。dbm被X/Open组织标准化为ndbm。GNU的dbm实现为gdbm(GNU dbm的缩写),它本身的接口实现与旧版本不同,但它同时也提供了旧版本的dbm和ndbm实现,因此gdbm兼容dbm和ndbm。dbm、gdbm适合存储静态的,索引化的数据结构。适用于处理那些被频繁访问但却很少被更新的数据,因为它创建数据项时非常慢,但检索数据项时非常快。(摘自http://blog.csdn.net/zhoudaxia/article/details/4379313)

   在上面的网站上周大侠详细地剖析了gdbm的源代码,我自己也从Git上下了一个版本看了看。谈谈自己的收获。



   Gdbm是一个小巧的数据库系统。虽然很短小,但是读完以后却是收获颇丰,感觉对数据库的整个理解又明朗了一些。

   个人认为数据库只不过是索引+数据存储的组合,把这两个概念延伸到分布式系统中来,就是状态节点+数据节点。这又一次说明其实分布式系统真的是单机系统的延伸。类似地,存储在磁盘中的数据库系统其实也是内存中查找结构的一种延伸。

   由熟悉到陌生,先来看看如果我们需要在内存中存储查找数据会怎么做。假如所有的数据都驻留在内存,最简单的方法就是使用一个list存储一些pair<key, value>,可以有序也可以无序。Value可以是一个指针,也可以是数据本身。对于插入操作,直接插入list中的恰当位置;删除操作则从list中删除,并释放对应的内存;对于更新操作,如果value的size变大了,则需要先释放原来的内存,然后申请足够大的内存来存储数据。对于其它存储结构,比如B+树,set,map等,操作规则也是一样的。如果需要像Oracle那样可以通过多个索引值查找,可以使用Boost的MultiView的概念,对一个存储元素进行多层面的存储。
22
plugins_call_handle_joblist
#define PLUGIN_TO_SLOT(x, y)
#define PLUGIN_TO_SLOT(x, y) \
	handler_t plugins_call_##y(server *srv, connection *con) {\
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_JOBLIST, handle_joblist)
33

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值