Putting serveralias in httpd.conf - where do i need to put it?

Hi,

I need to put this directive in to httpd.conf:

ServerAlias *.your-domain-name.com

I’m not sure where exactly to put it though. Tried using my intuition and put it in where I thought but once i restarted the server all my sites were down.

Any ideas? Does it need to be surrounded by <virtualHost> blocks or something?

e,

Yes. In Apache 2.x (at least on a WinDoze box), this is in a separate file called httpd-vhosts.conf.

Regards,

DK

No, I don’t see that httpd-vhosts.conf file…it’s not in any directories I can see and I’ve searched also. I am on a linux box.

Can’t I just put this directive in httpd.conf? I really don’t know if I need a <virtualhost> bock around it?

elduderino,

Yes, it’s a VirtualHost issue.

Regards,

DK

Hi Dklynn,

Many thanks for replying again…i’ve tried putting this in the correct file:

<VirtualHost 87.106.101.86:80>
ServerName myurl.com
ServerAlias *.myurl.com
DocumentRoot /var/www/vhosts/url.com/subdomains/radio/httpdocs
CustomLog /var/www/vhosts/url.com/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/url.com/statistics/logs/error_log

</VirtualHost>

does it look right to you?

eldude,

Actually, I doubt that VirtualHost can take a wildcard like that but I’d have to check the Dynamically configured mass virtual hosting page at Apache.org.

Regards,

DK