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