25 February 2015

Apache httpd starting issue regarding ServerName directive

After fresh installation of apache httpd 2.4, while starting the service I got this error:

# /etc/init.d/httpd restart
 * Starting web server httpd

 ... waiting httpd: apr_sockaddr_info_get() failed for server
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


Even though my hostname in RHEL 6 is setup properly in /etc/sysconfig/network file:

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hs2.example.com 

To solve this issue, ServerName directive in the main httpd.conf need to be commented out and set as localhost: 
# vim /etc/httpd/conf/httpd.confServerName 

...
ServerName localhost
...


And now apache httpd restarting properly:

# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]





2 February 2015

Setup hostname for Linux Kernel 3 on RHEL/CentOS 7

Q: How to set system hostname and check OS release in Kernel 3(RHEL7/CentOS7,SLES 12)

New "hostnamectl" with "set-hostname" option is the command to set the hostname:

# hostnamectl set-hostname centos7.lab.local

# hostnamectl
Static hostname: centos7.lab.local
Icon name: computer
Chassis: n/a
Machine ID: 4fdda1019a87407292b81632baaee833
Boot ID: cbf0ab39a62e4f09a55e74ccc8dd979c
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-229.el7.x86_64
Architecture: x86_64


To check the release version in new kernel 3, /etc/os-release is used:

Legacy method:

# cat /etc/SuSE-release 
openSUSE 13.2 (x86_64)
VERSION = 13.2
CODENAME = Harlequin
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead

New method:

# cat /etc/os-release 
NAME=openSUSE
VERSION="13.2 (Harlequin)"
VERSION_ID="13.2"
PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"