[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Apache setup for host header resolution

Posted on 2007-03-23
5
Medium Priority
?
272 Views
Last Modified: 2013-11-13
I'm attempting to setup Apache 2.0.59 for use with Subversion.  I'm installing on a Win2003 server that previously had IIS 6 running.  In it's IIS configuration, I had 4 websites running using host header resolution.

This is probably very easy for someone who knows what they are doing in Apache, but I cannot get the host header resolution working.  From what I have read I should be doing this with the virtualhost directive.

Here's an example of my setup:

I've pulished DNS A records for svn.mydomain.com and test.mydomain.com to the same public ip.

These are the http.conf settings that I believe to be relavant:

    ServerName InternalName.mydomain.com

    NameVirtualHost *:80

    <VirtualHost svn.mydomain.com:80>
    DocumentRoot c:/svn
    ServerName svn.mydomain.com
    </VirtualHost>
   
    <VirtualHost test.mydomain.com:80>
    DocumentRoot c:/test
    ServerName test.mydomain.com
    </VirtualHost>


When I hit the server as http://InternalName.mydomain.com, I get the Apcahe successfull install default page.  When I navigate to http://test.mydomain.com or http://svn.mydomain.com I get error: HTTP 404 The webpage cannot be found.  

Thanks in advance,
Jason
0
Comment
Question by:jlexer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 18784166
Try "C:\svs" and  "C:\test" for your documentroots
0
 

Author Comment

by:jlexer
ID: 18785265
I tried enclosing the DocumentRoot in quotes, but get the same response: HTTP 404
0
 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 18785602
I just tested and your original defintions will work as long as:=

     C:\svn does exists
     C:\test does exists
     There is a index.html in both directories

I tested with Apache 2.2 under Windows XP although any recent level of Apache should work on any recent release of Windows.
0
 
LVL 1

Assisted Solution

by:the__tyrant
the__tyrant earned 500 total points
ID: 18792406
You need to change:
<VirtualHost svn.mydomain.com:80> to: <VirtualHost *:80>
make sure ServerName is set to svn.mydomain.com and ensure
that DocumentRoot is set to a directory that exists.

So:
<VirtualHost *:80>
    ServerName svn.mydomain.com:80
    DocumentRoot c:/svn
#    ServerAlias svn2.mydomain.com snv.mydomain.com
#    DirectoryIndex index.html index.pl
</VirtualHost>

Give this a try, should work out fine
0
 

Author Comment

by:jlexer
ID: 18792974
Looks like the problem may not have been in the .conf  directly.  I'm naive to Apache, and all my sites are runnings ASP.Net.  There is no .html file in any of my folders.  Thanks to commentor, "The_Tyrant" gave me the clue with the DirectoryIndex comment,  I read more about the setup of what was needed to get ASP.Net running on Apache, and feel it will be simpler to maintain by just keeping my ASP sites on a server running IIS and a separate server for the site requiring Apache.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Six Sigma Control Plans
Progress

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question