How to Configure Basic Setup for lighttpd on CentOS 6.3

Share this Article :

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 :

[[email protected] ~]# 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:

[[email protected] ~]# lighttpd -t -f /etc/lighttpd/lighttpd.conf
Syntax OK

3. Start lighttpd service :

[[email protected] ~]# /etc/init.d/lighttpd start
Starting lighttpd:                                         [  OK  ]

4. Stop lighttpd service :

[[email protected] ~]# /etc/init.d/lighttpd stop
Stopping lighttpd:                                         [  OK  ]

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

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

Leave a Reply