Solved

Virtual Hosts Configuration

Posted on 2004-09-05
1
265 Views
Last Modified: 2011-08-18
I want to have "localhost" go to "c:/program files/apache group/apache/htdocs/" and "*.cordx.com" go to "c:/program files/apache group/apache/htdocs/cordx/"

here is what i have.. and it doens't seem to work. What am i doing wrong:

Listen 80
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
   ServerName localhost
   DocumentRoot "c:/program files/apache group/apache/htdocs/"
</VirtualHost>

<VirtualHost 127.0.0.1>
    ServerName cordx.com
    DocumentRoot "c:/program files/apache group/apache/htdocs/cordx/"
</VirtualHost>

0
Comment
Question by:micamedia
1 Comment
 
LVL 38

Accepted Solution

by:
yuzh earned 500 total points
ID: 11986738
You need to do the followings:

1. Make sure that you had all the names the the server will be known in the "ServerAlias" (http://httpd.apache.org/docs-2.0/mod/core.html#serveralias) directive in the Vhost container.

2. Make sure that you have a DNS records for all VirtualHosts.

3. Check all the dir path, you make sure they are correct (use FULL PATH)

4. In your httpd.conf file, you need to make sure that your Mainhost, ServerName,  DocumentRoot ..... are defined (you can use the same IP as the other VirtualHosts

You need to have ServerName, ServerAlias, DocumentRoot  defined for your VirtaulHosts

eg:

 ServerName tiger.bush.us.com
......

    Define your mainhost as a VirtualHost as well (you can put it as your first VirtualHost,
just make a few records for the mainhost)

eg

<VirtualHost 216.201.174.114>
  ServerName tiger.bush.us.com
  ServerAlias tiger.bush.us.com
  DocumentRoot "/yourdoc-root"
  ScriptAlias /cgi-bin/ "/your-path-to/cgi-bin/"
    <Directory "/www/docs/headcase/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

# then put your other VirtualHost

Have a look at the following pages about virtual host setup:

http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_20772540.html
http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_20854598.html
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

22 Experts available now in Live!

Get 1:1 Help Now