Thilo
This user hasn't shared any biographical information
Homepage: https://thilosdevblog.wordpress.com
How to check the expiration date of a ssl certificate?
Posted in Server on 2019/08/16
To check a certificate of an host:
openssl s_client -servername your.domain -connect your.domain:443 2>&- | openssl x509 -enddate -noout | sed 's/^notAfter=//g'
To check a certificate file:
openssl x509 -noout -enddate -in your.crt | sed 's/^notAfter=//g'
Apache failed on system boot, when binding to an additional IP
Posted in Server on 2019/02/09
Starting point:
My system (Ubuntu 18.04.1) is a VPS running on KVM. The network with some additional IPs is configured with Netplan.
Problem:
The Apache server is running on an additional IP. If the VPS reboots, the apache didn’t start because, it couldn’t be bind on an aditional IP. A log entry like the following can be found:
apachectl[631]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address [xxxxxxxx]:80
But if you restart Apache after the reboot, it runs as expected!
Strange, isn’t it?
Solution:
Ok, I couldn’t find the exact reason of this reason. But I think, there is a strange timing issue on reboot. The network isn’t completely up before Apache is starting.
To solve the problem, just edited the section ‘Unit’ in the file /lib/systemd/system/apache2.service and replace
After=network.target remote-fs.target nss-lookup.target
with
Requires=network-online.target After=network-online.target remote-fs.target nss-lookup.target
That’s it!
More information about the network-target can be found her: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
JII (Java Image Info) Version 1.1.0
Posted in Coding on 2018/09/04
Version 1.1.0 of JII has been released.
It provides a clean interface to a collection of Java libraries and source code to read basic properties of images.
Changes:
- issue #5 Include Apache-Commons-Imaging
- issue #8 Update platform to Java 8
- updated slf4j to 1.7.25
- changed to maven 3.5
How to initialize a static final object
Posted in Coding on 2017/07/24
Sometimes I need to intitialize a complex static final object, but I don’t like static blocks for initialization. IMHO it isn’t nice to read!
An alternative way is using an static method:
private static final YourObject defaultYourObject = initYourObject(); private static YourObject initYourObject() { try { return new YourObject(param1, param2); } catch (Exception e) { // should never happened throw new Error("Could not initialize YourObject", e); } }
And of course, the error-handling is an own special topic in this case!
C5Connector.Java Version 0.11
Posted in Coding on 2016/11/01
Version 0.11 of the C5Connector.Java has been released.
It’s the Java backend for the filemanager of corefive.
The outstanding feature of this release is that the jar of C5Connector.Java contains the source code of the filemanager. This insures that there aren’t any compatibility issues between C5Connector.Java and the filemanager. We strongly recommend using this feature! The default implementations of the basic interfaces are adapted accordingly.
The changes in detail:
- issue #39: Adapt FilemanagerConfig to Filemanager 2.5.
- issue #40: Integrate the filemanager source into the jar file
- issue #41: New directory with name equals to Parent directory
- issue #43: The default implementation of FilemanagerCapability should respect if a file is protected
- issue #44: updated filemanager to 2.5.0
- issue #45: wrong path in getinfo for folders
This could be one of the last releases of this project. The Filemanager project is deprecated. This is why the future of C5Connector.Java is written in the stars.
VPS boot overrides some configuration files
Posted in Server on 2016/01/11
Problem: I bought a new VPS and did some configuration changes (e.g. hostname setting). I’ve installed some software and wanted to test if my settings are boot resistant. And every time the VPS was booting the files /etc/hosts and /etc/hostname was overridden by the defaults of the provider.
Reason: Virtuozzo (the software which virtualises my VPS) overrides those files at every time the VPS is booting.
Solution: Replacing the files /etc/hosts and /etc/hostname at boot-time.
The following description is applied for Ubuntu 14.04. Both replacements are implemented as upstart jobs.
/etc/hosts
Copy the /etc/hosts (e.g. /etc/hosts_my) and adapt it to your needs. Then create the file /etc/init/hosts.conf with the following content:
description "restore my hosts" start on startup exec cp /etc/hosts_my /etc/hosts
/etc/hostname
Copy the /etc/hostname (e.g. /etc/hostname_mod) and adapt it to your needs. Then edit the file /etc/init/hostname.conf and change the last exec command to:
exec hostname -b -F /etc/hostname_mod
That’s it!
C5Connector.Java Version 0.10
Posted in Coding on 2015/06/27
Version 0.10 of the C5Connector.Java has been released.
It’s the Java backend for the filemanager of corefive.
Changes of the configuration of the filemanager can cause errors, because the (default) configuration is provided by C5Connector.Java. To ensure a runnable version, the *-bin.zip contains the source of the filemanager.
The changes in detail:
- issue #36: Client and adapter tight coupling (refactored the fetching of the default configuration of the filemanager)
- issue #37: Implementation of ‘baseUrl’ property
- issue #38: Build a bundle with the filemanager source
- updated Jackson to 2.5.4