日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Ubuntu 下安装thttpd Web服务器

發(fā)布時間:2023/11/27 生活经验 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu 下安装thttpd Web服务器 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

不知道大家是不是真的需要用appache這么復雜的功能這么強大的web server,其實有很多時候使用webserver也只是一種遠程共享訪問的方式。這里,Ubuntu repository的提供了一個簡單的web server,名為thttpd,即 tiny http daemon.

thttpd很小,只有74K,它同樣支持很多feature. 比如CGI, 基本的認證. thttpd還支持URL的限流。它被設(shè)計在高負載下也有極好的性能。
?

在Ubuntu下安裝thttpd,很簡單:
sudo apt-get install thttpd thttpd-util

安裝好后,thttpd已經(jīng)啟動了,你可以在web 瀏覽器中輸入 http://127.0.0.1來測試一下。
他的默認的根目錄在這里: /var/www

thttpd的用法
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
#這里設(shè)置偵聽的端口,不需要改動
port=80

# chroot/nochroot
# Sets whether thttpd will chroot after starting.
# Default: nochroot
# 設(shè)置是否chroot,不需要改動
chroot

# user: userid
# Specified which user to switch after intialiazation when started as root.
# Default: www-data
# 設(shè)置用戶的ID,不需要改動
user=www-data

# host: hostname
# Specifies a hostname to bind to.
# Default: Bind to all supported hostnames on the local machine.
# 設(shè)置主機名
#host=grugler

# Logfile: logfile path
# Specifies a file for logging.
# Default: Log via syslog()
# 設(shè)置日志文件的位置
logfile=/var/log/thttpd.log


# throttles: file
# Specifies a file of throttle settings.
# Default: /etc/thttpd/throttle.conf
# 設(shè)置限流的配置文件名
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`
# 這里設(shè)置web server的根目錄
dir=/var/www

# cgipat: pattern
# Specifies which URL may contain executable CGI files.
# Default: None
cgipat=/cgi-bin/*
=================================================

限流配置文件的配置更簡單,大家看看注釋就明白了,一秒鐘的最大流量為3000個字節(jié)
=================================================
# Format:
# <pattern> <number>
#

#* 3000 # Only devote 3000 bytes per second to our dialup

?

總結(jié)

以上是生活随笔為你收集整理的Ubuntu 下安装thttpd Web服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。