zoukankan      html  css  js  c++  java
  • 移植 thttpd Web 服务器

    下载

    http://www.acme.com/software/thttpd/ 下载 thttpd 到/tmp 目录当中,并解压.

    编译 thttpd

    [arm@localhost thttpd­2.25b]$ CC=arm­linux­gcc ./configure ­­host=arm­linux [arm@localhost thttpd­2.25b]$ vi Makefile

    指定静态链接二进制文件

    LDFLAGS =         ­static

    [arm@localhost thttpd­2.25b]$ make LDFLAGS="­static"

    配置

    拷贝 thttpd 二进制可执行文件到根文件系统/usr/sbin/目录中

    [arm@localhost thttpd­2.25b]$ cp thttpd /home/arm/dev_home/rootfs/my_rootfs/usr/sbin/

    修改 thttpd 配置文件

    [arm@localhost thttpd­2.25b]$ vi contrib/redhat­rpm/thttpd.conf

    # This section overrides defaults

    dir=/etc/thttpd/html                           #指明 WebServer 存放网页的根目录路径 chroot

    user=root                                              #以 root 身份运行 thttpd

    logfile=/etc/thttpd/log/thttpd.log     #日志文件路径 pidfile=/etc/thttpd/run/thttpd.pid    #pid 文件路径

    拷贝 thttpd.conf 配置文件到根文件系统的 mnt/etc/目录, 系统加载后,linuxrc 脚本会自动将 mnt/etc/下的所有文件拷贝到/etc 目录中。

    [arm@localhost thttpd­2.25b]$ cp contrib/redhat­rpm/thttpd.conf /home/arm/dev_home/rootfs/my_rootfs/mnt/etc/

    转移到根文件系统目录,创建相应的文件

    [arm@localhost etc]$ cd /home/arm/dev_home/rootfs/my_rootfs [arm@localhost my_rootfs]$ cd mnt/etc/

    创建 thttpd 目录

    [arm@localhost etc]$ mkdir thttpd [arm@localhost etc]$ cd thttpd thttpd 目录下的目录结构

    |­­ html

    |  `­­ index.html Web Server 网页根目录下的默认 HTML 文件

    |­­ log

    |   `­­ thttpd.log 创建一个空文件就可

    `­­ run

    `­­ thttpd.pid 创建一个空文件就可

    html 目录下的 index.html 文件内容如下:

    <html>

    <head>

    </head>

    <body>


    <title> Welcome to here^^ </title>

    <marquee>

    <font color=red>

    Welcome to here^^!!!

    </body>

    </html>

    </font>

    </marquee>

  • 相关阅读:
    redis 中 发布订阅 的 数据类型
    excelExport.js 导出 excel 表格
    Go 出现:err is shadowed during return(err在返回过程中被隐藏)
    Go 服务端 向 firebase Android 端 fcm 信息
    Python全栈day 03
    Python全栈day 01
    开发流程与版本管理规范
    php 魔术常量
    sql 消除重复
    重置mysql密码
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11105678.html
Copyright © 2011-2022 走看看