本手册是在新装的NetBSD上安装的。
(1) ftp上传thttpd-2.25b.tar.gz到/usr/src(可能可以是其他路径)
(2) tar –xzpvf thttpd-2.25b.tar.gz
(3) ./configure
(4) make
(5) make install
make install的时候会出现2个问题,导致make install失败。
① thttpd需要www的用户组,所以需要用groupadd www命令来生成www的用户组
② make install的时候会报没有/usr/local/man/man1的错误,所以要mkdir man1
以上就是thttpd的configure make和make install,相对来说比较简单。
以下就是配置thttpd的开机自启动和配置文件了,首先是配置文件。
(6) 配置文件如下所示:
dir=/usr/local/www/data
#chroot
cgipat=/cgi-bin/**.cgi
logfile=/usr/local/www/logs/thttpd.log
pidfile=/var/run/thttpd.pid
解释一下:
dir:就是cgi文件和html文件的所在之处。官方的解释是:
Data directory.
The config file specifies that the data directory is
/usr/local/www/data; this is what Apache calls the DocumentRoot. So,
create this directory and put your HTML files there. If you want to
allow local users to put up there own web stuff, create subdirectories
for them and chown/chmod them accordingly.
chroot:如果不注销的话,thttpd装好后在IE里访问的时候会出现/root路径下的目录,不知道为什么,这是事实,如果把它注销的话,就显示了/usr/local/www/data目录下的路径了。
cgi-bin:是将来我们放cgi文件的路径。
解释一下:我们通过IE能看到的是/usr/local/www/data,所以要明确的指出cgi文件的路径,还需要指明是/usr/local/www/data目录下cgi-bin下的**.cgi文件。
logfile和pidfile指定与不指定没什么关系,用处不是很大。
这样我们的配置文件就完成了。
(7) 下面是配置开机自启动了,这些跟一般的开机自启动一样配置。
在/etc/rc.conf中加入“thttpd=YES”,这里要注意,不能按照c/c++中的coding习惯写成
“thttpd = YES”,中间不能加空格。
在/etc/rc.d中加入script,具体做法是,拷贝一个rc.d里的简单的文件,把它转化为可读可写可执行的文件。然后vi它。修改为如下:
name="thttpd"
rcvar=$name
command="/usr/local/sbin/${name}"
command_conf="/usr/local/www/thttpd.conf"
${command} -C ${command_conf}
run_rc_command "$1"
这个文件相对来说还是满简单的,可能还有更好的方法,不过这样写的话,重新启动后,就可以访问了。
分享到:
相关推荐
嵌入式Linux下的thttpd web服务器的移植.pdf
thttpd移植与安全认证配置 将源码包拷贝到主机主目录下的工作目录(/root/workdir),并解压到当前目录: [root@ workdir]#tar -zxvf thttpd-2.25b.tar.gz 进入解压后的源码文件夹: [root@ workdir]#cd thttpd-2.2.25...
thttpd [-C configfile] [-p port] [-d dir] [-dd data_dir] [-r|-nor] [-s|-nos] [-v|-nov] [-g|-nog] [-u user] [-c cgipat] [-t throttles] [-h host] [-l logfile] [-i pidfile] [-T charset] [-P P3P] [-M max...
thttpd服务器配置方法,学习ARM必备
thttpd是一款小型高效的http服务器, 这是该服务器的源码.
thttpd is a simple, small, portable, fast, and secure HTTP server.
用于小型微处理器的嵌入式WEB服务器源码
thttpd 开发 编译所需要的第三方库, 放上来主要是方便大家下载,这样会比较快一些。
light web server... light web server... light web server... light web server... 最新版本的应用到嵌入式Linux的轻量型web server
基于Linux的嵌入式Web服务器Thttpd的应用研究与实现.pdf
thttpd- 是一款小型/快速/非阻塞的HTTP服务程序
有关配置和安装说明,请参阅 INSTALL 文件。 用法 : ./configure make ./thttpd -D -C test.config 测试配置: port=80 user=nobody dir=./www nochroot cgipat=/cgi-bin/** logfile=thttpd.log pidfile=...
thttpd服务器概述.docx
用来测试嵌入式系统开发过程中的boa、thttpd服务器的配置情况。
嵌入式web服务器thttpd,适合初学者学习,结构简单。采用多路复用技术
Web服务移植thttpd在ARM移植
sthttpd是Jef Poskanzer流行的thttpd服务器的分支。 该分支旨在在发现错误或安全问题时仅维护原始代码库。 请阅读README.thttpd了解更多信息。 学分: 原始代码库由* Jef Poskanzer 。 叉子是由Anthony G. ...
该文件描述嵌入式Linux 下的thttpd CGI 的环境配置方法,及其测试方法
Merecat扩展了thttpd最初提供的功能,但功能集仍然有限: 虚拟主机基本的.htpassd和.htaccess支持基于URL流量的限制CGI / 1.1 HTTP / 1.1保持活动使用zlib内置的gzip压缩使用OpenSSL / LibreSSL的HTTPS支持与!...
适用于嵌入式的轻量级Web服务器,Boa,thttpd,cgic207为CGI库