Apache failed on system boot, when binding to an additional IP

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/

Advertisements

, ,

Leave a comment

JII (Java Image Info) Version 1.1.0

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

, ,

Leave a comment

How to initialize a static final object

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!

,

Leave a comment

C5Connector.Java Version 0.11

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.

,

Leave a comment

VPS boot overrides some configuration files

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!

, ,

Leave a comment

C5Connector.Java Version 0.10

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

,

Leave a comment

C5Connector.Java Version 0.9

Version 0.9 of the C5Connector.Java has been released.

It’s the Java backend for the filemanager of corefive.

This is a bug-fix and 3rd-party-update release.

The changes in detail:

  • issue #33: Implementation of ‘version’ property
  • issue #34: Implementation of the ‘protected’ flag for get-responses
  • issue #35: Implement sorting files in ‘getfolder’
  • updated Jackson to 2.5.0
  • updated slf4j to 1.7.12
  • updated servlet-api to 3.1.0

,

Leave a comment