龙空技术网

ubuntu上如何移植thttpd

编码小哥 76

前言:

今天你们对“ubuntu转换b编码”大约比较珍视,同学们都想要分析一些“ubuntu转换b编码”的相关知识。那么小编同时在网络上网罗了一些有关“ubuntu转换b编码””的相关资讯,希望姐妹们能喜欢,咱们一起来学习一下吧!

thttpd的特点

thttpd 是一个简单、小巧、便携、快速且安全的 HTTP 服务器。

简单:它只处理实现 HTTP/1.1 所需的最低限度。好吧,也许比最低限度多一点。小:请参阅比较图表。它还具有非常小的运行时大小,因为它不会分叉并且非常小心内存分配。便携式:它可以在大多数类Unix操作系统上干净地编译,特别是包括FreeBSD,SunOS 4,Solaris 2,BSD / OS,Linux,OSF。快:在典型使用中,它与最好的全功能服务器(Apache、NCSA、Netscape)一样快。在极端负载下,它的速度要快得多。安全:它竭尽全力保护 Web 服务器计算机免受来自其他站点的攻击和破坏。它还具有一个非常有用的功能(基于 URL 流量的限制),这是其他服务器目前没有的。此外,它还支持开箱即用的 IPv6,无需打补丁。

下载thttpd源码

thttpd (acme.com)

编译安装

root@ubuntu:/home/app/thttpd# makeroot@ubuntu:/home/app/thttpd# make installmkdir -p /usr/local/sbin/usr/bin/install -c -m 555 -o bin -g bin thttpd /usr/local/sbinmkdir -p /usr/local/man/man8/usr/bin/install -c -m 444 -o bin -g bin thttpd.8 /usr/local/man/man8for i in cgi-src extras ; do ( \ cd $i ; \ pwd ; \ make \ WEBDIR=/usr/local/www \ CGIBINDIR=/usr/local/www/cgi-bin \ MANDIR=/usr/local/man \ WEBGROUP=www \ install \ ) ; done/home/app/thttpd/cgi-srcmake[1]: Entering directory `/home/app/thttpd/cgi-src'mkdir -p /usr/local/www/cgi-binrm -f /usr/local/www/cgi-bin/redirectcp redirect /usr/local/www/cgi-bin/redirectrm -f /usr/local/man/man8/redirect.8cp redirect.8 /usr/local/man/man8/redirect.8rm -f /usr/local/www/cgi-bin/ssicp ssi /usr/local/www/cgi-bin/ssirm -f /usr/local/man/man8/ssi.8cp ssi.8 /usr/local/man/man8/ssi.8rm -f /usr/local/www/cgi-bin/phfcp phf /usr/local/www/cgi-bin/phfmake[1]: Leaving directory `/home/app/thttpd/cgi-src'/home/ /app/thttpd/extrasmake[1]: Entering directory `/home/app/thttpd/extras'rm -f /usr/local/sbin/makeweb /usr/local/sbin/htpasswd /usr/local/sbin/syslogtocerncp makeweb /usr/local/sbin/makewebchgrp www /usr/local/sbin/makewebchgrp: invalid group: ‘www’make[1]: *** [install] Error 1make[1]: Leaving directory `/home/ /app/thttpd/extras'make: *** [installsubdirs] Error 2

遇到报错,别着急

解决方法:root@ubuntu:/home/app/thttpd# cat /etc/grouproot:x:0:daemon:x:1:bin:x:2:sys:x:3:adm:x:4:syslog,tinatty:x:5:disk:x:6:lp:x:7:mail:x:8:news:x:9:uucp:x:10:man:x:12:proxy:x:13:kmem:x:15:dialout:x:20:fax:x:21:voice:x:22:cdrom:x:24:tinafloppy:x:25:tape:x:26:sudo:x:27:tinaaudio:x:29:pulsedip:x:30:tinawww-data:x:33:backup:x:34:operator:x:37:list:x:38:irc:x:39:src:x:40:gnats:x:41:shadow:x:42:utmp:x:43:video:x:44:sasl:x:45:plugdev:x:46:tinastaff:x:50:games:x:60:users:x:100:nogroup:x:65534:libuuid:x:101:netdev:x:102:crontab:x:103:syslog:x:104:fuse:x:105:messagebus:x:106:ssl-cert:x:107:lpadmin:x:108:tinascanner:x:109:sanedmlocate:x:110:ssh:x:111:utempter:x:112:avahi-autoipd:x:113:rtkit:x:114:saned:x:115:whoopsie:x:116:avahi:x:117:lightdm:x:118:nopasswdlogin:x:119:bluetooth:x:120:colord:x:121:pulse:x:122:pulse-access:x:123:tina:x:1000:sambashare:x:124:tinaftp:x:125:_cvsadmin:x:126:tftp:x:127:root@ubuntu:/home/app/thttpd# addgroup wwwAdding group `www' (GID 1001) ...Done.

