Apache hängt sich auf (vserver basic s4y)

TMC

Registered User
Tach zusammen,

ich habe mit unserem vServer das Problem, dass sich jetzt schon zum zweiten Mal in zwei Tagen der apache aufhängt (jeweils in den Abendstunden, wenn auf unserer Seite etwas mehr los ist).

Wenn ich dann versuche den apache per SSH neu zu starten, sieht das so aus:

# /etc/init.d/apache2 restart
/etc/init.d/apache2: line 12: [M: command not found
[Sun Jan 02 19:02:25 2005] [crit] (105)No buffer space available: alloc_listener: failed to get a socket for 0.0.0.0
Syntax error on line 19 of /etc/apache2/listen.conf:
Listen setup failed

Da ich (noch) nicht so der Linux experte bin, wäre es schön, wenn mir einer von euch erklären könnte, was mir diese Meldung sagen will und was die Ursache sein könnte? könnte das Ganze ein Lastproblem sein? ist ja nur ein vServer basic und es läuft u.a. ein Forum mit 6000 Usern drauf (wovon allerdings höchstens 20 gleichzeitig on sind.)

Bis jetzt konnte ich das Problem zwar immer lösen, in dem ich einen kompletten Reboot beauftragt habe, aber das kann ja nicht jeden Tag so gehen... man ist ja auch nicht immer da.

Der Wechsel zu einem vServer max ist jetzt schon beauftragt, denkt ihr das könnte das Problem lösen oder liegt es an was anderem?

Danke schonmal für ihre Tips!
 
Last edited by a moderator:
Hallo!
Dieser Fehler ist mir bis heute noch nicht untergekommen. Ich vermute es gibt zwei mögliche Fehlerquellen:
1. (Lokales) Netzwerkproblem. Eher unwahrscheinlich. Dieser Fehler soll bei Fehlerhaften TCP/IP Stacks schon aufgetreten sein.
2. Speichermangel. Schon eher möglich, gerade auf einem vServer.

Schau mal nach, ob auf dem Server noch irgendwelche Apache-Prozesse laufen.
Wirf auch mal einen Blick in deine httpd.conf. Besonders die Einträge MinSpareServers, MaxSpareServers, MaxCllients und StartServers wären hier von Interesse.
Auch der Inhalt der Datei /proc/user_beancounters ist mal einen Blick wert. Last but not least: Welches OS (Version) hast du installiert?

PS: Ja, viel besser so :).

mfG
Thorsten
 
Hi Thorsten,

ja auf ein Speicherproblem hab ich auch getippt, darum halt auch das Upgrade auf vServer max. Zu den laufenden Prozessen kann ich nicht viel sagen, da ich wie gesagt noch ziemlicher Linux noob bin und die httpd.conf durch die Unmengen von includes doch sehr unübersichtlich ist und ich nicht weiß in welcher der "includeten" Dateien ich suchen muss - Betriebssystem ist also wie man unschwer erkennen kann Suse ;-).

Auf jeden Fall läuft das System noch in seiner Ausgangskonfiguration, außer dass ich mod_rewrite aktiviert habe, wurde nichts geändert.

Bei dem heutigen Ausfall wurde der Apache erst zusehens langsamer (teilweise hat es Minuten gedauert, bis eine Seite aufgebaut war) und blieb dann ganz stehen. Gestern war ich zum Zeitpunkt des Ausfalls nicht da, kann also nix konkretes dazu sagen. Der Neustart des Apaches per SSH ging da aber auch nicht, mit der gleichen Fehlermeldung.

Wir hatten vorher nen Racer Turbo (Webhosting) aber der war der Sache nicht gewachsen weswegen wir uns dann mehr oder weniger zu nem vServer entschließen "mussten". Zwar ist unsere mySQL-Datenbank aufgrund des Forums ca. 40MB groß ist (und wächst). Jedoch dachte ich, dass das für einen vServer doch kein Problem sein sollte?

Hab auch schon ein Ticket mit der Fehlermeldung eröffnet, das war allerdings schon vor mehr als 24h. Vielleicht kümmert sich ja jemand drum, wenn das Upgrade auf vServer max abgeschlossen ist. (10 Tage Anfangssupport sind gerade um).

Wäre schön, wenn du mir trotzdem helfen könntest.

mfG

Thomas
 
