fugitif
21/05/2010, 17h26
Envoyé par st-h
# the path to the environment variable file
test -z "$APACHE_ENVVARS" && APACHE_ENVVARS='/etc/apache2/envvars'
# pick up any necessary environment variables
if test -f $APACHE_ENVVARS; then
. $APACHE_ENVVARS
fi
# the following APACHE_* variables should be set in /etc/apache2/envvars
Listen 80# SSL name based virtual hosts are not yet supported, therefore no # NameVirtualHost statement here Listen 443
export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2.pid export LANG=C
/etc/init.d/apache2 stop /etc/init.d/apache2 start
#!/bin/sh -e # # apache2 This init.d script is used to start apache2. # It basically just calls apache2ctl. ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin" #[ `ls -1 /etc/apache2/sites-enabled/ | wc -l | sed -e 's/ *//;'` -eq 0 ] && \ #echo "You haven't enabled any sites yet, so I'm not starting apache2." && \ #echo "To add and enable a host, use addhost and enhost." && exit 0 #edit /etc/default/apache2 to change this. NO_START=0 set -e if [ -x /usr/sbin/apache2 ] ; then HAVE_APACHE2=1 else echo "No apache MPM package installed" exit 0 fi . /lib/lsb/init-functions test -f /etc/default/rcS && . /etc/default/rcS test -f /etc/default/apache2 && . /etc/default/apache2 if [ "$NO_START" != "0" -a "$1" != "stop" ]; then log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0."; exit 0; fi APACHE2="$ENV /usr/sbin/apache2" APACHE2CTL="$ENV /usr/sbin/apache2ctl" pidof_apache() { # if pidof is null for some reasons the script exits automagically # classified as good/unknown feature PIDS=`pidof apache2` || true PID="" # let's try to find the pid file # apache2 allows more than PidFile entry in the config but only # the last found in the config is used for PFILE in `grep ^PidFile /etc/apache2/* -r | awk '{print $2}'`; do if [ -e $PFILE ]; then cat $PFILE return 0 fi done REALPID=0 # if there is a pid we need to verify that belongs to apache2 # for real for i in $PIDS; do if [ "$i" = "$PID" ]; then # in this case the pid stored in the # pidfile matches one of the pidof apache # so a simple kill will make it echo $PID return 0 fi done return 1 } apache_stop() { if `apache2 -t > /dev/null 2>&1`; then # if the config is ok than we just stop normaly $APACHE2CTL stop 2>&1 | grep -v 'not running' >&2 || true else # if we are here something is broken and we need to try # to exit as nice and clean as possible PID=$(pidof_apache) if [ "${PID}" ]; then # in this case it is everything nice and dandy # and we kill apache2 kill $PID elif [ "$(pidof apache2)" ]; then if [ "$VERBOSE" != no ]; then echo " ... failed!" echo "You may still have some apache2 processes running. There are" echo "processes named 'apache2' which do not match your pid file," echo "and in the name of safety, we've left them alone. Please review" echo "the situation by hand." fi return 1 fi fi } apache_sync_stop() { # running ? PIDTMP=$(pidof_apache) if $(kill -0 "${PIDTMP:-}" 2> /dev/null); then PID=$PIDTMP fi apache_stop # wait until really stopped if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do if [ $i = '30' ]; then break; else if [ $i = '0' ]; then echo -n " waiting " else echo -n "." fi i=$(($i+1)) sleep 2 fi done fi } # Stupid hack to keep lintian happy. (Warrk! Stupidhack!). case $1 in start) [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf [ -d /var/run/apache2 ] || mkdir -p /var/run/apache2 install -d -o www-data /var/lock/apache2 #ssl_scache shouldn't be here if we're just starting up. [ -f /var/run/apache2/ssl_scache ] && rm -f /var/run/apache2/*ssl_scache* log_begin_msg "Starting web server (apache2)..." if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; stop) log_begin_msg "Stopping web server (apache2)..." if apache_stop; then log_end_msg 0 else log_end_msg 1 fi ;; reload) if ! $APACHE2CTL configtest > /dev/null 2>&1; then $APACHE2CTL configtest || true log_end_msg 1 exit 1 fi log_begin_msg "Reloading web server config..." if pidof_apache; then if $APACHE2CTL graceful $2 ; then log_end_msg 0 else log_end_msg 1 fi fi ;; restart | force-reload) log_begin_msg "Forcing reload of web server (apache2)..." if ! apache_sync_stop; then log_end_msg 1 fi if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; *) log_success_msg "Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload}" ;; esac
+ ENV='env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin' + NO_START=0 + set -e + '[' -x /usr/sbin/apache2 ']' + HAVE_APACHE2=1 + . /lib/lsb/init-functions ++ FANCYTTY= ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true + test -f /etc/default/rcS + . /etc/default/rcS ++ TMPTIME=0 ++ SULOGIN=no ++ DELAYLOGIN=no ++ UTC=yes ++ VERBOSE=no ++ FSCKFIX=yes ++ RAMRUN=no ++ RAMLOCK=no + test -f /etc/default/apache2 + . /etc/default/apache2 ++ NO_START=0 + '[' 0 '!=' 0 -a stop '!=' stop ']' + APACHE2='env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin /usr/sbin/apache2' + APACHE2CTL='env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin /usr/sbin/apache2ctl' + case $1 in + log_begin_msg 'Stopping web server (apache2)...' + '[' -z 'Stopping web server (apache2)...' ']' + echo -n 'Stopping web server (apache2)...' + apache_stop ++ apache2 -t + env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin /usr/sbin/apache2 -k stop + log_end_msg 0 + '[' -z 0 ']' + log_use_fancy_output + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + '[' xxterm-color '!=' xdumb ']' + '[' -x /usr/bin/tput ']' + '[' -x /usr/bin/expr ']' + /usr/bin/tput hpa 60 + FANCYTTY=0 + case "$FANCYTTY" in + false + '[' 0 -eq 0 ']' + echo . + return 0
set -x
#!/bin/sh -e
/etc/init.d/apache2 stop 2>/tmp/stop.log
#!/bin/sh -e # # apache2 This init.d script is used to start apache2. # It basically just calls apache2ctl. ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin" #[ `ls -1 /etc/apache2/sites-enabled/ | wc -l | sed -e 's/ *//;'` -eq 0 ] && \ #echo "You haven't enabled any sites yet, so I'm not starting apache2." && \ #echo "To add and enable a host, use addhost and enhost." && exit 0 #edit /etc/default/apache2 to change this. NO_START=0 set -e if [ -x /usr/sbin/apache2 ] ; then HAVE_APACHE2=1 else echo "No apache MPM package installed" exit 0 fi . /lib/lsb/init-functions test -f /etc/default/rcS && . /etc/default/rcS test -f /etc/default/apache2 && . /etc/default/apache2 if [ "$NO_START" != "0" -a "$1" != "stop" ]; then log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0."; exit 0; fi APACHE2="$ENV /usr/sbin/apache2" APACHE2CTL="$ENV /usr/sbin/apache2ctl" pidof_apache() { # if pidof is null for some reasons the script exits automagically # classified as good/unknown feature PIDS=`pidof apache2` || true PID="" # let's try to find the pid file # apache2 allows more than PidFile entry in the config but only # the last found in the config is used for PFILE in `grep ^PidFile /etc/apache2/* -r | awk '{print $2}'`; do if [ -e $PFILE ]; then cat $PFILE return 0 fi done REALPID=0 # if there is a pid we need to verify that belongs to apache2 # for real for i in $PIDS; do if [ "$i" = "$PID" ]; then # in this case the pid stored in the # pidfile matches one of the pidof apache # so a simple kill will make it echo $PID return 0 fi done return 1 } apache_stop() { if `apache2 -t > /dev/null 2>&1`; then # if the config is ok than we just stop normaly $APACHE2 -k stop else # if we are here something is broken and we need to try # to exit as nice and clean as possible PID=$(pidof_apache) if [ "${PID}" ]; then # in this case it is everything nice and dandy # and we kill apache2 kill $PID elif [ "$(pidof apache2)" ]; then if [ "$VERBOSE" != no ]; then echo " ... failed!" echo "You may still have some apache2 processes running. There are" echo "processes named 'apache2' which do not match your pid file," echo "and in the name of safety, we've left them alone. Please review" echo "the situation by hand." fi return 1 fi fi } apache_sync_stop() { # running ? PIDTMP=$(pidof_apache) if $(kill -0 "${PIDTMP:-}" 2> /dev/null); then PID=$PIDTMP fi apache_stop # wait until really stopped if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do if [ $i = '30' ]; then break; else if [ $i = '0' ]; then echo -n " waiting " else echo -n "." fi i=$(($i+1)) sleep 2 fi done fi } # Stupid hack to keep lintian happy. (Warrk! Stupidhack!). case $1 in start) [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf [ -d /var/run/apache2 ] || mkdir -p /var/run/apache2 install -d -o www-data /var/lock/apache2 #ssl_scache shouldn't be here if we're just starting up. [ -f /var/run/apache2/ssl_scache ] && rm -f /var/run/apache2/*ssl_scache* log_begin_msg "Starting web server (apache2)..." if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; stop) log_begin_msg "Stopping web server (apache2)..." if apache_stop; then log_end_msg 0 else log_end_msg 1 fi ;; reload) if ! $APACHE2CTL configtest > /dev/null 2>&1; then $APACHE2CTL configtest || true log_end_msg 1 exit 1 fi log_begin_msg "Reloading web server config..." if pidof_apache; then if $APACHE2CTL graceful $2 ; then log_end_msg 0 else log_end_msg 1 fi fi ;; restart | force-reload) log_begin_msg "Forcing reload of web server (apache2)..." if ! apache_sync_stop; then log_end_msg 1 fi if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; *) log_success_msg "Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload}" ;; esac
root@ns23377:~# /etc/init.d/apache2 stop 2>/tmp/stop.log Stopping web server (apache2).... root@ns23377:~# /etc/init.d/apache2 start Starting web server (apache2)...(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs failed!
set -x
/etc/init.d/apache2 stop 2>/tmp/stop.log
/etc/init.d/apache2 stop
lsof | grep apache
ps auxwww | grep apache
# ServerRoot "/etc/apache2" PidFile /var/run/apache2.pid # # Timeout: The number of seconds before receives and sends time out. # Timeout 30 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 10 # prefork MPMStartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 200 MaxRequestsPerChild 0 # worker MPMStartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 User www-data Group www-data AccessFileName .htaccess # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. #Order allow,deny Deny from all TypesConfig /etc/mime.types # DefaultType text/plain HostnameLookups Off ErrorLog /var/log/apache2/error.log LogLevel warn # Include module configuration: Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf # Include all the user configurations: Include /etc/apache2/httpd.conf # Include ports listing Include /etc/apache2/ports.conf # Include generic snippets of statements Include /etc/apache2/conf.d/ # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent ServerTokens Full ServerSignature OnAlias /icons/ "/usr/share/apache2/icons/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ # # DefaultIcon is which icon to show for files which do not have an icon # explicitly set. # DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# RCS CVS *,v *,t AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw # # LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # # Just list the languages in decreasing order of preference. We have # more or less alphabetized them here. You probably want to change this. # LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW # # ForceLanguagePriority allows you to serve a result page rather than # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback) # [in case no accepted languages matched the available variants] # ForceLanguagePriority Prefer Fallback #AddDefaultCharset ISO-8859-1 # AddCharset us-ascii .ascii .us-ascii AddCharset ISO-8859-1 .iso8859-1 .latin1 AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen AddCharset ISO-8859-3 .iso8859-3 .latin3 AddCharset ISO-8859-4 .iso8859-4 .latin4 AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru AddCharset ISO-8859-6 .iso8859-6 .arb .arabic AddCharset ISO-8859-7 .iso8859-7 .grk .greek AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk AddCharset ISO-8859-10 .iso8859-10 .latin6 AddCharset ISO-8859-13 .iso8859-13 AddCharset ISO-8859-14 .iso8859-14 .latin8 AddCharset ISO-8859-15 .iso8859-15 .latin9 AddCharset ISO-8859-16 .iso8859-16 .latin10 AddCharset ISO-2022-JP .iso2022-jp .jis AddCharset ISO-2022-KR .iso2022-kr .kis AddCharset ISO-2022-CN .iso2022-cn .cis AddCharset Big5 .Big5 .big5 .b5 AddCharset cn-Big5 .cn-big5 # For russian, more than one charset is used (depends on client, mostly): AddCharset WINDOWS-1251 .cp-1251 .win-1251 AddCharset CP866 .cp866 AddCharset KOI8 .koi8 AddCharset KOI8-E .koi8-e AddCharset KOI8-r .koi8-r .koi8-ru AddCharset KOI8-U .koi8-u AddCharset KOI8-ru .koi8-uk .ua AddCharset ISO-10646-UCS-2 .ucs2 AddCharset ISO-10646-UCS-4 .ucs4 AddCharset UTF-7 .utf7 AddCharset UTF-8 .utf8 AddCharset UTF-16 .utf16 AddCharset UTF-16BE .utf16be AddCharset UTF-16LE .utf16le AddCharset UTF-32 .utf32 AddCharset UTF-32BE .utf32be AddCharset UTF-32LE .utf32le AddCharset euc-cn .euc-cn AddCharset euc-gb .euc-gb AddCharset euc-jp .euc-jp AddCharset euc-kr .euc-kr #Not sure how euc-tw got in - IANA doesn't list it??? AddCharset EUC-TW .euc-tw AddCharset gb2312 .gb2312 .gb AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2 AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4 AddCharset shift_jis .shift_jis .sjis AddHandler type-map var AddType text/html .shtml AddOutputFilter INCLUDES .shtml # # 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 "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully BrowserMatch "^gnome-vfs/1.0" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully Header unset Pragma FileETag None Header unset ETag #Expire HeaderExpiresDefault "access plus 6 hours" # Expire images header ExpiresActive On ExpiresDefault A0 ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/ico A2592000 ExpiresByType text/css A2592000 ExpiresByType text/javascript A2592000 # Include the virtual host configurations: Include /etc/apache2/sites-enabled/
for PFILE in `grep ^PidFile /etc/apache2/* -r | awk '{print $2}'`; do if [ -e $PFILE ]; then cat $PFILE return 0 fi done
/etc/init.d/apache2 stop
Stopping web server (apache2)....
root@ns232377:~# /etc/init.d/apache2 start
Starting web server (apache2)...(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
failed!
root@ns232377:~# killall -9 apache2
apache2ctl configtest
/etc/init.d/apache2 stop
#!/bin/sh -e # # apache2 This init.d script is used to start apache2. # It basically just calls apache2ctl. ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin" #[ `ls -1 /etc/apache2/sites-enabled/ | wc -l | sed -e 's/ *//;'` -eq 0 ] && \ #echo "You haven't enabled any sites yet, so I'm not starting apache2." && \ #echo "To add and enable a host, use addhost and enhost." && exit 0 #edit /etc/default/apache2 to change this. NO_START=0 set -e if [ -x /usr/sbin/apache2 ] ; then HAVE_APACHE2=1 else echo "No apache MPM package installed" exit 0 fi . /lib/lsb/init-functions test -f /etc/default/rcS && . /etc/default/rcS test -f /etc/default/apache2 && . /etc/default/apache2 if [ "$NO_START" != "0" -a "$1" != "stop" ]; then log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0."; exit 0; fi APACHE2="$ENV /usr/sbin/apache2" APACHE2CTL="$ENV /usr/sbin/apache2ctl" pidof_apache() { # if pidof is null for some reasons the script exits automagically # classified as good/unknown feature PIDS=`pidof apache2` || true PID="" # let's try to find the pid file # apache2 allows more than PidFile entry in the config but only # the last found in the config is used for PFILE in `grep ^PidFile /etc/apache2/* -r | awk '{print $2}'`; do if [ -e $PFILE ]; then cat $PFILE return 0 fi done REALPID=0 # if there is a pid we need to verify that belongs to apache2 # for real for i in $PIDS; do if [ "$i" = "$PID" ]; then # in this case the pid stored in the # pidfile matches one of the pidof apache # so a simple kill will make it echo $PID return 0 fi done return 1 } apache_stop() { if `apache2 -t > /dev/null 2>&1`; then # if the config is ok than we just stop normaly $APACHE2 -k stop else # if we are here something is broken and we need to try # to exit as nice and clean as possible PID=$(pidof_apache) if [ "${PID}" ]; then # in this case it is everything nice and dandy # and we kill apache2 kill $PID elif [ "$(pidof apache2)" ]; then if [ "$VERBOSE" != no ]; then echo " ... failed!" echo "You may still have some apache2 processes running. There are" echo "processes named 'apache2' which do not match your pid file," echo "and in the name of safety, we've left them alone. Please review" echo "the situation by hand." fi return 1 fi fi } apache_sync_stop() { # running ? PIDTMP=$(pidof_apache) if $(kill -0 "${PIDTMP:-}" 2> /dev/null); then PID=$PIDTMP fi apache_stop # wait until really stopped if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do if [ $i = '30' ]; then break; else if [ $i = '0' ]; then echo -n " waiting " else echo -n "." fi i=$(($i+1)) sleep 2 fi done fi } # Stupid hack to keep lintian happy. (Warrk! Stupidhack!). case $1 in start) [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf [ -d /var/run/apache2 ] || mkdir -p /var/run/apache2 install -d -o www-data /var/lock/apache2 #ssl_scache shouldn't be here if we're just starting up. [ -f /var/run/apache2/ssl_scache ] && rm -f /var/run/apache2/*ssl_scache* log_begin_msg "Starting web server (apache2)..." if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; stop) log_begin_msg "Stopping web server (apache2)..." if apache_stop; then log_end_msg 0 else log_end_msg 1 fi ;; reload) if ! $APACHE2CTL configtest > /dev/null 2>&1; then $APACHE2CTL configtest || true log_end_msg 1 exit 1 fi log_begin_msg "Reloading web server config..." if pidof_apache; then if $APACHE2CTL graceful $2 ; then log_end_msg 0 else log_end_msg 1 fi fi ;; restart | force-reload) log_begin_msg "Forcing reload of web server (apache2)..." if ! apache_sync_stop; then log_end_msg 1 fi if $APACHE2CTL start; then log_end_msg 0 else log_end_msg 1 fi ;; *) log_success_msg "Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload}" ;; esac
# 0 = start on boot; 1 = don't start on boot NO_START=0
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # envvars-std - default environment variables for apachectl # # This file is generated from envvars-std.in #
[Wed May 05 06:25:59 2010] [notice] caught SIGTERM, shutting down
/var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate if [ -f /var/run/apache2.pid ]; then /etc/init.d/apache2 restart > /dev/null fi endscript }
/var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then /etc/init.d/apache2 reload > /dev/null fi endscript }
cat /etc/apache2/envvars
cat /etc/logrotate.d/apache2
# m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
killall apache2 /etc/init.d/apache2 start
Forcing reload of web server (apache2)...httpd (no pid file) not running (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs failed!
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
/dev/md1 29G 1,5G 26G 6% / tmpfs 1,9G 0 1,9G 0% /lib/init/rw udev 10M 44K 10M 1% /dev tmpfs 1,9G 0 1,9G 0% /dev/shm /dev/md2 640G 18G 591G 3% /home
netstat -tan
1114 root 15 -5 0 0 0 S 0 0.0 0:00.00 kpsmoused root@nsXXX:~# netstat -tan Connexions Internet actives (serveurs et établies) Proto Recv-Q Send-Q Adresse locale Adresse distante Etat tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4949 0.0.0.0:* LISTEN tcp 0 0 XX.XXX.XX.XXX:53 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:88 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55127 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55170 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 88.163.20.187:53497 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 202.90.88.148:47490 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55159 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55223 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55042 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55197 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55124 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55167 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55270 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55205 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55063 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 77.201.49.223:50056 FIN_WAIT2 tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55188 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55245 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55030 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55244 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55178 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 86.69.46.197:51262 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55221 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55262 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55115 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55040 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 86.69.46.197:51249 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55175 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55106 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55031 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 77.201.49.223:50061 FIN_WAIT2 tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55121 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55071 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55132 TIME_WAIT tcp 0 0 XX.XXX.XX.XXX:80 XX.XXX.XX.XXX:55093 TIME_WAIT tcp 0 4832 XX.XXX.XX.XXX:22 94.108.205.24:56221 ESTABLISHED
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
netstat -tulpn | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2718/apache2