Shammer's Philosophy

My private adversaria

Using IP address as Apache ServerName directive

This blog is a feedback to Shammerism.
I would like to use IP address as Apache ServerName directive.
This blog is steps how to use IP address as ServerName.

  1. Adding IP address to /etc/hosts
  2. Adding ServerName directive to /etc/apache2/site-available/XXX
  3. apachectl configtest
  4. /etc/init.d/apache2 restart

If there is no problem, the message "Could not reliably determine the server’s fully qualified domain"
would not be output as the result of apachectl configtest command.

Here is a sample of /etc/hosts.

127.0.0.1    localhost
192.168.1.10	hostname.myexample.jp	hostname
172.16.10.10	hostname.myexample.jp	hostname

Apache config sample is below.

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName	172.16.10.10
...snip