1、开始为了了解thttp移植过程,就先尝试再ubuntu上安装使用thttp,因此也谈不上移植。
但是步骤都是类似,属于过度性的学习。
2、安装步骤
(1)源码包
解压thttpd-2.25b.tar.gz
http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
#tar -zxvf thttpd-2.25b.tar.gz
cd thttpd-2.25b //进入文件夹
(2)配置和安装
CC=arm-linux-gcc ./configure --target=arm-linux --prefix=/ubuntu_thttpd
make
make install
错误a: 当中如果有错误提示:提示错误:chgrp: 无效的组名称‘‘www’’
那么可以采用下面的语句: addgroup www
错误b: cp: 无法创建一般文件“/usr/local/man/man1/makeweb.1”: 没有那个文件或目录
解决的办法是:在{$prefix}/usr/local/man/目录下手动创建man1目录
安装完成:
(3)建立服务器文件夹
cd /home
mkdir thttpd
cd thttpd
mkdir html run log
html(然后在下面编写一个测试的网页程序index.html)
(4)启动thttpd服务器
thttpd.conff 这个是服务器配置文件,在启动属性是根据其来启动。
4-1:复制thttpd.conf文件
root@lin-desktop:/home/soft/thttpd-2.25b# cp contrib/redhat-rpm/thttpd.conf /home/ubuntu_thttpd
4-2:修改内容
1 # This section overrides defaults
2 dir=/httpd/html
3 chroot
4 user=root# default = nobody
5 logfile=/httpd/log/thttpd.log
6 pidfile=/httpd/run/thttpd.pid
7 # This section _documents_ defaults in effect
8 port=80
9 # nosymlink# default = !chroot
10 # novhost
11 # nocgipat
12 # nothrottles
13 # host=0.0.0.0
14 # charset=iso-8859-1
************************************************************************************************************************
/home/ubuntu_thtttpd/sbin/thttpd -C /home/thttpd/thttpd.conf
5、测试程序
在浏览器上输入ubuntu系统的IP
http://10.3.77.192/index.html
5-1:此时会有告警
网上说这个是对于测试文件没有修改属性的原因
chmod 666 /home/ubuntu_thttpd/html/index.html