#!/bin/bash hvconfig_pre() { groupadd -f ${APACHE_USER} hv_useradd -c WebServer -d /dev/null -g ${APACHE_USER} -s /bin/false \ ${APACHE_USER} } hvbuild_post() { cd ${LFS_TMP}/${PACKAGE} install -dv \ /etc/lighttpd \ /var/log/lighttpd \ /var/lib/lighttpd \ /var/lib/lighttpd/sockets \ /var/cache/lighttpd cp -R doc/config/conf.d/ doc/config/*.conf doc/config/vhosts.d/ \ /etc/lighttpd/ chown -R www.www \ /etc/lighttpd \ /var/log/lighttpd \ /var/lib/lighttpd \ /var/lib/lighttpd/sockets \ /var/cache/lighttpd # Modifying the configuration file to run the server as a dedicated user: sed -i \ -e "s!^\(server\.username\).*!\1 = \"www\"!" \ -e "s!^\(server\.groupname\).*!\1 = \"www\"!" \ /etc/lighttpd/lighttpd.conf # Disable IPV6 sed -i \ -e "s!^\(server\.use-ipv6\).*!\1 = \"disable\"!" \ /etc/lighttpd/lighttpd.conf # Enable fastgcgi module sed -i \ -e "s!^#\(include \"conf\.d/fastcgi\.conf\"\).*!\1!" \ /etc/lighttpd/modules.conf # astcgi config cat > /etc/lighttpd/conf.d/fastcgi.conf << "EOF" && server.modules += ( "mod_fastcgi" ) fastcgi.server = ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => socket_dir + "/php-fastcgi.socket" ))) EOF chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/www # Bootscript cp -p doc/initscripts/sysconfig.lighttpd /etc/sysconfig/lighttpd install -v -m740 ${SCRDIR}/bootscripts/lighttpd /etc/rc.d/init.d # script-name start stop bootscript_add_rc3 lighttpd 70 20 }