Ubuntu 10.04 サーバー VM (ESXi 4.1) で Apache 2 を実行していますが、非常に奇妙な結果が得られます。
mods が有効なディレクトリが見つかることがあります。
そうでない場合もあります。見つからないのは75%くらいじゃないようです。
その間に何も変更されません。
何が起こっているかを示すために、error.log からの抜粋をコマンド ラインと組み合わせて以下に示します。
そこで、ログ内の情報を見つけやすくするために、Apache を停止することから始めます。
CMDLN: root@bunny:/etc/apache2# apache stop
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
ERRLOG: [Tue Feb 15 11:45:40 2011] [notice] caught SIGTERM, shutting down
それから私はそれを開始します:
CMDLIN: root@bunny:/etc/apache2# apache start
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
ERRLOG: [Tue Feb 15 11:46:09 2011] [notice] Apache/2.2.14 (Ubuntu) proxy_html/3.0.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
それから私はそれを再起動します:
CMDLIN: root@bunny:/etc/apache2# apache restart
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
ERRLOG: [Tue Feb 15 11:46:15 2011] [notice] SIGHUP received. Attempting to restart
次に、ディレクトリを1つ戻して、シェルパスを使用しているという理論をテストします
CMDLIN: root@bunny:/etc/apache2# cd ..
CMDLIN: root@bunny:/etc# apache restart
APWARN: apache2: Syntax error on line 33 of /etc/apache2/apache2.conf: Include directory 'mods-enabled' not found
ERRLOG: apache2: Syntax error on line 33 of /etc/apache2/apache2.conf: Include directory 'mods-enabled' not found
これまでのように見えます...ちょっと..
CMDLIN: root@bunny:/etc# apache restart
APWARN: apache2: Syntax error on line 33 of /etc/apache2/apache2.conf: Include directory 'mods-enabled' not found
まだそれのように見えますが、今回はログエラーはありません。Apache ディレクトリに戻り、もう一度試してください。
CMDLIN: root@bunny:/etc# cd apache2/
CMDLIN: root@bunny:/etc/apache2# apache restart
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
APWARN: httpd not running, trying to start
ERRLOG: [Tue Feb 15 11:46:30 2011] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
ERRLOG: [Tue Feb 15 11:46:30 2011] [notice] Apache/2.2.14 (Ubuntu) proxy_html/3.0.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
うーん、そうだったようですね。理由は・・・わかりません。
そのDNSのことを除いて、別のOK再起動...
CMDLIN: root@bunny:/etc/apache2# apache restart
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
ERRLOG: [Tue Feb 15 11:46:36 2011] [notice] SIGHUP received. Attempting to restart
ここまでは順調です... 待ってください... おっと、これはディレクトリを変更していないときにログに表示され、Apache が起動しようとしてもシャットダウンします。
ERRLOG: apache2: Syntax error on line 33 of /etc/apache2/apache2.conf: Include directory 'mods-enabled' not found
私はそれを再起動しに行きます...
CMDLIN: root@bunny:/etc/apache2# apache restart
APWARN: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
APWARN: httpd not running, trying to start
ERRLOG: [Tue Feb 15 11:46:45 2011] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
ERRLOG: [Tue Feb 15 11:46:45 2011] [notice] Apache/2.2.14 (Ubuntu) proxy_html/3.0.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
そして、それはバックアップです。そして、私は当惑しています。
なぜこれが起こっているのかわかりません。これを行うべきだとは意味がありません。私の本能は、どういうわけか正しい道をたどっていないことを教えてくれました.Modが有効になっているのは、何らかの理由で、シェル内の私がいた場所に関連していると予想していました.この同じ「エラー」のために実行中にApacheがシャットダウンしたとき
これが私のhttpd.confです:
<場所 ~ "/ws/?.*$"> SetHandler perl スクリプト PerlResponseHandler Web サービス::Qmedtrix </場所> <ディレクトリ /var/www> オプション +ExecCGI +インクルード </ディレクトリ> <ディレクトリ /usr/share> オプション ExecCGI FollowSymlinks インデックス </ディレクトリ> ProxyPass /group http://localhost:8080/group ProxyPassReverse /group http://localhost:8080/group
ここに私のapache2.confがあります:
LockFile ${APACHE_LOCK_DIR}/accept.lock PidFile ${APACHE_PID_FILE} タイムアウト 300 キープアライブオン MaxKeepAliveRequests 100 キープアライブタイムアウト 15 StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 スレッドリミット 64 ThreadsPerChild 25 最大クライアント数 150 MaxRequestsPerChild 0 ユーザー ${APACHE_RUN_USER} グループ ${APACHE_RUN_GROUP} AccessFileName .htaccess <ファイル ~ "^\.ht"> 注文許可、拒否 全部否定する すべて満足 </ファイル> DefaultType テキスト/プレーン HostnameLookups オン エラーログ ${APACHE_LOG_DIR}/error.log LogLevel 警告 mods-enabled/*.load を含める mods-enabled/*.conf を含める httpd.conf を含める ports.conf を含める LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" 結合 LogFormat "%h %l %u %t \"%r\" %>s %O" 共通 LogFormat "%{Referer}i -> %U" リファラー LogFormat "%{User-agent}i" エージェント conf.d/ を含める サイト対応/含む
そして、これが私のデフォルトの仮想ドメインです。
<仮想ホスト *:80> ServerAdmin webmaster@localhost DirectoryIndex index.shtml index.html DocumentRoot /var/www <ディレクトリ /> オプション FollowSymLinks AllowOverride なし </ディレクトリ> <ディレクトリ /var/www/> オプション インデックス FollowSymLinks MultiViews +Includes +ExecCGI AllowOverride なし 注文許可、拒否 すべてから許可する </ディレクトリ> エラーログ /var/log/apache2/error.log # 可能な値は次のとおりです: debug、info、notice、warn、error、crit、 #アラート、出現。 LogLevel 警告 CustomLog /var/log/apache2/access.log 結合 </仮想ホスト>
そして私のenvarsファイル:
#unset HOME # 上記の行を有効にしてみましたが、違いはありません。 if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; それから SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}" そうしないと サフィックス= フィ export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2$SUFFIX.pid export APACHE_RUN_DIR=/var/run/apache2$SUFFIX export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX export APACHE_LOG_DIR=/var/log/apache2$SUFFIX エクスポート LANG=C LANGをエクスポート
私は困惑しています。
ここで何が起こっているのですか?