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.
- Adding IP address to /etc/hosts
- Adding ServerName directive to /etc/apache2/site-available/XXX
- apachectl configtest
- /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