I Need to extend timeout for my beanstalk in aws, I increased timeout in load balancer but still i am facing 502 error. So i tried to add httpd confing in .ebextensions folder below is provided file
# Managed by Elastic Beanstalk
PidFile run/httpd.pid
# Enable TCP keepclive
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 300
<IfModule worker.c>
StartServers 10
MinSpareThreads 250
MaxSpareThreads 250
ServerLimit 10
MaxClients 250
MaxRequestsPerChild 1000000
</IfModule>
Listen 80
Include conf.d/*.conf
Include conf.d/elasticbeanstalk/*.conf
User apache
Group apache
CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
TraceEnable off
LoadModule alias_module modules/mod_alias.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
When i try to deploy this on beanstalk i started facing error:
[Instance: i-0c436613676c84739] Command failed on instance. Return code: 1 Output: (TRUNCATED)...pd.conf AH00534: httpd: Configuration error: No MPM loaded. Failed to execute '/usr/sbin/apachectl -t -f /var/elasticbeanstalk/staging/httpd/conf/httpd.conf' Failed to execute '/usr/sbin/apachectl -t -f /var/elasticbeanstalk/staging/httpd/conf/httpd.conf'. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03_configure_proxy.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
I tried to add npm module in httpd.conf file but by doing this i am facing other issue and it never ends. is there any correction required to do in this file?
For whatever reason, that EC2/beanstalk image is missing this file:
/etc/httpd/conf.modules.d/00-mpm.conf
Just create it with the following text:
# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines.
# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
#
# NOTE: If enabling prefork, the httpd_graceful_shutdown SELinux
# boolean should be enabled, to allow graceful stop/shutdown.
#
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
#
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
#LoadModule mpm_event_module modules/mod_mpm_event.so
then run sudo systemctl restart httpd