Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Virtual Hosts Configuration

Posted on 2004-09-05
1
Medium Priority
?
274 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 2000 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

688 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