Forum

CGI application timeout

Fred
20 August 2015, 14:02
Hi Hugo,

I have move all my wordpress to my new Hiawatha server using Hiawatha rever proxy.
At first everything seemed good.
The front end of the site is working just fine, but we're repeatedly getting
CGI application timeout
Error in the Hiawatha log files when trying to do anything on the backend: accessing the Dashboard, adding new posts, editing existing posts, etc.
This doesn't happen for all my sites, just a couple.

From that error message I know that I need to increase the timeout setting for CGI but I cannot see anywere on the documentation how I can do this...
This is the only info I found using the sample file
#FastCGIserver {
# FastCGIid = PHP5
# ConnectTo = 127.0.0.1:2005
# Extension = php
#}
:
how do I increase the cgi size?
Fred
20 August 2015, 14:23
I also set
TimeForCGI = 120
Hugo Leisink
21 August 2015, 08:04
The TimeForCGI is the setting you are looking for. Please note that this is a per-virtual-host setting.
Fred
21 August 2015, 09:27
Hi Hugo,

I haven't got that setting the my hiawatha.conf file on the reverse proxy..
Do I need it in there as well?
I'm really struggling to trouble shoot the error as I feel that Hiawatha error log aren't really helpful.. is that because I installed Hiawatha from FeeBSD port? Will I be better compiling it from scratch?
Fred
21 August 2015, 11:54
Hi Hugo,

I have done more work on my problem and came to the conclusion that the problem must be from the Hiawatha reverse proxy server.
Here is how I came to this conclusion:
I change on of my website from Hiawatha web server back to nginx but keeping the Hiawatha reverse proxy to redirect the domains.
I can see the webpage ok and navigate to the fron end of my mutlisite workpress site with no problem.
However, when I try to access the /wp-admin page, I get a
Gateway Timeout 504
from Hiawatha (not ngnix).
Here is my proxy server setting:
Hiawatha.con
# Hiawatha main configuration file
#
# This is a hiawatha.conf for use with WordPress.
#

# VARIABLES
# With 'set', you can declare a variable. Make sure the name of the
# variable doesn't conflict with any of the configuration options. The
# variables are case-sensitive and cannot be re-declared.
#
set LOCALHOST = 127.0.0.0/8
set MyIPv4 = 10.8.20.11
#set MyIPv6 = <my_IPv6>
set TrustedIP_1 = <IP_1>
set TrustedIP_2 = <IP_2>
set TrustedIP_3 = <IP_3>

# GENERAL SETTINGS
#
#MonitorServer = 192.168.1.125
ServerString = Hiawatha
ServerId = www:webadmin
ConnectionsTotal = 4096 # Maximum number of simultaneous connections. Default = 100
ConnectionsPerIP = 32 # Maximum number of simultaneous connections per IP address. Default = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
ThreadKillRate = 10
CacheSize = 8 # Size of Hiawatha's internal file cache. Maximum is 1024 (megabytes). Default = 10
CacheMaxFilesize = 512 # Maximum size of a file Hiawatha will store in its internal cache. Default = 256
MaxUrlLength = 1000
MinSSLversion = TLS1.2
DHsize = 4096 # Set the size of the Diffie-Hellman key. Default = 2048
SocketSendTimeout = 30
LogfileMask = deny LOCALHOST, deny MyIPv4, deny TrustedIP_1, deny TrustedIP_2, deny TrustedIP_3
RequestLimitMask = deny LOCALHOST, deny MyIPv4, deny TrustedIP_1, deny TrustedIP_2, deny TrustedIP_3


# BINDING SETTINGS
# A binding is where a client can connect to.
#
include bindings.conf

# BANNING SETTINGS
# Deny service to clients who misbehave.
#
BanOnGarbage = 300
BanOnInvalidURL = 60
BanOnMaxPerIP = 15
BanOnMaxReqSize = 300
BanOnWrongPassword = 6:900
BanOnSQLi = 3600
KickOnBan = yes
RebanDuringBan = yes
BanlistMask = deny LOCALHOST, deny MyIPv4, deny TrustedIP_1, deny TrustedIP_2, deny TrustedIP_3
ChallengeClient = 768, javascript, 15

# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
FastCGIserver {
FastCGIid = PHP5-FPM
ConnectTo = /var/run/php-fpm.sock
Extension = php
}

# URL TOOLKIT
# This URL toolkit rule was made for the Banshee PHP framework, which
# can be downloaded from http://www.hiawatha-webserver.org/banshee
#
include toolkit.conf

# DEFAULT WEBSITE
# Use IP address as the hostname of the default website and give it a blank webpage.
# By doing so, automated webscanners won't find the possible vulnerable website.
#
Hostname = MyIPv4
WebsiteRoot = /usr/local/www/webs/default/httpdocs
StartFile = index.html
AccessLogfile = /var/log/hiawatha/default.access.log
ErrorLogfile = /var/log/hiawatha/default.error.log
#ErrorHandler = 404:/error.cgi

include domains.conf

domains.conf
VirtualHost {
Hostname = www.domain1.com, domain1.com, *.domain1.com
TimeForCGI = 1200
#ReverseProxy .* http://10.8.20.10/ # hiawatha
ReverseProxy .* http://10.8.20.13/ #nginx
AccessLogfile = /var/log/domain1/domain1.access.log
ErrorLogfile = /var/log/hiawatha/bollenberg.error.log
WebsiteRoot = /var/www/empty
}

VirtualHost {
Hostname = www.domain2.co.uk, domain2.co.uk, *.domain2.co.uk
ReverseProxy .* http://10.8.20.10/
AccessLogfile = /var/log/hiawatha/domain2.access.log
ErrorLogfile = /var/log/hiawatha/domain2.error.log
WebsiteRoot = /var/www/empty
}

VirtualHost {
Hostname = www.domain3.fr, domain3.fr, *.domain3.fr
ReverseProxy .* http://10.8.20.10/
AccessLogfile = /var/log/hiawatha/domain3.access.log
ErrorLogfile = /var/log/hiawatha/domain3.error.log
WebsiteRoot = /var/www/empty
}

VirtualHost {
Hostname = www.domain4.co.uk, domain4.co.uk, *.domain4.co.uk
ReverseProxy .* http://10.8.20.10/
AccessLogfile = /var/log/hiawatha/domain4.access.log
ErrorLogfile = /var/log/hiawatha/domain4.error.log
WebsiteRoot = /var/www/empty
}

I really really don't understand what is going here as TimeForCGI = 1200 and way way too hight and still not working.
I appreciate your help
Thank you
Hugo Leisink
21 August 2015, 12:21
What if you browse to your webserver directly (thus without the proxy). Does that work? Is it possible for me to connect to your reverse proxy? I'd like to see for myself what goes wrong. I want to do a telnet/netcat connect to your proxy, to see what headers are being send.
Fred
25 August 2015, 11:56
Hi Hugo,

Thank you very much. I have pm you the login details
Fred
3 September 2015, 16:27
Problem was with the data not Hiawatha
This topic has been closed.