Porting thttpd-lightweight Web Server

Source: Internet
Author: User
Port thttpd Web Server

Download
Download thttpd from http://www.acme.com/software/thttpd/

Compile thttpd
Cc =/opt/host/armv4l/bin/armv4l-unknown-linux-gcc./configure host = arm-Linux

VI makefile

SpecifyStatic LinkBinary files
Ldflags = static

Make ldflags = "static"

Configuration

Copy the thttpd binary executable file to the root file system/usr/sbin/directory.
Modify thttpd configuration file

VI thttpd. conf

# This section overrides defaults
Dir =/etc/thttpd/html # specify the root directory path for webserver to store web pages
Chroot
User = root # Run thttpd as root
Logfile =/etc/thttpd/log/thttpd. log # Log File Path
Pidfile =/etc/thttpd/run/thttpd. pid # PID file path

Copy the thttpd. conf configuration file to the MNT/etc/directory of the root file system,
After the system is loaded, the linuxrc script automatically copies all files under MNT/etc/to the/etc directory.

Transfer to the root file system directory and create the corresponding file

Directory structure under the thttpd directory
| Html
| 'Index.
Default HTML file under the root directory of the HTML Web Server webpage
| Log
| 'Thttpd.
Log to create an empty file
'Run
'Thttpd.
PID to create an empty file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.