How to Configure Basic Setup for lighttpd on CentOS 6.3

Lighttpd is a secure, fast, compliant, and highly adaptable web server that has been fine-tuned for high-performance environments. It stands out due to its minimal memory footprint compared to other web servers and its efficient management of CPU load.

This tutorial will guide you through the basic setup of Lighttpd on CentOS 6.3. For instructions on how to install Lighttpd, you can refer to our previous post on the topic.

Step 1: Configuring Basic Lighttpd Setup

First, you need to configure the basic setup for Lighttpd. Open the Lighttpd configuration file by typing the following command:

[root@centos63 ~]# vi /etc/lighttpd/lighttpd.conf

In the configuration file, set the following parameters:

var.log_root = "/var/log/lighttpd"
var.server_root = "/var/www"
var.state_dir = "/var/run"
var.home_dir = "/var/lib/lighttpd"
var.conf_dir = "/etc/lighttpd"
server.port = 80
server.use-ipv6 = "disable"
server.document-root = server_root + "/lighttpd"
server.max-connections = 512

Step 2: Checking the Lighttpd Configuration for Syntax Errors

To ensure that your Lighttpd configuration file is free of syntax errors, you can use the following command:

[root@centos63 ~]# lighttpd -t -f /etc/lighttpd/lighttpd.conf

If your configuration file is correct, you should see the message “Syntax OK”.

Step 3: Starting the Lighttpd Service

To start the Lighttpd service, use the following command:

[root@centos63 ~]# /etc/init.d/lighttpd start

You should see the message “Starting lighttpd: [ OK ]” if the service starts successfully.

See also  How to Setup HAProxy as Load Balancer for Apache on CentOS

Step 4: Stopping the Lighttpd Service

If you need to stop the Lighttpd service, you can do so with the following command:

[root@centos63 ~]# /etc/init.d/lighttpd stop

You should see the message “Stopping lighttpd: [ OK ]” if the service stops successfully.

Step 5: Creating a Test HTML Page

To verify that your Lighttpd server is working correctly, you can create a test HTML page and access it through a web browser. Use the following command to create the test page:

[root@centos63 ~]# vi /var/www/lighttpd/index.html

In the file, you can add the following HTML code:

<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Lighttpd Test Page

After saving and closing the file, you can open a web browser and navigate to your server’s IP address or domain name to view the test page.

Commands Mentioned

  • vi /etc/lighttpd/lighttpd.conf – Opens the Lighttpd configuration file for editing.
  • lighttpd -t -f /etc/lighttpd/lighttpd.conf – Checks the Lighttpd configuration file for syntax errors.
  • /etc/init.d/lighttpd start – Starts the Lighttpd service.
  • /etc/init.d/lighttpd stop – Stops the Lighttpd service.
  • vi /var/www/lighttpd/index.html – Creates a test HTML page for the Lighttpd server.
See also  How to Install Lighttpd With PHP5 (PHP-FPM) and MySQL on CentOS 6.5


Lighttpd is a powerful web server that is optimized for high-performance environments. Its low memory footprint and efficient CPU load management make it an excellent choice for high-traffic websites. This tutorial has guided you through the basic setup of Lighttpd on CentOS 6.3, including configuring the server, checking for syntax errors, starting and stopping the service, and creating a test HTML page. By following these steps, you can successfully set up and run your own Lighttpd server.

For more information on web servers, you can visit our pages on Apache, Nginx, and LiteSpeed. If you’re interested in different types of hosting, you can check out our pages on dedicated server hosting, virtual server hosting, cloud hosting, and shared hosting.


  1. What is the purpose of the Lighttpd configuration file?

    The Lighttpd configuration file is where you can set various parameters for your Lighttpd server, such as the server root, log root, state directory, home directory, configuration directory, server port, IPv6 usage, document root, and maximum connections.

  2. How can I check for syntax errors in my Lighttpd configuration file?

    You can check for syntax errors in your Lighttpd configuration file by using the command ‘lighttpd -t -f /etc/lighttpd/lighttpd.conf’. If there are no syntax errors, you will see the message ‘Syntax OK’.

  3. How do I start and stop the Lighttpd service?

    You can start the Lighttpd service by using the command ‘/etc/init.d/lighttpd start’ and stop it by using the command ‘/etc/init.d/lighttpd stop’.

  4. How can I create a test HTML page for my Lighttpd server?

    You can create a test HTML page for your Lighttpd server by using the command ‘vi /var/www/lighttpd/index.html’ and adding your desired HTML code to the file.

  5. What is the advantage of using Lighttpd?

    Lighttpd is known for its speed, security, compliance, and flexibility. It has been optimized for high-performance environments and has a very low memory footprint compared to other web servers. It also efficiently manages CPU load, making it a great choice for high-traffic websites.


Leave a Reply

Your email address will not be published. Required fields are marked *