Solution 1 :
Coping this [url]http://redmine.lighttpd.net/wiki/1/ScriptsUbuntu[/url]
to your folder /etc/init.d/lighttpd, and fix the path in that file as the following.
Solution 2:
coping this script to your /etc/init.d/lighttpd (if the file is not existing, just create it)
and then, typing the command in terminal for your operation you want.
/etc/init.d/lighttpd start
/etc/init.d/lighttpd stop
/etc/init.d/lighttpd restart
Coping this [url]http://redmine.lighttpd.net/wiki/1/ScriptsUbuntu[/url]
to your folder /etc/init.d/lighttpd, and fix the path in that file as the following.
USER=www-data
GROUP=www-data
PATH=/sbin:/bin:/usr/sbin:/usr/bin
LIGHTY_DAEMON=/usr/local/lighttpd/sbin/lighttpd
LIGHTY_OPTS="-f /etc/lighttpd/lighttpd.conf"
LIGHTY_NAME=lighttpd
LIGHTY_PIDFILE=/var/run/$LIGHTY_NAME.pid
SCRIPTNAME=/etc/init.d/$LIGHTY_NAME
SSD="/sbin/start-stop-daemon"
PHP_FCGI_CHILDREN=10
PHP_FCGI_MAX_REQUESTS=1000
RETVAL=0
FCGI_DAEMON="/usr/bin/spawn-fcgi"
FCGI_PROGRAM="/usr/bin/php-cgi"
FCGI_PORT="4050"
FCGI_SOCKET="/tmp/php-fastcgi.sock"
FCGI_PIDFILE="/var/run/spawn-fcgi.pid"
Solution 2:
coping this script to your /etc/init.d/lighttpd (if the file is not existing, just create it)
#!/bin/sh
LIGHTTPD_BIN=/usr/local/lighttpd/sbin/lighttpd
test -x $LIGHTTPD_BIN || exit 5
LIGHTTPD_CONFIG=/etc/lighttpd/lighttpd.conf
test -r $LIGHTTPD_CONFIG || exit 6
LIGHTTPD_PIDFILE=/var/run/lighttpd.pid
LIGHTTPD_LOGFILE=/var/log/lighttpd/access.log
case "$1" in
start)
echo "Starting lighttpd"
$LIGHTTPD_BIN -f $LIGHTTPD_CONFIG
;;
stop)
echo "Shutting down lighttpd"
kill `cat $LIGHTTPD_PIDFILE`
;;
restart)
$0 stop
sleep 1
$0 start
;;
force-reload|reload)
echo "Reload service lighttpd"
kill -INT `cat $LIGHTTPD_PIDFILE`
$0 start
touch $LIGHTTPD_PIDFILE
;;
rotate)
echo "Rotate logfile of lighttpd"
mv $LIGHTTPD_LOGFILE /tmp/`date +%D`.log
kill -HUP `cat $LIGHTTPD_PIDFILE`
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|reload|rotate}"
exit 1
;;
esac
and then, typing the command in terminal for your operation you want.
/etc/init.d/lighttpd start
/etc/init.d/lighttpd stop
/etc/init.d/lighttpd restart