In case you need to migrate a numerous Database Mail Profiles to another MSSQL server doing this manually is exhausting and error-prone. The script, originally written by Iain Elder and enhanced by Frank Gill generates dynamic SQL statements to recreate database mail accounts and profiles on another SQL server. All you need to do is run this script in a new query window, copy the dynamic SQL statement in a new window and execute it. The script is listed below. Continue reading
Sep 15 2020
StatsMan error 1 no aggregation data found in the statsman data cache
After running StatsMan for some time, one day I saw the error “error 1 – no aggregation data found in the statsman data cache“.
First of all I checked the state of “Redis” and “Skype for Business StatsMan Listener” services and they were “Running”. Continue reading
Sep 02 2020
Nginx reverse proxy to .onion site in TOR network
As Tor is not a http proxy but a Socks one you cannot insert .onion name or IP in proxy_pass
directive. In order to use Nginx as reverse proxy to .onion sites you will need a socat.
Socat is a command line based utility that establishes two bidirectional data streams and transfers between them. This data can take many forms such as files, pipes, devices (terminal or modems), or sockets (UNIX, IPv4, IPv6, TCP, SSL etc). The streams can be constructed from a large and diverse selection of data sinks, sources and address options, which allows Socat to be highly flexible in its usage. It is for this reason that it and similar tools are often referred to as multipurpose relays. Continue reading
Sep 02 2020
How To Debug Nginx Reverse Proxy Issues
Nginx server is loved by many people for its proxy capabilities and ease of configuration. A simple proxy_pass
can allow you to connect to any of the backends such as GoLang, php-fpm, NodeJS, another Nginx, Tomcat, Apache, Gunicorn, uwsgi, Flask, Django, an external CDN and many more.
When proxying a request to another server, you may or may not have access to a log of the server. So it is important to be able to debug the problem if an issue occurs. Common problems that you may face when proxying request are below
- 502 Bad Gateway
- 504 Gateway Timeout
- 404 Page Not Found
- 403 Access Denied
- 400 Bad Request request header or cookie too large
- Wrong Redirect
- upstream sent too big header while reading response header from upstream
- Primary script unknown while reading response header from upstream
- upstream prematurely closed connection while reading response header from upstream
Sep 02 2020
Nginx close upstream connection after request
Nginx was configured as reverse proxy for an upstream server that servers a website. Upon checking the setup I encountered the 502 Bad gateway error. In Nginx error.log
I found the following line:
1 |
*1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /check HTTP/1.1", upstream: "http://127.0.0.1:4005/check", host: "example.com" |
Aug 19 2020
How to remove mod_pagespeed from access.log
If you have mod_pagespeed installed on your webserver you may notice the following lines in access.log file:
1 2 3 |
*ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" *ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" *ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" |
Depending on the size of your website requests from mod_pagespeed can add flood your logfiles and their size will be significantly larger. Here is how you can exclude mod_pagespeed requests from access.log file Continue reading
Aug 19 2020
How not to log certain requests in Apache
By default Apache logs all requests. Sometimes you need to exclude logging of certain requests from Apache‘s access.log
. For example some automated requests coming and flood your log distorting your statistics. This short guide shows how you use Apache’s SetEnvIf directive to prevent Apache from logging such requests.
Aug 12 2020
What is Tomcat shutdown port
In default Tomcat installation, you will find the following line at the top of Tomcat‘s global server configuration file server.xml
:
1 |
<Server port="8005" shutdown="SHUTDOWN"> |
This configuration allows remote shutdown of Tomcat by sending telnet command to port 8005. Something to note:
1. Port 8005 is on TCP protocol. This is important for firewall configuration
2. Port 8005 must be available for Tomcat to start. Use “netstate -an | grep 8005 | grep LISTEN
” to confirm prior of Tomcat startup
3. The shutdown command is configurable, and case sensitive. In this default configuration (as above), it must be uppercase SHUTDOWN. It can be configured to other value if there is a security concern.
4. If port number is -1, then remote shutdown is disabled
Following steps illustrate how to shutdown Tomcat remotely (I will login directly to Tomcat server and shut it down by telnet) Continue reading
Aug 04 2020
A fatal error occured during initialisation. JIRA has been locked
At some moment Jira app stopped responding. When I stopped and started it Jira failed to start with:
JIRA Startup Failed You cannot access JIRA at present. Look at the table below to identify the reasons Description Unable to clean the cache directory: /opt/jira/plugins/.osgi-plugins/felix
In catalina.out
log there were following lines:
1 2 |
2020-08-04 11:09:09,183 JIRA-Bootstrap ERROR [c.a.jira.upgrade.PluginSystemLauncher] A fatal error occured during initialisation. JIRA has been locked. com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /data/jira/plugins/.osgi-plugins/felix |
and
1 2 |
2020-08-04 11:09:09,183 JIRA-Bootstrap ERROR [c.a.jira.upgrade.PluginSystemLauncher] A fatal error occured during initialisation. JIRA has been locked. com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to clean the cache directory: /data/jira/plugins/.osgi-plugins/felix |
There are two known causes for this issue: Continue reading
Aug 19 2020
Disqus and other comments does not show on WordPress
The most often reason is misconfiguration in your WordPress. Check the following:
Turning on Comments for a Single Post or Page
Continue reading