Solved

Apache setup for host header resolution

Posted on 2007-03-23
5
269 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
move expression web site to a new server 13 77
Query Syntax 17 52
Programming Codes 2 45
Create .bat File 16 73
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

726 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