If you are installing LAMP on a new server and ran into the following issue with httpd during the startup:

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

or

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

you need to change it to make your server identifiable on the network. Hostname is the name that server calls itself i.e. it could be cp.yourdomain.com or mail.yourdomain2.com

In order to change hostname on your CentOS server permanently follow these steps
1. At your domain registrar level assign new host record to your server's IP address
2. Make sure you have nano installed

yum install nano

3. Edit network configuration file while logged in as root

nano /etc/sysconfig/network

4. It will open file with the content like below:

NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=123.234.123.234

5. Change the HOSTNAME to the name that you've assigned at your domain registrar level
6. Hit Ctrl-X to exit and save changes
7. Reboot your server for changes to take effect
Was this answer helpful? 46 Users Found This Useful (108 Votes)