How to Configure Basic Setup for lighttpd on CentOS 6.3

lighttpd is a secure, fast, compliant, and very flexible web-server that has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load. This post will show you the basic lighttpd setup on CentOS 6.3. Refer to previous post to install lighttpd.

1. Configure basic lighttpd setup :

[root@centos63 ~]# vi /etc/lighttpd/lighttpd.conf
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

2. To check your lighttpd.conf for Syntax error, you can use this command, it can helps to find any misconfigurations easily:

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

3. Start lighttpd service :

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

4. Stop lighttpd service :

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

5. Create a HTML test page and access to it with web browser :

[root@centos63 ~]# vi /var/www/lighttpd/index.html
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Lighttpd Test Page
Leave a Reply

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

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.


* up to 30 days money back guarantee