システムは以下のとおり。
$ emerge --version Portage 2.2.0_alpha142 (default/linux/amd64/10.0/desktop, gcc-4.7.2, glibc-2.16.0, 3.6.6-gentoo x86_64) $ emerge -pv 'www-servers/apache' These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] www-servers/apache-2.4.3:2 USE="ldap ssl threads -debug -doc (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias -access_compat -asis -auth_digest -authn_dbd -cache_disk -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -lbmethod_bybusyness -lbmethod_byrequests -lbmethod_bytraffic -lbmethod_heartbeat -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -slotmem_shm -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB
以下がエラーメッセージ。
# apache2ctl start * apache2 has detected an error in your setup: AH00526: Syntax error on line 60 of /etc/apache2/modules.d/40_mod_ssl.conf: Invalid Mutex directory in argument file:/run/apache_ssl_mutex * ERROR: apache2 failed to startこのディレクトリは、/etc/apache2/modules.d/40_mod_ssl.conf内で
/etc/apache2/modules.d/40_mod_ssl.conf
## Inter-Process Session Cache: # Configure the SSL Session Cache: First the mechanism to use and second the # expiring timeout (in seconds). #SSLSessionCache dbm:/run/ssl_scache SSLSessionCache shmcb:/run/ssl_scache(512000) SSLSessionCacheTimeout 300 ## Semaphore: # Configure the path to the mutual exclusion semaphore the SSL engine uses # internally for inter-process synchronization. Mutex file:/run/apache_ssl_mutex ssl-cacheのように指定されている。
常時使用するのではないというのなら、
# mkdir /run/apache_ssl_mutex
で済む話だが、これを毎回するというのも面倒だ。
解決策としては、
- /etc/init.d/apache2 を変更して、起動時に無ければ作成させる
- 設定ファイルの方でtmpfs(メモリ上のファイルシステム。システムを再起動する毎に削除される)以外の場所を設定する
/etc/init.d/apache2内のstart()とrestart()で呼び出すのもいいかもしれないが、今回は設定ファイルの問題として検出されているのでcheckconf()から呼び出されるcheckconfd()を編集することにした。
なお、決め打ちを避けるためディレクトリ名はsedで取得する。
/etc/init.d/apache2
CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}" [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}" if [ ! -r "${CONFIGFILE}" ]; then eerror "Unable to read configuration file: ${CONFIGFILE}" return 1 fi # ここから # Create mutex directory for mod_ssl. # Portage makes the directory in tmpfs at once, so it disappears after reboot. # For details, see http://forums.gentoo.org/viewtopic-t-939604-start-0.html MODSSL_MUTEX_DIR="$(sed -e '/^Mutex/!d;s!^Mutex *file:\(/[^ ]*\) *ssl-cache *$!\1!' /etc/apache2/modules.d/40_mod_ssl.conf)" if [ ! -d ${MODSSL_MUTEX_DIR} ]; then einfo "${MODSSL_MUTEX_DIR} does not exist. creating." mkdir "${MODSSL_MUTEX_DIR}" fi # ここまで APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}" APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}" [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"こうすればおk。
一応diffも。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- orig/apache2 2012-11-11 12:46:14.566069898 +0900 | |
+++ /etc/init.d/apache2 2012-11-11 13:01:16.976170759 +0900 | |
@@ -50,6 +50,15 @@ | |
return 1 | |
fi | |
+ # Create mutex directory for mod_ssl. | |
+ # Portage makes the directory in tmpfs at once, so it disappears after reboot. | |
+ # For details, see http://forums.gentoo.org/viewtopic-t-939604-start-0.html | |
+ MODSSL_MUTEX_DIR="$(sed -e '/^Mutex/!d;s!^Mutex *file:\(/[^ ]*\) *ssl-cache *$!\1!' /etc/apache2/modules.d/40_mod_ssl.conf)" | |
+ if [ ! -d ${MODSSL_MUTEX_DIR} ]; then | |
+ einfo "${MODSSL_MUTEX_DIR} does not exist. creating." | |
+ mkdir "${MODSSL_MUTEX_DIR}" | |
+ fi | |
+ | |
APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}" | |
APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}" | |
[ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}" | |
0 件のコメント:
コメントを投稿