root@ubuntu:/home/app/thttpd# cat /etc/groupwww:x:1001:----------------------------------------------------------------root@ubuntu:/home/app/thttpd# make installmkdir -p /usr/local/sbin/usr/bin/install -c -m 555 -o bin -g bin thttpd /usr/local/sbinmkdir -p /usr/local/man/man8/usr/bin/install -c -m 444 -o bin -g bin thttpd.8 /usr/local/man/man8for i in cgi-src extras ; do ( \ cd $i ; \ pwd ; \ make \ WEBDIR=/usr/local/www \ CGIBINDIR=/usr/local/www/cgi-bin \ MANDIR=/usr/local/man \ WEBGROUP=www \ install \ ) ; done/home/app/thttpd/cgi-srcmake[1]: Entering directory `/home/app/thttpd/cgi-src'mkdir -p /usr/local/www/cgi-binrm -f /usr/local/www/cgi-bin/redirectcp redirect /usr/local/www/cgi-bin/redirectrm -f /usr/local/man/man8/redirect.8cp redirect.8 /usr/local/man/man8/redirect.8rm -f /usr/local/www/cgi-bin/ssicp ssi /usr/local/www/cgi-bin/ssirm -f /usr/local/man/man8/ssi.8cp ssi.8 /usr/local/man/man8/ssi.8rm -f /usr/local/www/cgi-bin/phfcp phf /usr/local/www/cgi-bin/phfmake[1]: Leaving directory `/home/app/thttpd/cgi-src'/home/ /app/thttpd/extrasmake[1]: Entering directory `/home/app/thttpd/extras'rm -f /usr/local/sbin/makeweb /usr/local/sbin/htpasswd /usr/local/sbin/syslogtocerncp makeweb /usr/local/sbin/makewebchgrp www /usr/local/sbin/makewebchmod 2755 /usr/local/sbin/makewebcp htpasswd /usr/local/sbin/htpasswdcp syslogtocern /usr/local/sbin/syslogtocernrm -f /usr/local/man/man1/makeweb.1cp makeweb.1 /usr/local/man/man1/makeweb.1cp: cannot create regular file ‘/usr/local/man/man1/makeweb.1’: No such file or directorymake[1]: *** [install] Error 1make[1]: Leaving directory `/home/app/thttpd/extras'make: *** [installsubdirs] Error 2root@ubuntu:/home/app/thttpd# cd /usr/local/thttpd/man/bash: cd: /usr/local/thttpd/man/: No such file or directory

又有报错了,别着急。

解决方法:

root@ubuntu:/usr/local/man# mkdir -p man1

root@ubuntu:/home/app/thttpd#make installmkdir -p /usr/local/sbin/usr/bin/install -c -m 555 -o bin -g bin thttpd /usr/local/sbinmkdir -p /usr/local/man/man8/usr/bin/install -c -m 444 -o bin -g bin thttpd.8 /usr/local/man/man8for i in cgi-src extras ; do ( \ cd $i ; \ pwd ; \ make \ WEBDIR=/usr/local/www \ CGIBINDIR=/usr/local/www/cgi-bin \ MANDIR=/usr/local/man \ WEBGROUP=www \ install \ ) ; done/home/app/thttpd/cgi-srcmake[1]: Entering directory `/home/app/thttpd/cgi-src'mkdir -p /usr/local/www/cgi-binrm -f /usr/local/www/cgi-bin/redirectcp redirect /usr/local/www/cgi-bin/redirectrm -f /usr/local/man/man8/redirect.8cp redirect.8 /usr/local/man/man8/redirect.8rm -f /usr/local/www/cgi-bin/ssicp ssi /usr/local/www/cgi-bin/ssirm -f /usr/local/man/man8/ssi.8cp ssi.8 /usr/local/man/man8/ssi.8rm -f /usr/local/www/cgi-bin/phfcp phf /usr/local/www/cgi-bin/phfmake[1]: Leaving directory `/home/app/thttpd/cgi-src'/home/app/thttpd/extrasmake[1]: Entering directory `/home/app/thttpd/extras'rm -f /usr/local/sbin/makeweb /usr/local/sbin/htpasswd /usr/local/sbin/syslogtocerncp makeweb /usr/local/sbin/makewebchgrp www /usr/local/sbin/makewebchmod 2755 /usr/local/sbin/makewebcp htpasswd /usr/local/sbin/htpasswdcp syslogtocern /usr/local/sbin/syslogtocernrm -f /usr/local/man/man1/makeweb.1cp makeweb.1 /usr/local/man/man1/makeweb.1rm -f /usr/local/man/man1/htpasswd.1cp htpasswd.1 /usr/local/man/man1/htpasswd.1rm -f /usr/local/man/man8/syslogtocern.8cp syslogtocern.8 /usr/local/man/man8/syslogtocern.8make[1]: Leaving directory `/home/app/thttpd/extras'

配置

root@ubuntu:/home/app/thttpd#cat thttpd.conf

# This section overrides defaults

#chroot

# This section _documents_ defaults in effect

# port=80port=888

# nosymlink

# default = !chroot

# novhost

# nocgipat

# nothrottles

# host=0.0.0.0

# charset=iso-8859-1

#dir=.dir=/home/app/www

#cgipat=/*.cgi

cgipat=/cgi/*.cgi

logfile=/tmp/thttpd.log

pidfile=/var/run/thttpd.pid

#user=root

启动服务

thttpd -C thttpd.conf -d /home/app/www/ -u root -l /var/log/test_httpd.log

或者

thttpd -C thttpd.conf -l /var/log/test_httpd.log

标签: #ubuntu转换b编码