For example, if your main domain name for the given server is

1. Switch to root user

sudo su

2. Open hosts file on the server

nano /etc/hosts

and make sure you have this in it: localhost.localdomain localhost
::1 localhost.localdomain localhost

Save the file.

3. Open Apache configuration file

nano /etc/httpd/conf/httpd.conf

And include the hostname here:


A popular way of doing it also is to have a subdomain assigned as a hostname.

4. Restart Apache

service httpd restart