~$sudo /etc/init.d/lighttpd restart * StopPing web server lighttpd ...done. * Starting web server lighttpd2009-06-13 04:06:36: (network.c.300) can't bind to port: 80 Address already in use ...fail!
重新加载时会发生同样的错误.
我解决它的方法是杀死lighttpd然后发出启动命令,但似乎我不应该这样做:)
我查看了我的配置文件,无法发现任何即时错误.有没有人有任何想法可能导致此错误?这似乎是写这个问题的最新版本,可以通过apt-get路线获得.
我的配置文件是:
# Debian lighttpd configuration file# ############ Options you really have to take care of ###################### modules to load# mod_access,mod_accesslog and mod_alias are loaded by default# all other module should only be loaded if neccesary# - saves some time# - saves memoryserver.modules = ( "mod_access","mod_alias","mod_accesslog","mod_compress","mod_fastcgi","mod_rewrite","mod_redirect",)## a static document-root,for virtual-hosting take look at the ## server.virtual-* optionsserver.document-root = "/var/www/"## where to send error-messages toserver.errorlog = "/var/log/lighttpd/error.log"fastcgi.server = (".PHP" => (( "bin-path" => "/usr/bin/PHP5-cgi","socket" => "/tmp/PHP.socket"))) ## files to check for if .../ is requestedindex-file.names = ( "index.PHP","index.HTML","index.htm","default.htm","index.lighttpd.HTML" )## Use the "Content-Type" extended attribute to obtain mime type if possible# mimetype.use-xattr = "enable"#### accesslog moduleaccesslog.filename = "/var/log/lighttpd/access.log"## deny access the file-extensions## ~ is for backupfiles from vi,emacs,joe,...# .inc is often used for code includes which should in general not be part# of the document-rooturl.access-deny = ( "~",".inc" )### which extensions should not be handle via static-file transfer## .PHP,.pl,.fcgi are most often handled by mod_fastcgi or mod_cgistatic-file.exclude-extensions = ( ".PHP",".pl",".fcgi" )mimetype.assign = ( ".pdf" => "application/pdf",".sig" => "application/pgp-signature",".spl" => "application/futuresplash",".class" => "application/octet-stream",".ps" => "application/postscript",".torrent" => "application/x-bittorrent",".dvi" => "application/x-dvi",".gz" => "application/x-gzip",".pac" => "application/x-ns-proxy-autoconfig",".swf" => "application/x-shockwave-flash",".tar.gz" => "application/x-tgz",".tgz" => "application/x-tgz",".tar" => "application/x-tar",".zip" => "application/zip",".mp3" => "audio/mpeg",".m3u" => "audio/x-mpegurl",".wma" => "audio/x-ms-wma",".wax" => "audio/x-ms-wax",".ogg" => "audio/x-wav",".wav" => "audio/x-wav",".gif" => "image/gif",".jpg" => "image/jpeg",".jpeg" => "image/jpeg",".png" => "image/png",".xbm" => "image/x-xbitmap",".xpm" => "image/x-xpixmap",".xwd" => "image/x-xwindowdump",".CSS" => "text/CSS",".HTML" => "text/HTML",".htm" => "text/HTML",".Js" => "text/JavaScript",".asc" => "text/plain",".c" => "text/plain",".conf" => "text/plain",".text" => "text/plain",".txt" => "text/plain",".dtd" => "text/xml",".xml" => "text/xml",".RSS" => "application/RSS+xml",".mpeg" => "vIDeo/mpeg",".mpg" => "vIDeo/mpeg",".mov" => "vIDeo/quicktime",".qt" => "vIDeo/quicktime",".avi" => "vIDeo/x-msvIDeo",".asf" => "vIDeo/x-ms-asf",".asx" => "vIDeo/x-ms-asf",".wmv" => "vIDeo/x-ms-wmv",".bz2" => "application/x-bzip",".tbz" => "application/x-bzip-compressed-tar",".tar.bz2" => "application/x-bzip-compressed-tar" )include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
我的/etc/init.d/lighttpd脚本是(未安装):
#!/bin/sh### BEGIN INIT INFO# ProvIDes: lighttpd# required-Start: networking# required-Stop: networking# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start the lighttpd web server.### END INIT INFOPATH=/sbin:/bin:/usr/sbin:/usr/binDAEMON=/usr/sbin/lighttpdname=lighttpdDESC="web server"PIDfile=/var/run/$name.pIDSCRIPTname=/etc/init.d/$nameENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"SSD="/sbin/start-stop-daemon"DAEMON_OPTS="-f /etc/lighttpd/lighttpd.conf"test -x $DAEMON || exit 0set -e# be sure there is a /var/run/lighttpd,even with tmpfsmkdir -p /var/run/lighttpd > /dev/null 2> /dev/nullchown www-data:www-data /var/run/lighttpdchmod 0750 /var/run/lighttpd. /lib/lsb/init-functionscase "" in start) log_daemon_msg "Starting $DESC" $name if ! $ENV $SSD --start --quIEt\ --pIDfile $PIDfile --exec $DAEMON -- $DAEMON_OPTS ; then log_end_msg 1 else log_end_msg 0 fi ;; stop) log_daemon_msg "StopPing $DESC" $name if $SSD --quIEt --stop --oknodo --retry 30\ --pIDfile $PIDfile --exec $DAEMON; then rm -f $PIDfile log_end_msg 0 else log_end_msg 1 fi ;; reload) log_daemon_msg "Reloading $DESC configuration" $name if $SSD --stop --signal 2 --oknodo --retry 30\ --quIEt --pIDfile $PIDfile --exec $DAEMON; then if $ENV $SSD --start --quIEt \ --pIDfile $PIDfile --exec $DAEMON -- $DAEMON_OPTS ; then log_end_msg 0 else log_end_msg 1 fi else log_end_msg 1 fi ;; restart|force-reload) stop [ -r $PIDfile ] && while pIDof lighttpd |\ grep -q `cat $PIDfile 2>/dev/null` 2>/dev/null ; do sleep 1; done start ;; *) echo "Usage: $SCRIPTname {start|stop|restart|reload|force-reload}" >&2 exit 1 ;;esacexit 0解决方法 听起来你的“停止”脚本实际上并没有干净地停止服务器.
你可以发布你的/etc/init.d/lighttpd文件吗?
总结以上是内存溢出为你收集整理的linux – Lighttpd没有干净地重启(地址已经在使用中)全部内容,希望文章能够帮你解决linux – Lighttpd没有干净地重启(地址已经在使用中)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)