Question:

I need help with apache!?

by  |  earlier

0 LIKES UnLike

ok. here's the situation. I have setup a web hosting server using "Uniform Server" which i downloaded from the internet.

i have a domain name and its DNS is set to my WAN IP and it works fine.

I would like to know how i can now add another 'site' so when people type in www.domain2.com it comes up with domain2 site still hosted on the same server.

I know it can be done as I have seen it - i just don't know how to do it.

my system is windows xp and like i say, it is Uniform Server with MySQL, PHP and Apache all as 1 package.

 Tags:

   Report

2 ANSWERS


  1. usually you need to distinguish between www.domain1.com and www.domain2.com via different public ip addresses.  DNS translates www.domain1.com to Public IP1 and www.domain2.com to Public IP2.  Your router is then mapped to send Public IP1 to one location and Public IP2 to another location (probably this can be done by the server itself but I have not tried to do this).


  2. Apache allows "VIRTUAL" hosts so you can host as many domains on the same IP as you would like (or have bandwidth to support!)  (The DNS all points to the same IP!)

    It is really as simple as adding a directive to the httpd.conf file

    suppose that you are serving the domain www.domain1.com and you wish to add the virtual host www.otherdomain.net, which points at the same IP address. Then you simply add the following to httpd.conf:

        NameVirtualHost *

        <VirtualHost *>

        ServerName www.domain1.com

        DocumentRoot /www/domain

        </VirtualHost>

        <VirtualHost *>

        ServerName www.otherdomain.net

        DocumentRoot /www/otherdomain

        </VirtualHost>

    See the Apache Docs for more information but that is really all there is to it! Apache will direct the domain name to the correct directory for the "new" domain.

    http://httpd.apache.org/docs/1.3/vhosts/...

    Using a hosting control panel makes it very easy to add virtuals as the control panel will make all changes for you!

    PS.  You would find that Linux makes a better OS choice with apache! You can even use older machines!

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions