Web Hosting Talk







View Full Version : Add Alias "WWW" for server to recognize


vietkool
12-15-2004, 09:35 PM
hi there,

I a new server and configure everything work great. Only one thing bother me that some reason server did not recognize "www" infront of the domain .
I very new to SSH to do the configure in Apache configure file.
so please step to show me how edit the config file so I can add the alias to have server recognized a "www" infront of the domain.

davevad
12-16-2004, 01:37 AM
In your Apache config file add the following file (if it's not already there):

NameVirtualHost IP ADDRESS

<VirtualHost IP ADDRESS>
ServerAlias www.domain.com
ServerAdmin info@domain.com
DocumentRoot /point/to/domain.com
ServerName www.domain.com
CustomLog /var/log/www.domain.com combined
</VirtualHost>

In your named zone file you have to add a www entry:
www IN A IPADDRESS

After you're done, restart apache and named. It's OS dependant how to do it, so if you don't know it, either post your OS or simply reboot the server.

vietkool
12-16-2004, 12:19 PM
I got it guys .. thanks for your help

VK