Solved

Virtual Hosts Configuration

Posted on 2004-09-05
1
272 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
[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
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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