Apache2: apr_sockaddr_info_get() failed for HOSTNAME

If your apache2 outputs this warning when starting, read along how to fix it:

Problem is that Apache2 is told to use a hostname that the system can not resolve.
Simple solution is to put HOSTNAME to the /etc/hosts file, like this:

If you have the problem that your /etc/hosts is ignored, check this article:
Linux: /etc/hosts gets ignored

Linux: /etc/hosts gets ignored

I had the problem that my /etc/hosts wasn’t read by the system.

First: Use ping to test local Hostname lookups, because dig calls the nameservers directly.

There are two files that can configure in which order the lookup system are tried.
The two systems are the local hosts file and the normal DNS system.

/etc/host.conf

“order hosts,bind” tells the system to use the hosts file first, and then try bind == DNS system.

/etc/nsswitch.conf

“hosts: files dns” tells the system to use the hosts files first, and then try DNS system.

Try which file has to be edited, because it is not clear which is used.

Linux: Using apt-get behind a http/ftp proxy

You need to create a file /etc/apt/apt.conf with the following content:

For HTTP:

For FTP:

You need root permissions to create/edit that file, but for using apt-get you already do so.

Bash: Set HTTP / FTP Proxy with Username and Password

You can set a HTTP Proxy for the CURRENT BASH with this command:

A FTP Proxy can be set like this:

With username and password it looks like this:

You can unset it with this commands:

Maybe use telnet to check if your proxy is reachable:

Press CTRL-C to abort if necessary.

Linux: md0 : active (auto-read-only) raid1

When you see this message in /proc/mdstat, it means that the raid partition is in auto-read-only mode. This mode is set when the device has not been written to since the last check.
In case of a normal partition, just try to write a file and the mode should disappear.
When its a swap partition, you can use this commands:

I got a cron email with this content, so i started investigating:

It seas about a Warning (W:), but i think it should rather be a notice…

Ubuntu: 12.04 wrong layout when using Logitech Keyboards

I had a strange bug after installing Ubuntu 12.04 Precise Pangolin or Xubuntu.
Even when i selected “German” keyboard layout while installation, after a reboot the keyboard layout always switched back to English when using my Logitech K400 keyboard. When using other keyboards the bug did not appear.
The solution was to add a second keyboard layout like “German (without accents)”, what stopped switching back to English layout when using my Logitech K400 keyboard.