Ubuntu 下安装thttpd Web服务器
发布日期:2021-06-30 19:22:19
浏览次数:4
分类:技术文章
本文共 2301 字,大约阅读时间需要 7 分钟。
不知道大家是不是真的需要用appache这么复杂的功能这么强大的web server,其实有很多时候使用webserver也只是一种远程共享访问的方式。这里,Ubuntu repository的提供了一个简单的web server,名为thttpd,即 tiny http daemon.
thttpd很小,只有74K,它同样支持很多feature. 比如CGI, 基本的认证. thttpd还支持URL的限流。它被设计在高负载下也有极好的性能。
在Ubuntu下安装thttpd,很简单:
sudo apt-get install thttpd thttpd-util安装好后,thttpd已经启动了,你可以在web 浏览器中输入 来测试一下。
他的默认的根目录在这里: /var/wwwthttpd的用法
Usage: sudo /etc/init.d/thttpd {start|stop|restart|force-stop|force-reload}thttpd的配置文件 /etc/thttpd/thttpd.conf也很简单
========================================= #------------------------------------------------------------------------------# # thttpd version 2.23beta1 # # Main configuration file # #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # Port: portnum # Sets the port number which will be listened by thttpd. # Default: 80 #这里设置侦听的端口,不需要改动 port=80# chroot/nochroot
# Sets whether thttpd will chroot after starting. # Default: nochroot # 设置是否chroot,不需要改动 chroot# user: userid
# Specified which user to switch after intialiazation when started as root. # Default: www-data # 设置用户的ID,不需要改动 user=www-data# host: hostname
# Specifies a hostname to bind to. # Default: Bind to all supported hostnames on the local machine. # 设置主机名 #host=grugler# Logfile: logfile path
# Specifies a file for logging. # Default: Log via syslog() # 设置日志文件的位置 logfile=/var/log/thttpd.log # throttles: file # Specifies a file of throttle settings. # Default: /etc/thttpd/throttle.conf # 设置限流的配置文件名 throttles=/etc/thttpd/throttle.conf# urlpat: pattern
# Specifies which URL can only be only be accessed from the local server.# Default: None
# urlpat=*.mpeg|*.MP3|*.wav|*.gz|*.jpg|*.gif# dir: directory
# Specifies a directory to chdir() to after thttpd starts. # This directory will most likely be the directory you will be serving your # clients from. # Default: `cwd` # 这里设置web server的根目录 dir=/var/www# cgipat: pattern
# Specifies which URL may contain executable CGI files. # Default: None cgipat=/cgi-bin/* =================================================限流配置文件的配置更简单,大家看看注释就明白了,一秒钟的最大流量为3000个字节
================================================= # Format: # <pattern> <number> ##* 3000 # Only devote 3000 bytes per second to our dialup
转载地址:https://linuxstyle.blog.csdn.net/article/details/6572346 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
网站不错 人气很旺了 加油
[***.192.178.218]2024年04月05日 07时33分09秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
scrapy 排错记录
2019-04-30
ACM路上的一大失误
2019-04-30
HDOJ2049 不容易系列之(4)——考新郎
2019-04-30
CodeForces 248B - Chilly Willy - 找规律
2019-04-30
POJ-2418 Hardwood Species(Trie树)(map)
2019-04-30
HDU-4300 Clairewd’s message + 4333(扩展KMP)
2019-04-30
HDU 1592 Half of and a Half(高精度)
2019-04-30
POJ-3304 Segments(计算几何)
2019-04-30
UVA-11538 Chess Queen(数学)
2019-04-30
UVA-11401 Triangle Counting(数学优化)
2019-04-30
Codeforces Round #369 (Div. 2)
2019-04-30
UVA 11426 GCD - Extreme (II)(欧拉函数)
2019-04-30
HDU-2838 Cow Sorting(树状数组)
2019-04-30
POJ-2299 Ultra-QuickSort(树状数组)(离散化)
2019-04-30
基于SSM的兼职论坛系统的设计与实现
2019-04-30
基于java的图书管理系统的设计与实现
2019-04-30
基于java的SSM框架理财管理系统的设计与实现
2019-04-30
基于java的ssm框架就业信息管理系统的设计
2019-04-30