Tuesday, August 5, 2014

Very light http server: lighttpd

The first thing that I wanted to do after setting up an Access Point on my laptop's wifi (See the previous post) is to setup an http server which is extremely light. My intention was to display some text, maybe some nice picture or a file-list of a directory. So, here is the solution, with a punny name:

https://wiki.archlinux.org/index.php/lighttpd
pacman -S lighttpd



The config file is located at:  
/etc/lighttpd/lighttpd.conf
Check if config file's syntax is correct:  
lighttpd -t -f /etc/lighttpd/lighttpd.conf
Default location of index.html file, according to the default config:
/srv/http

To create the index.html file:
echo 'TestMe!' >> /srv/http/index.html
chmod 755 /srv/http/index.html


Starting and reloading:
systemctl start lighttpd
systemctl reload lighttpd


Enabling over boot:
systemctl enable lighttpd

For PHP, SSL etc, check out the documentation home page.

No comments: