LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: apache mod_vhost_alias and normal vhosts

[ILUG] Re: apache mod_vhost_alias and normal vhosts

Stephen Shirley diamond at skynet.ie
Tue Aug 29 22:35:17 IST 2006


*sigh* I've found the problem, and have a solution. It's not pretty.
What happens is this (despite the fact that it makes no sense to do so
because we're using mod_vhost_alias): Because there is no ServerName
entry in the first <VirtualHost>, apache will do a reverse dns lookup
on the ip supplied, and use that instead. As that ip resolves to
'ja.ichbinn.net', the first vhost will _always_ match it.

With that in mind, the solution is this: add a bogus ServerName entry
to the <VirtualHost>. Apache doesn't seem to care if it resolves or
not, so i've gone with the following (repeating the whole config again
for clarity):

-------------------------------8<--------------------------
NameVirtualHost 213.239.204.216:80

<VirtualHost 213.239.204.216:80>
   ServerName somethingwhichdoesntexist.ichbinn.net
    VirtualDocumentRoot /srv/%1/public_html
</VirtualHost>

<VirtualHost 213.239.204.216:80>
    ServerName www.ichbinn.net
    ServerAlias ichbinn.net ja.ichbinn.net
    DocumentRoot /var/www/
</VirtualHost>
------------------------------->8--------------------------

Et voila, though ugly, it works. Thanks to madduck for pointing out
what was going wrong.

Steve
-- 
"You are technically correct, the best kind of correct."
- Bureaucrat 1.0, Futurama



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell