> -----Original Message----- > From: Fred Zinsli [mailto:fred.zinsli@xxxxxxxxxxxxx] > Sent: Tuesday, June 09, 2009 3:12 AM > To: users@xxxxxxxxxxxxxxxx > Subject: default site > > Hello all > > I am sure this has been asked, but I couldn't find the answer I was > looking for. > > I have apache 2.2 installed on my Debian server with name > based virtual > hosting. Single static IP. > > I have my DNS setup as wildcard left of the domain *.shooter.co.nz > I have setup the websites I wanted using individual conf > files and they > all work well. > > But when I type any other URL apart from those configured I get the > default "Its working" page. > > How can I point all other URLs not defined to a default site? Since you have defined name-based VHs, all requests that match a defined domain-name will end up in the appropriate VH. That, you say, is working.. However, a request with a domain-name that *doesn't* match a VH will be served outside the VHs by whatever default rules you have (look for "ServerName" and "DocumentRoot" outside any VH). The simplest fix is probably to pick a "default" VH and then assign all unmatched domains to it using the "ServerAlias" directive. Something like; <VH ip:80> ServerName www1.shooter.co.nz ServerAlias *.shooter.co.nz ... VHs are matched in config file order so the default one (containing "ServerAlias *.shooter.co.nz") should be last. NB: requests with *no* domain name (eg http://121.73.6.17/) will still go outside the VHs, to fix that, use "ServerAlias *", if that's what you want. Or edit the external DocumentRoot directive to point to some error page. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. > > The thing to concider is that I have phpmysql installed which is only > accessable via the local (192.168.*.*)IP of the machine from > inside the > LAN. It is not accessable from a name based URL. > > I wasn't sure if it was just a case of setting the default > document root > or not, but then I would probably loss my phpmysql accesss as the > document path would be invalid for that application. > > This is on a production server with 8 websites so hence I am cautious > about any changes on it. > > Any comments or pointers to documentation on this subject > would be most > helpful. > > Regards > > Fred > > > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP > Server Project. > See <URL:http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx > " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx > > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. The sender's company reserves the right to monitor all e-mail communications through their networks. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx