Web Hosting Talk







View Full Version : ServerAlias for server domain


afriq
06-16-2001, 04:02 AM
Hi there,

How does one add the ServerAlias for the main server domain?

I've added a ServerAlias line in /etc/admserv/conf/httpd.conf , but when restarting the server, I got this error:

"ServerAlias only used in <VirtualHost>"

The nasty side effect is that when accessing my site without the www bit (http://whatever.com") visitors are being redirected to the first VirtualHost in the conf file.

Thanks,

Johan

kentaurus
06-16-2001, 04:08 AM
Make sure you add the ServerAlias right below the <Virtualhost> part of your httpd.conf

If you are trying to configure a domain so you can enter via www.domain.com or domain.com you can do that from cobalt's control panel as well.

afriq
06-16-2001, 04:17 AM
Kentaurus,

Just to clarify ...

The main server domain is not specified as a virtual host.

Let's say it is www.abc.com: On the RaQ 4 domain www.abc.com is defined in /etc/admserv/conf/httpd.conf, and not in /etc/httpd/conf/httpd.conf, where all the virtual domains are defined in.

Johan

highlander
06-16-2001, 11:59 AM
Johan,

I use an admin.thedomain.ext as my server name and then added my main domain as a virtual, this might be worth considering as an easy workaround.

Robert