Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Virtual Hosts Configuration

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

824 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