2013年9月30日月曜日

An installation of lighttpd which is light http server for my robots.

HTTPサーバは、Monkeyを使っていたのだが、CGI関連が不安定、情報が少ない、

などの点から、この際、lightthpdに変更。

I had used a Monkey HTTP Server. But CGI  processing was instability, less information of community...
So I decided to change to lighttpd.
This post is how to describe  /etc/lighttpd/ligthttpd.conf.

A setting of lighttpd server is easy.

(1) pacman -S lighttpd

(2) edit a /etc/lighttpd/lighttpd.conf file referring /usr/share/doc/lighttpd/config/conf.d/cgi.conf.

# This is a minimal example config
# See /usr/share/doc/lighttpd
# and http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions

server.port = 80
server.username = "http"
server.groupname = "http"
server.document-root = "/srv/http"
server.errorlog = "/var/log/lighttpd/error.log"
dir-listing.activate = "enable"
index-file.names = ( "index.html" )
mimetype.assign = ( ".html" => "text/html", ".txt" => "text/plain", ".jpg" => "image/jpeg", ".png" => "image/png", "" => "application/octet-stream" )

server.modules += ( "mod_cgi" )

##
## Plain old CGI handling
##
## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
##
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "",
                               ".sh"  => "/usr/bin/bash",
                               ".rb"  => "/usr/bin/ruby",
                               ".erb" => "/usr/bin/eruby",
                               ".py"  => "/usr/bin/python" )

Peace!!

0 件のコメント:

コメントを投稿