Hallo!
OK, bei SuSE Standardkonfiguration stehen die Intressanten Dinge in /etc/apache2/server-tuning.conf. Wenn ihr ein Forum einsetzt - welches? Was läuft sonst noch auf dem Server? Gibt es eine URL, das man sich das mal ansehen kann? Apache mal mit graceful neu starten. Damit noch laufende Prozesse sauber beendet werden.

mfG
Thorsten
 
Hi,
also Forums Software ist phpBB.
und die server-tuning.conf sieht so aus (hab mal die ganze Datei genommen, sorry):
Code:
##
## Server-Pool Size Regulation (MPM specific)
##

# the MPM (multiprocessing module) is not a dynamically loadable module in the
# sense of other modules. It is a compile time decision which one is used. We
# provide different apache2 MPM packages, containing different httpd2 binaries
# compiled with the available MPMs. See APACHE_MPM in /etc/sysconfig/apache2.

# prefork MPM
<IfModule prefork.c>
        # number of server processes to start
StartServers         1
        # minimum number of server processes which are kept spare
MinSpareServers      1
        # maximum number of server processes which are kept spare
MaxSpareServers      2
        # maximum number of server processes allowed to start
MaxClients           15
        # maximum number of requests a server process serves
MaxRequestsPerChild  1000
</IfModule>

# worker MPM
<IfModule worker.c>
        # initial number of server processes to start
StartServers         1
        # minimum number of worker threads which are kept spare
MinSpareThreads      10
        # maximum number of worker threads which are kept spare
MaxSpareThreads      35
        # maximum number of simultaneous client connections

MaxClients           15
        # constant number of worker threads in each server process
ThreadsPerChild      15
        # maximum number of requests a server process serves
MaxRequestsPerChild  1000
</IfModule>

# leader MPM
<IfModule leader.c>
        # initial number of server processes to start
StartServers         1
        # minimum number of worker threads which are kept spare
MinSpareThreads      10
        # maximum number of worker threads which are kept spare
MaxSpareThreads      35
        # maximum number of simultaneous client connections
MaxClients           15
        # constant number of worker threads in each server process
ThreadsPerChild      15
        # maximum number of requests a server process serves
MaxRequestsPerChild  1000
</IfModule>

# perchild MPM
<IfModule perchild.c>
        # constant number of server processes
        NumServers           5
        # initial number of worker threads in each server process
        StartThreads         5
        # minimum number of worker threads which are kept spare
MinSpareThreads      10
        # maximum number of worker threads which are kept spare
MaxSpareThreads      35
        # maximum number of worker threads in each server process
        MaxThreadsPerChild  20
        # maximum number of connections per server process

MaxRequestsPerChild  1000

        AcceptMutex fcntl
</IfModule>

# metux MPM
<IfModule metuxmpm.c>
        # initial number of worker threads in each server process
        StartThreads          5
        # minimum number of worker threads which are kept spare
MinSpareThreads      10
        # maximum number of worker threads which are kept spare
MaxSpareThreads      35
        # maximum number of connections per server process
MaxRequestsPerChild  1000

        Multiplexer     "wwwrun"        "www"

</IfModule>


#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#

MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash.  This fixes a
# problem with Microsoft WebFolders which does not appropriately handle
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
 
Last edited by a moderator:
Gerade ist es schon wieder passiert...

Wieder genau das Gleiche: Apache Neustart über SSH schlägt fehl mit besagter Meldung. Nach einem kompletten Reboot läuft wieder alles.

Bin wirklich ratlos. Das kann doch nicht normal sein, dass so ein vServer nichtmal 24h am Stück läuft.
 
Hallo!
Poste bitte mal deine vServer ID. Eventuell schaut mal jemand vom Support auf deinen Server. Wenn auch das nichts bringt - Daten sichern und Neuinstallation.

mfG
Thorsten
 
ServerID ist 170076.

Leider warten wir jetzt auch schon geraume Zeit auf das Upgrade(basic->max), das ja evt. das Problem schon lösen könnte, obwohl da was von "wenigen Minuten" steht.

Auf jeden Fall schonmal vielen Dank für deinen Einsatz.
 
So, hatte sich schon wieder aufgehangen. Aber diesmal hat ein Apache Restart über SSH geklappt. Allerdings auch mit Fehlermeldung, vielleicht gibt die ja Aufschluss über das grundsätzliche Problem:

