Solved

Apache setup for host header resolution

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 124
Problem to go to Web page 2 89
Turning python script into an applet 12 99
How to insert gas or chemical names in SQL server. For e.g. CO2 to CO₂. 5 67
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

948 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now