Installing Lighttpd by Compiling the Source Code
- Obtain the Lighttpd source code.
- 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
- 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.
1cd /home
1wget https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.53.tar.gz --no-check-certificate
- Download the Lighttpd source code from a local browser.
- Switch to the home directory.
1cd /home/
- Decompress the Lighttpd installation package.
1tar -zxvf lighttpd-1.4.53.tar.gz
- Go to the lighttpd-1.4.53 directory.
1cd /home/lighttpd-1.4.53/
- 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.
- Compile and install Lighttpd.
1make -j60 && make install
- Create a folder in the installation directory.
1cd /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.
- Copy the Lighttpd configuration files lighttpd.conf, modules.conf, and conf.d to the installation path /usr/local/lighttpd/config.
1cp /home/lighttpd-1.4.53/doc/config/lighttpd.conf /usr/local/lighttpd/config
1cp /home/lighttpd-1.4.53/doc/config/modules.conf /usr/local/lighttpd/config
1cp -r /home/lighttpd-1.4.53/doc/config/conf.d /usr/local/lighttpd/config
- View the installation directory.
1ls /usr/local/lighttpd
Parent topic: Installing Lighttpd