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 *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>