Webserver: LIGHTHTTP

Project Name

LIGHTHTTPD

Documentation URL

http://redmine.lighttpd.net/projects/lighttpd/wiki

Page Content By

dziny

Last Updated

September, 08 2014 - 12:58PM MST

These instructions are for Debian/Ubuntu but can be modified for CentOS using the following link
sysadminman.net

Install

Install packages

apt-get install lighttpd php5-cgi spawn-fcgi

Add to /etc/rc.local to start fast cgi on boot

 echo -n "Starting FCGI handler for FreePBX... " /usr/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 4001 -C 2 -u asterisk -g asterisk

Edit /etc/lighthttpd/lighthttpd.conf

 server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_rewrite", "mod_fastcgi", "mod_auth" )   fastcgi.server = ( ".php" => (( "host" => "127.0.0.1", "port" => 4001 )))   $HTTP["remoteip"] !~ "192.168.7|154.147.281.10" { #use this if you want to limit $HTTP["url"] =~ "^/" { #access to listed IPS, in this example url.access-deny = ( "" ) #192.168.7.0/24 and 154.147.281.10/32 } }   server.document-root = "/var/www/html/" #(or /var/www/) server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd/lighttpd.pid" server.username = "asterisk" server.groupname = "asterisk"   index-file.names = ( "index.php", "index.html", "index.htm", "default.htm", " index.lighttpd.html" )   url.access-deny = ( "~", ".inc" )   static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )   include_shell "/usr/share/lighttpd/use-ipv6.pl"   dir-listing.encoding = "utf-8" server.dir-listing = "enable"   compress.cache-dir = "/var/cache/lighttpd/compress/" compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" )   include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

Set Permissions

Edit /etc/cron.daily/lighthttpd to look like

That should be it, after starting lighttpd should work with freebpx running with asterisk owner.

Return to Documentation Home I Return to Sangoma Support