openSUSE Forums > Applications » apache namevhosts problem

Go Back   openSUSE Forums > Applications
Forums FAQ Members List Search Today's Posts Mark Forums Read


Applications Questions about desktops (KDE, Gnome, XFCE, etc.), software applications (configuration, usage, bugs, documentation)

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-Jul-2009, 01:09
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 22
korvirlol hasn't been rated much yet
Default apache namevhosts problem

Hello,

New to these forums, so i apologize if this is in the wrong place.

The problem:

I am trying to setup 2 virtual hosts on my apache webserver which is running opensuse 11.1

In the /etc/apache2/listen.conf file i have my:

NameVirtualHost *

in the /etc/apache2/vhosts.d/
I have 2 files, secure.conf and frontend.conf... both are copies of the template provided by apache.

When i restart apache, i get no errors at all. If i browse to the url that frontend.conf (domain.com) defines, it works, as expected... when i browse to the other one, secure.domain.com i get a page load error - address not found...

Im positive that both virtual host files are not the issue, but i can post them here if anyone would like to see them...

im out of ideas, any suggestions?
Reply With Quote
  #2 (permalink)  
Old 03-Jul-2009, 01:42
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,202
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: apache namevhosts problem

Sounds like secure.domain.com doesn't resolve to your webserver's IP address.

But to check that you have the namevhosts set up correctly, do:

/usr/sbin/httpd2 -S

and post the results.
Reply With Quote
  #3 (permalink)  
Old 03-Jul-2009, 01:50
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 22
korvirlol hasn't been rated much yet
Default Re: apache namevhosts problem

This is what i get:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:* is a NameVirtualHost
default server www.krm-tech.com (/etc/apache2/vhosts.d/front.conf:16)
port * namevhost www.krm-tech.com (/etc/apache2/vhosts.d/front.conf:16)
port * namevhost www.secure.krm-tech.com (/etc/apache2/vhosts.d/secure.conf:16)
Syntax OK

it almost looks like some default site is still there... i dont know

This make any sense?
Reply With Quote
  #4 (permalink)  
Old 03-Jul-2009, 02:02
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,202
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: apache namevhosts problem

Yes, it will work, provided www.secure.krm-tech.com resolves to your server's IP address. From your browser's error message, that doesn't seem to be happening. You are aware that you have to point the vhost domain name to the IP address in DNS, right? You can't just write a couple of conf files and have it work.
Reply With Quote
  #5 (permalink)  
Old 03-Jul-2009, 02:04
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 22
korvirlol hasn't been rated much yet
Default Re: apache namevhosts problem

I added a line for it in /etc/hosts ... is this not enough?
Reply With Quote
  #6 (permalink)  
Old 03-Jul-2009, 02:15
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 22
korvirlol hasn't been rated much yet
Default Re: apache namevhosts problem

Do you mean registering sub.domain.com with a dns registry? Did not think you had to do that with namevhosts
Reply With Quote
  #7 (permalink)  
Old 03-Jul-2009, 02:16
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,202
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: apache namevhosts problem

It must resolve on all clients, not the server.

Here's how namevhosts work:

1. Web browser gets http://foo.example.com

2. Resolves to IP address a.b.c.d

3. Connects to a.b.c.d and sends the request including a line with Host: foo.example.com.

4. Webserver sees that the request is intended for foo.example.com and uses the appropriate vhost. That Host: line makes all the difference.

If the client cannot resolve the vhost domain name, it doesn't get past step 2.
Reply With Quote
  #8 (permalink)  
Old 03-Jul-2009, 02:18
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,202
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: apache namevhosts problem

Quote:
Originally Posted by korvirlol View Post
Do you mean registering sub.domain.com with a dns registry? Did not think you had to do that with namevhosts
If that is what you have to do with for all the clients you are interested in, yes, you have to do it.

If only a few internal clients use it and they are all Linux/Unix, and you can edit /etc/hosts on all of them, then that will work.

If all the clients are internal and use an internal DNS server to resolve requests and you can control that DNS server, then you can add it there.
Reply With Quote
  #9 (permalink)  
Old 03-Jul-2009, 02:21
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 22
korvirlol hasn't been rated much yet
Default Re: apache namevhosts problem

but the domain is the same isnt it? krm-tech.com

I cant register a domain like secure.krm-tech.com

Sorry if im missing the point of your replies, trying to understand
Reply With Quote
  #10 (permalink)  
Old 03-Jul-2009, 02:32
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,202
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: apache namevhosts problem

secure.krm-tech.com is also a domain name. When Internet technical people say domain name, they don't mean just the domain krm-tech.com. Every name which is registered is a domain name, e.g. secure.krm-tech.com, mail.krm-tech.com, www.krm-tech.com, and so forth.

The confusion of a domain name with a domain is understandable.

If you have a registrar for krm-tech.com, then it's likely they give you the facility to add more domain names to the domain, like mail.krm-tech.com, www.krm-tech.com.
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2