Solved

Virtual Hosts Configuration

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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