Code:
vs170076:~ # /etc/init.d/apache2 restart
/etc/init.d/apache2: line 12: [M: command not found
[Mon Jan 03 18:20:46 2005] [warn] NameVirtualHost 62.75.170.76:80 has no VirtualHosts
Syntax OK
Shutting down httpd2 (waiting for all children to terminate)         done
Starting httpd2 (prefork) [Mon Jan 03 18:20:47 2005] [warn] NameVirtualHost 62.75.170.76:80 has no VirtualHosts
                                                                     done
vs170076:~ #
 
Hallo,
sag mal, was steht in der Datei /etc/init.d/apache2 in Zeile 12?
Alle anderen Meldungen sind normal.

mfG
Thorsten
 
Das gute Stück sieht so aus:
Code:
#!/bin/sh
#
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
# Copyright (c) 2002, 2003 SuSE Linux AG
#
# Authors: Rolf Haberrecker <rolf@suse.de>, 2001
#          Peter Poeml <poeml@suse.de>, 2002, 2003
#
#
# /etc/init.d/apache2
### BEGIN INIT INFO
# Provides:                     apache2 httpd2
# Required-Start:               $local_fs $remote_fs $network
# X-UnitedLinux-Should-Start:   $named $time postgresql sendmail mysql ypclient dhcp radiusd
# Required-Stop:                $local_fs $remote_fs $network
# X-UnitedLinux-Should-Stop:
# Default-Start:                3 5
# Default-Stop:                 0 1 2 6
# Short-Description:            Apache2 httpd
# Description:                  Start the httpd daemon Apache 2
### END INIT INFO

pname=apache2
sysconfdir=/etc/apache2
apache_link=/usr/sbin/httpd2
sysconfig_apache=/etc/sysconfig/$pname
pidfile=/var/run/httpd2.pid
logdir=/var/log/apache2
rundir=/var/run/apache2

#
# load the configuration
#
test -s /etc/rc.status && . /etc/rc.status && rc_reset

. /usr/share/apache2/load_configuration
export ${!APACHE_*}

if ! [ -s /etc/sysconfig/$pname ]; then # backwards compatibility (pre 8.0)
        # Determine the base and follow a runlevel link name.
        base=${0##*/}
        link=${base#*[SK][0-9][0-9]}
        # Force execution if not called by a runlevel directory.
        test $link = $base && START_APACHE2=yes
        test "$START_APACHE2" = yes || exit 0
fi
httpd_conf=${APACHE_HTTPD_CONF:-$sysconfdir/httpd.conf}

apache_bin=$(/usr/share/apache2/find_mpm 2>/dev/null)

which linkto &>/dev/null || function linkto { file $1 | cut -d\  -f5; }
test -L $apache_link && apache_bin=$(linkto $apache_link)

if [ -z "$APACHE_MPM" ]; then
        APACHE_MPM=${apache_bin##*-}
fi

if ! [ -x $apache_bin ]; then
        echo >&2 ${warn}$apache_bin-$APACHE_MPM is not a valid httpd2 binary.
        echo >&2 Check your APACHE_MPM setting.$norm
        rc_failed 5
        rc_status -v1
        rc_exit
fi

get_server_flags()
{
        unset server_flags
        for i in $APACHE_SERVER_FLAGS; do
                case $i in
                -D)     ;;
                -D*)    server_flags="$server_flags $i";;
                *)      server_flags="$server_flags -D$i";;
                esac
        done
}

action="$1"
case "$action" in
    stop|try-restart|*status*|probe)
        ;;
    *)
        shift; get_server_flags
        ${get_module_list_done:=false} || /usr/share/apache2/get_module_list -q && export get_module_list_done=true
        ${get_includes:=false} || /usr/share/apache2/get_includes && export get_includes_done=true
        ;;
esac

