thttpd 如何启动及如何配置?分不多请见亮
我在REDHED中安装了thttpd。步骤如下。
(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"
这个文件相对来说还是满简单的,可能还有更好的方法,不过这样写的话,重新启动后,就可以访问了。
//////////////////////////////////////////////////////////////////////////////////////////
问题 1:
他上面说 配置文件如下
(6) 配置文件如下所示:
dir=/usr/local/www/data
#chroot
cgipat=/cgi-bin/**.cgi
logfile=/usr/local/www/logs/thttpd.log
pidfile=/var/run/thttpd.pid
我不大清楚他这些是放在哪个文件里面的我用的是redhat系统,
////////////////////////////////////////////////////////////////////////////////////////////
问题2:
他上面说在/etc/rc.conf中加入“thttpd=YES”,这里要注意,不能按照c/c++中的coding习惯写成 。。。
可我的红帽没有这个文件,在/etc/ 下只有 rc rc.d rc.local rc.sysinit 等等几个文件 。
并且我在这几个文件中没有找到相应的thttpd=YES
////////////////////////////////////////////////////////////////////////////////////////////
初学请见亮,麻烦高手给些意见。。
(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"
这个文件相对来说还是满简单的,可能还有更好的方法,不过这样写的话,重新启动后,就可以访问了。
//////////////////////////////////////////////////////////////////////////////////////////
问题 1:
他上面说 配置文件如下
(6) 配置文件如下所示:
dir=/usr/local/www/data
#chroot
cgipat=/cgi-bin/**.cgi
logfile=/usr/local/www/logs/thttpd.log
pidfile=/var/run/thttpd.pid
我不大清楚他这些是放在哪个文件里面的我用的是redhat系统,
////////////////////////////////////////////////////////////////////////////////////////////
问题2:
他上面说在/etc/rc.conf中加入“thttpd=YES”,这里要注意,不能按照c/c++中的coding习惯写成 。。。
可我的红帽没有这个文件,在/etc/ 下只有 rc rc.d rc.local rc.sysinit 等等几个文件 。
并且我在这几个文件中没有找到相应的thttpd=YES
////////////////////////////////////////////////////////////////////////////////////////////
初学请见亮,麻烦高手给些意见。。
...全文
相关推荐
thttpd服务器配置方法
start`来启动thttpd,`/etc/init.d/thttpd stop`来停止它,`/etc/init.d/thttpd restart`来重启服务,`/etc/init.d/thttpd
嵌入式Linux ARM thttpd CGI环境配置及简介
- **启动thttpd**:使用命令`/thttpd -C /etc/thttpd.conf`启动thttpd服务。##### 4.
thttpd移植与安全认证配置
"thttpd移植与安全认证配置"本文主要介绍了如何在特定平台上移植轻量级HTTP服务器thttpd,并进行安全认证的配置。thttpd是一个小巧、快速且安全的HTTP服务器,适用于资源有限的环
嵌入式Web环境搭建(BOA,Goahead,Thttpd)
boa.conf 配置文件,并将 /boa 文件夹作为服务器的根目录。
cgictest.zip_thttpd
更新启动脚本或系统服务配置,使得Thttpd在系统启动时自动运行。接下来,配置 boa 和 thttpd 服务器进行测试。


