Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Lighttpd by Compiling the Source Code

  1. Obtain the Lighttpd source code.
    1. Download the Lighttpd source code from a local browser.

      Download address: https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.53.tar.gz

    2. Copy the source code to the /home directory on the server.

      If the server is connected to the Internet, you can run the wget command on the server to download the source code.

      1
      cd /home
      
      1
      wget https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.53.tar.gz --no-check-certificate
      
  2. Switch to the home directory.
    1
    cd /home/
    
  3. Decompress the Lighttpd installation package.
    1
    tar -zxvf lighttpd-1.4.53.tar.gz
    
  4. Go to the lighttpd-1.4.53 directory.
    1
    cd /home/lighttpd-1.4.53/
    
  5. Configure Lighttpd.
    1
    ./configure  --prefix=/usr/local/lighttpd  --with-fam
    
    • --prefix=PATH specifies the Lighttpd installation directory.
    • --with-fam reduces the number of times that stat() is called.
  6. Compile and install Lighttpd.
    1
    make -j60 && make install
    
  7. Create a folder in the installation directory.
    1
    cd /usr/local/lighttpd/ && mkdir log webpages cache config
    

    After Lighttpd is installed, only three folders lib, sbin, and share exist in the installation directory. Other files need to be copied and created.

  8. Copy the Lighttpd configuration files lighttpd.conf, modules.conf, and conf.d to the installation path /usr/local/lighttpd/config.
    1
    cp /home/lighttpd-1.4.53/doc/config/lighttpd.conf  /usr/local/lighttpd/config
    
    1
    cp /home/lighttpd-1.4.53/doc/config/modules.conf  /usr/local/lighttpd/config
    
    1
    cp -r /home/lighttpd-1.4.53/doc/config/conf.d  /usr/local/lighttpd/config
    
  9. View the installation directory.
    1
    ls /usr/local/lighttpd