Solved

Apache setup for host header resolution

Posted on 2007-03-23
5
270 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 125 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 125 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

687 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