当前位置:首页 > 开发 > 互联网 > 正文

the lighttpd 1.4.29 -- startup script

发表于: 2011-08-31   作者:coolesting   来源:转载   浏览:
摘要: Solution 1 : Coping this  http://redmine.lighttpd.net/wiki/1/ScriptsUbuntu to your folder /etc/init.d/lighttpd, and fix the path in that file as the following. USER=www-data GROU
Solution 1 :

Coping this  http://redmine.lighttpd.net/wiki/1/ScriptsUbuntu
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   

the lighttpd 1.4.29 -- startup script

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号