The development of embedded web servers in the past two daysSource codeFor mini_httpd-1.19. Now summarize the mini_httpd-1.19 configuration and installation method, as follows:
1. Download mini_httpd-1.19 SourceCode: Http://www.acme.com/software/mini_httpd/
2. decompress the file: Tar zxvf mini_httpd-1.19.tar.gz
3. Compile and install (the compiling and installation environment is fedora)
CD mini_httpd-1.19
Make
Make install
4. Create a directory for storing web pages and CGI:
Mkdir mini
Mkdir mini/wwwroot
Mkdir mini/wwwroot/cgi-bin
5. Create a configuration file: VI mini/mini_httpd.conf. The configuration file is as follows:
Port = 8080
Dir =/home/yinfeng/webserver/mini_httpd/mini_httpd-1.20/mini/wwwroot
Cgipat = cgi-bin /*
User = nobody
Pidfile =/home/yinfeng/webserver/mini_httpd/mini_httpd-1.20/mini_httpd.pid
Logfile =/home/yinfeng/webserver/mini_httpd/mini_httpd-1.20/mini_httpd.log
6. Place the webpage in the wwwroot directory;
7. Start the mini_httpd Server
/Usr/local/sbin/mini_httpd-C/home/yinfeng/webserver/mini _ httpd/mini_httpd-1.19/mini/mini_httpd.conf
8. Access the mini_httpd server in the client browser and enter:
Localhost: 8080
If the access succeeds, the mini_httpd server is successfully started and can be accessed.