移植thttpd Web服务器

来源:互联网 发布:网络推广的综合方案 编辑:程序博客网 时间:2024/04/25 15:36

thttpd是个小型的web服务器。是移植到arm的不错选择,今天配置了一下,其中遇到了一些问题。当自己做个备份,也分享一下自己的配置经验吧。

CC=arm-linux-gcc ./configure --host=arm-linux-gcc
vi Makefile
/*指定静态编译,就可以省去动态库的移动*/
LDFLAGS=   -staticmake LDFLAGS="-static"
cp thttpd /usr/sbin(可以直接使用thttpd命令)
vi thttpd/contrib/redhat-rpm/thttpd.conf
/*-----修改内容如下------*/
dir=/etc/thttpd/html
#指明 WebServer 存放网页的根目录路径
chroot
user=root
#以 root 身份运行 thttpd
logfile=/etc/thttpd/log/thttpd.log #日志文件路径
pidfile=/etc/thttpd/run/thttpd.pid #pid 文件路径

/*其中这些变量的设置因实际情况而定*/
cp  thttpd/contrib/redhat-rpm/thttpd.conf /etc
cd /home( 开发板上的目录 )
mkdir thttpd
cd thttpd
mkdir html

(有个index.html文件)
mkdir log
(thttpd.log)//空文件
mkdir run
(thttpd.pid)//空文件


放置一个index.html文件到html里面
测试:
 thttpd  -C  /etc/thttpd.conf

然后用打开浏览器,输入开发板ip即可访问。

如果遇到./thttpd: unknown user - 'root'的问题,请检查thttpd.conf文件。


原创粉丝点击