Find the answer to your Linux question:
Results 1 to 5 of 5
Hi All, I'm not terribly knowledgeable about Apache or networking, and I'm really struggling. I hope some kind person can help me. I'm running Apache 2.0.53 on SuSE 9.3. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3

    Apache Virtual Hosts in DMZ


    Hi All,

    I'm not terribly knowledgeable about Apache or networking, and I'm really struggling. I hope some kind person can help me.

    I'm running Apache 2.0.53 on SuSE 9.3. I had the server on a dedicated line with its own IP address and all the named virtual hosts (of the form name.server.com) I had set up were working just fine.

    I've now moved the server t a new location and it's in a DMZ. Whatever address I use, Apache uses the default server. If I change the default document root I get whatever I've set it to.

    How can I get the Virtual Hosts to work correctly once more?

    Thanks.

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,882
    You need to ensure that your virutal host web address resolves to your new IP address, e.g.

    Lets say your server is really called: www.example, which the DNS resolves to 1.2.3.4, and you have a virtual host called www.otherexample.com. If you make sure that DNS lookups for 'www.otherexample.com' point at 1.2.3.4, requests will come into your server with both with originating and destination IP address and the site name and page requested; which is how the virtual host system of apache sorts out which website is delivered.

    Take a look at your DNS records, and dont forget that these have to be publicly visible if you want public access.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Posts
    2
    I have a related question. I'm installing a web based application to a Linux server I want to host multiple application to. I have a few internal application for my network that I don't care about addressing and sub roots but this billing application will be as a sub domain (subdomain.domain.com) I configured dns to resolve correctly my question is other than setting my root/documents directory to point to this application how can I make subdomain.domain.com resolve to the proper directory which is not my root? Is this considered vhosting? do I use httpd.conf?

    Thanks,

  4. #4
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    Quote Originally Posted by Roxoff View Post
    You need to ensure that your virutal host web address resolves to your new IP address, e.g.

    Lets say your server is really called: www.example, which the DNS resolves to 1.2.3.4, and you have a virtual host called www.otherexample.com. If you make sure that DNS lookups for 'www.otherexample.com' point at 1.2.3.4, requests will come into your server with both with originating and destination IP address and the site name and page requested; which is how the virtual host system of apache sorts out which website is delivered.

    Take a look at your DNS records, and dont forget that these have to be publicly visible if you want public access.
    Thanks for the response. All the virtual hosts are on subdomains and we have a wildcard set p, so the DNS *is* resolving correctly.

    The server is serving up the default site regardless of what subdomain I use, even if I use one that's not set up as a virtual host.

  5. #5
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    Hi All,

    I've managed to solve the problem. I just needed to change the NameVirtualHost directive to the internal IP address of the server, and create entries in the hosts file for each virtual host, pointing to the server's internal IP. All seems well now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •