micro_httpd的安装与配置

Posted on 2013-12-26 17:33  千岛湖  阅读(1438)  评论(0)    收藏  举报

第一步 下载安装

cd /usr/local/src

# wget http://www.acme.com/software/micro_httpd/micro_httpd_12dec2005.tar.gz

# tar -xzvf micro_httpd_12dec2005.tar.gz

# cd micro_httpd

# make

# make install

第二步 配置/etc/services文件
假设我们的micro_httpd将使用8000端口
先搜一下有没有使用8000端口的 如果有 在行首加#把他们注释掉 追加micro_httpd

?

1

2

3

4

5

# vi /etc/services

# irdmi          8000/tcp                        # iRDMI

# irdmi          8000/udp                        # iRDMI

micro_httpd     8000/tcp

micro_httpd     8000/udp

第三步 建立xinetd守护文件(如果你的系统没有/var/www/html目录,请自行创建或者改成你期望的已经存在的目录)

?

1

2

3

4

5

6

7

8

9

10

11

12

# vi /etc/xinetd.d/micro_httpd

service micro_httpd

{

        socket_type             = stream

        protocol                = tcp

        wait                    = no

        user                    = root

        server                  = /usr/local/sbin/micro_httpd

        server_args             = /var/www/html

        disable                 = no

        flags                   = IPv4

}

第三步 启动xinetd(如果xinetd已经启动 请把start参数换成restart)

?

1

# /etc/init.d/xinetd start

第四步 创建一个测试网页/var/www/html/index.html

?

1

# echo "hello" > /var/www/html/index.html

第五步 测试
在浏览器里输入

http://ip:8000/index.html

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3