Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this questionSetting the hostname on an archlinux machine is relatively trivial according to this - https://wiki.archlinux.org/index.php/HOSTNAME#Set_the_hostname
So on my /etc/rc.conf, I have
LOCALE="en_US.UTF-8"
TIMEZ开发者_如何学GoONE="UTC"
MOD_AUTOLOAD="no"
USECOLOR="yes"
USELVM="no"
DAEMONS=(syslog-ng sshd crond ec2 httpd)
HOSTNAME="archlinux"
And corresponding on my /etc/hosts, I have
127.0.0.1 archlinux.domain.org localhost.localdomain localhost archlinux
Following the docs to the tee.
But unfortunately, restarting httpd fails with the error in the error_log:
[Tue Sep 06 04:26:06 2011] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "ip-10-130-57-114"
Configuration Failed
And yes, I am aware that from https://wiki.archlinux.org/index.php/Apache#Apache - it is possible to solve this problem by commenting
LoadModule unique_id_module modules/mod_unique_id.so
But I would much prefer to solve this problem by keeping this module loaded and resolving it by making sure that I have set my hostname correctly in /etc/hosts instead.
It looks like Apache is using "ip-10-130-57-114" hostname instead of "archlinux". Have you tried adding this entry into your /etc/hosts file?
10.130.57.114 ip-10-130-57-114
* I am guessing 10.130.57.114 is the internal host ip address of you instance.
What does hostname -f
say?
What is reverse DNS name for your IP?
Can you try to set host name to archlinux.<valid_domain>
instead of archlinux so it is globally resolved?
精彩评论