Compilation and configuration of lightweight Web server lighttpd (for x86-linux)

Source: Internet
Author: User

Transferred from: http://blog.163.com/ljf_gzhu/blog/static/131553440201211522317367/

Note:

PC linux:ubuntu-10.10linux User: ROOTLIGHTTPD version: 1.4.30GCC version: 4.4.5 1. Compiling, installing1.1. First download the corresponding version of the package on the LIGHTTPD website: http://www.lighttpd.net/i downloaded the lighttpd-1.4.30.tar.gz1.2. Unzip the tarball to any directory (my/root/desktop/common) to get the folder lighttpd-1.4.301.3. Create a shell script in the folder lighttpd-1.4.30 named: configure-x86.sh1.4. Enter the following code in the shell script configure-x86.sh:#!/bin/sh./configure--prefix=/opt/web/lighttpd-1.4.30-x86--host=i686-pc-linux--build=i686-pc-linux--disable-FEATURE --enable-shared--disable-static--disable-lfs--disable-ipv6--without-package--without-valgrind--without-openssl --without-kerberos5--without-pcre--without-zlib--without-bzip2--without-lua1.5. Open the console and CD into the lighttpd-1.4.30 directory 1.6. To add an executable property to the configure-x86.sh file, execute the command:chmod +x configure-x86.sh1.7. Configure LIGHTTPD, execute command:./configure-x86.sh1.8. Compile the LIGHTTPD and execute the command: Make1.9. Install the LIGHTTPD and execute the command:Make Install1.10. After the installation is complete, generate the Lib, sbin, and share three folders in the installation directory/opt/web/lighttpd-1.4.30-x86 as shown in: 2. Configuration2.1. Manually create the following folder in the installation directory/opt/web/lighttpd-1.4.30-x86: Cache, cgi-bin, config, log, sockets, upload, vhosts, webpages. As shown in: 2.2. Copy the CONFIG.D, lighttpd.conf, and modules.conf from the Doc/config directory in the source package to the Config folder in the installation directory, as shown in: 2.3. Modify the lighttpd.conf file that you just copied 1) Change 16 rows to 20 lines as shown in the following brown bold font: Var.log_root = "/opt/web/lighttpd-1.4.30-x86/log"Var.server_root = "/opt/web/lighttpd-1.4.30-x86"Var.state_dir = "/opt/web/lighttpd-1.4.30-x86"Var.home_dir = "/opt/web/lighttpd-1.4.30-x86"Var.conf_dir = "/opt/web/lighttpd-1.4.30-x86/config"2) Modify the 61 rows and 93 lines as shown in the following brown bold font: Var.cache_dir = server_root + "/cache"Server.use-ipv6 = "Disable"3) Comment out the 104 and 105 lines as follows:#server. Username = "LIGHTTPD"#server. GroupName = "LIGHTTPD"4) Change the 115 rows to the following brown bold font: Server.document-root = server_root + "/webpages"5) Comment out the 127 lines as follows:#server. pid-file = State_dir + "/lighttpd.pid"6) If you do not need to view the error log file, you can comment out the 141 lines as follows:#server. errorlog = log_root + "/error.log"7) Comment out 152 lines, 158 lines, and 191 lines as follows:#include "conf.d/access_log.conf"#include "conf.d/debug.conf"#server. network-backend = "Linux-sendfile"8) According to the system resources set 207 rows and 225 rows of values, the system settings are as follows in the brown bold font as shown: Server.max-fds = theServer.max-connections = -9) Comment out the 314 to 316 lines as follows:# $HTTP ["url"] =~ "\.pdf$" {# server.range-requests = "Disable"#}10) Change the 373 rows to the following brown bold font: Server.upload-dirs = ("/opt/web/lighttpd-1.4.30-x86/upload")  2.4. Modify the modules.conf file just copied over 1) Find 43 lines, position the cursor after the comma, enter, insert the following: "Mod_alias",2) enable the CGI module to remove the 138-line annotation, as follows: include "conf.d/cgi.conf" 2.5.                               Modify the cgi.conf file in the Conf.d folder that you just copied. 1) 15 to 19 lines This section of the configuration is modified as follows: Original content: Cgi.assign = (". Pl" and "/usr/bin/perl",                               ". CGI" = "/usr/bin/perl", ". RB" = "/usr/bin/ruby", ". Erb" = "/usr/bin/eruby", ". Py" and "/usr/bin/python" after the change: cgi.assign = (". CGI" = "" ")#cgi. Assign = (". Pl" and "/usr/bin/perl",# ". cgi" = "/usr/bin/perl",# ". RB" = "/usr/bin/ruby",# ". Erb" = "/usr/bin/eruby",# ". Py" = "/usr/bin/python")2) Remove the 28-line comment as follows: Alias.url + = ("/cgi-bin" + server_root + "/cgi-bin") 3. Run the test3.1. Create a blank document anywhere, and enter the following HTML code in the document:<meta http-equiv= "Content-type" content= "text/html; charset=utf-8" ><title>lighttpd Test </title><body><p> Compilation and configuration of lightweight Web server lighttpd (for x86-linux) </p><p> test Page </p></body>3.2. Save the document as index.html and copy it to the Webpages folder in the installation directory as shown in: 3.3. To open the command console, the CD enters the installation directory of the LIGHTTPD executable file:cd/opt/web/lighttpd-1.4.30-x86/sbin/3.4. Execute the command to start the LIGHTTPD server:./lighttpd-f. /config/lighttpd.conf, as shown in: 3.5. Start a Web browser, such as Google Chrome, enter the local IP address, carriage return, you can browse to the homepage you just created, as shown in: 3.6. To shut down the server:Killall lighttpd   Concluding remarks:Since the purpose of my transplant lighttpd is to develop embedded applications, the settings in the configuration file are configured for the limited resources in the embedded system, and after testing OK, the configuration files can be copied intact to the Development Board for direct application.

Compilation and configuration of lightweight Web server lighttpd (for x86-linux)

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.