#
# main part
#
case "$action" in
    start*)
        if [ -e $pidfile ]; then
                $0 status &>/dev/null
                if [ $? = 1 ]; then
                        case $APACHE_MODULES in *ssl*)
                                echo "Found stale pidfile (unclean shutdown?). Running /usr/share/apache2/ssl_scache_cleanup"
                                /usr/share/apache2/ssl_scache_cleanup
                        esac
                fi
        fi

 echo -n "Starting httpd2 (${APACHE_MPM:-${apache_bin#*-}}) "
        cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@")
        if eval $cmdline -t > $logdir/rc$pname.out 2>&1 ; then
                export -n ${!APACHE_*}
                eval startproc -t ${APACHE_START_TIMEOUT:-2} $cmdline
                ret=$?

                if test -t 1 && stty -a 2>/dev/null | grep -q -- -echo\ ; then
                        # this means that apache was still waiting for a passphrase to be entered
                        stty echo 2>/dev/null
                        echo;echo
                        echo An SSL passphrase has not been entered within ${APACHE_START_TIMEOUT:-<not set>} seconds.
                        echo To increase this timeout, adjust APACHE_START_TIMEOUT in $sysconfig_apache .
                        # this surely means that apache won't start, despite it looked good to startproc
                        rc_failed 1
                        rc_status -v1
                        rc_exit
                else
                        rc_failed $ret
                        rc_status -v
                fi
        else
                if [ "$link" = "$base" ] ; then
                        cat $logdir/rc$pname.out
                        echo >&2
                        echo >&2 The command line was:
                        echo >&2 $cmdline
                        echo >&2
                else
                        echo -e -n "\nsee $logdir/rc$pname.out for details\n";
                fi
                rc_failed 1
                rc_status -v1
        fi
        ;;
    stop)
echo -n "Shutting down httpd2 "
        if [ ! -f $pidfile -a -f $pidfile.rpmsave ]; then mv $pidfile.rpmsave $pidfile; fi
        if ! [ -f $pidfile ]; then
                echo -n "(not running)"
        else
                kill -TERM $(<$pidfile) 2>/dev/null
                case $? in
                    1)  echo -n "(not running)";;
                    0)  # wait until the processes are gone (the parent is the last one)
                        echo -n "(waiting for all children to terminate) "
                        for ((wait=0; wait<120; wait++)); do
                                if test -f $pidfile; then usleep 500000
                                        else continue 2
                                fi
                        done
                        ;;
                esac
        fi

        rc_status -v
        ;;
    try-restart)
        ## Do a restart only if the service was active before.
        ## Note: try-restart is now part of LSB (as of 1.9).
        ## RH has a similar command named condrestart.
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    restart)
 $0 configtest "$@" || { rc_failed $?; rc_exit; }

        if $0 status &>/dev/null; then
                $0 stop
        fi
        $0 start "$@"
        # Remember status and be quiet
        rc_status
        ;;
    restart-hup)
        $0 configtest "$@" || { rc_failed $?; rc_exit; }

        if $0 status &>/dev/null; then
                echo -n "Restarting httpd2 (SIGHUP)"
                kill -HUP $(<$pidfile) || return=$rc_failed
        else
                $0 start "$@"
        fi
        # Remember status and be quiet
        rc_status -v
        ;;
    reload|force-reload|graceful)
        echo -n "Reload httpd2 (graceful restart)"
        cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@")
        if eval $cmdline -t &> $logdir/rc$pname.out; then
                killproc -USR1 $apache_bin || return=$rc_failed
                rc_status -v
        else
                if [ "$link" = "$base" ] ; then
                        echo -e -n "\n\n"
                        cat $logdir/rc$pname.out
                        echo >&2
                        echo >&2 The command line was:
                        echo >&2 $cmdline
                        echo >&2
                else
                        echo -e -n "\nsee $logdir/rc$pname.out for details\n";
                fi
                rc_failed 6
                rc_status -v1
        fi
        ;;
    status)
if [ ! -f $pidfile -a -f $pidfile.rpmsave ]; then mv $pidfile.rpmsave $pidfile; fi
        echo -n "Checking for httpd2: "
        # we don't use checkproc here since it is confused when we exchange the binaries
        if ! [ -f $pidfile ]; then
                # not running
                rc_failed 3
        elif [ -s $pidfile -a -d /proc/$(<$pidfile) ]; then
                # running
                :
        else
                # stale pid file
                rc_failed 1
                #rm -f $pidfile
        fi
        rc_status -v
        ;;
    probe)
        ## Optional: Probe for the necessity of a reload,
        ## give out the argument which is required for a reload.

        for i in $httpd_conf \
          $APACHE_CONF_INCLUDE_FILES \
          $APACHE_CONF_INCLUDE_DIRS
        do
                if [ $i -nt $pidfile ]; then
                        echo reload
                        break
                fi
        done
        ;;

    conf*|test|syntax|check)
        cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@")
        eval $cmdline -t
        rc_failed $?
        rc_exit
        ;;
 extr*)
den Rest musste ich kürzen, war zu lang fürs Forum ;-)
 
Back
Top