~# apache2 -V
Server version: Apache/2.2.22 (Ubuntu)
Server built: Feb 13 2012 01:51:56
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.4.6, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture: 64-bit
Server MPM: Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
На веб-сервере крутится Мегаплан. Периодически - раз в неделю-две - апач перестаёт отдавать данные. Показывает белую простыню. Так как мегаплан стоит на сервере с внутренним IP, на шлюзе установлен NginX, проксирующий на етот сервер. Когда происходит такая ситуация с апачем, nginx отдаёт 502 ошибку.
Конфиг apache такой:
# cat /etc/apache2/apache2.conf | grep '^[^#]'
LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 100
MaxRequestsPerChild 200
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 15
MaxSpareThreads 50
ThreadLimit 32
ThreadsPerChild 10
MaxClients 70
MaxRequestsPerChild 200
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>
DefaultType None
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include httpd.conf
Include 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\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
Include conf.d/
Include sites-enabled/
# grep -v '^#' /etc/apache2/conf.d/*
/etc/apache2/conf.d/other-vhosts-access-log:CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
/etc/apache2/conf.d/php5.conf:<IfModule mod_php5.c>
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php .php4
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php .php5
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php .php
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php-source .php4s
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php-source .php5s
/etc/apache2/conf.d/php5.conf: AddHandler application/x-httpd-php-source .phps
/etc/apache2/conf.d/php5.conf: DirectoryIndex index.php4
/etc/apache2/conf.d/php5.conf: DirectoryIndex index.php5
/etc/apache2/conf.d/php5.conf: DirectoryIndex index.php
/etc/apache2/conf.d/php5.conf:</IfModule>
/etc/apache2/conf.d/security:ServerTokens OS
/etc/apache2/conf.d/security:ServerSignature On
/etc/apache2/conf.d/security:TraceEnable Off
К апачу собран вручную php 5.2.16 с xCache. Данные конфиги переносились со старого сервера, на котором мегаплан работал безукоризнено. Я уже играл настройками апача, пересобирал php. Ничего не помогает. Как узнать, почему периодически отказывает апач?
Конфиг PHP:
# php -v
PHP 5.2.16 (cli) (built: Sep 17 2012 12:12:45)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
# cat /etc/php5.2/apache2/php.ini
[PHP]
engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
;allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = GCONV_PATH,GETCONF_DIR,HOSTALIASES,LD_AUDIT,LD_DEBUG,LD_DEBUG_OUTPUT,LD_DYNAMIC_WEAK,LD_LIBRARY_PATH,LD_ORIGIN_PATH,LD_PRELOAD,LD_PROFILE,LD_SHOW_AUXV,LD_USE_LOAD_BIAS,LOCALDOMAIN,LOCPATH,MALLOC_TRACE,NLSPATH,RESOLV_HOST_CONF,RES_OPTIONS,TMPDIR,TZDIR
disable_functions =
disable_classes =
expose_php = Off
max_execution_time = 600 ; Maximum execution time of each script, in seconds
max_input_time = 600 ; Maximum amount of time each script may spend parsing request data
memory_limit = 512M ; Maximum amount of memory a script may consume (128MB)
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = On
html_errors = Off
error_log = /home/megaplan/var/logs/php-error.log
variables_order = "GPCS"
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 52M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
;include_path = ".:/usr/share/php5:/usr/share/php5/PEAR"
doc_root =
user_dir =
extension_dir = /usr/lib/x86_64-linux-gnu/extensions/no-debug-zts-20060613
enable_dl = On
file_uploads = On
upload_tmp_dir = "/tmp"
upload_max_filesize = 52M
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 240
[Syslog]
define_syslog_variables = Off
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = Off
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQL]
mysql.allow_persistent = Off
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[PostgresSQL]
pgsql.allow_persistent = Off
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[Session]
session.save_handler = files
session.save_path = "/var/lib/php5"
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly = 1
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 1
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
[xcache-common]
extension = xcache.so
[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "mOo"
xcache.admin.pass = ""
[xcache]
xcache.shm_scheme = "mmap"
;xcache.size = 10M
xcache.size = 8M
xcache.count = 2
xcache.slots = 1K
;xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 16M
;xcache.var_size = 32M
xcache.var_count = 1
;xcache.var_count = 16
xcache.var_slots = 1K
;xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ""
[Zend]
zend_extension_manager.optimizer=/usr/local/lib/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/lib/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3
zend_optimizer.optimization_level=15
zend_optimizer.enable_loader=On
zend_optimizer.disable_licensing=Off
zend_optimizer.license_path=/data/www/megaplan/config
zend_extension=/usr/local/lib/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/lib/Zend/lib/ZendExtensionManager_TS.so