Solved

Apache setup for host header resolution

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

746 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

9 Experts available now in Live!

Get 1:1 Help Now