You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Re...@aol.com on 2004/03/22 01:14:01 UTC

[users@httpd] Configuration of Apache

Dear friends,

(Apache2 configuration)
I created directory home and within that created two directories for  
www.domain.com
 www.domain2.org 
within directory of each site I put index files of web sites in each directory

In Apache configuration file I entered following directives

<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>


    NameVirtualHost *

    <VirtualHost *>
    ServerName www.domain.com
    DocumentRoot /home/domain
    </VirtualHost>

    <VirtualHost *>
    ServerName www.domain2.org
    DocumentRoot /home/domain2
    </VirtualHost>



Once I enter http://localhost I get www.domain.com , how do I visualize 
second web site 
 www.domain2.org 

and how do I see both of these sites over the internet.

Comments, please

Re: [users@httpd] Configuration of Apache

Posted by Jez Hancock <je...@munk.nu>.
On Sun, Mar 21, 2004 at 07:14:01PM -0500, Remember14a@aol.com wrote:
> In Apache configuration file I entered following directives
> 
>     NameVirtualHost *
> 
>     <VirtualHost *>
>     ServerName www.domain.com
>     DocumentRoot /home/domain
>     </VirtualHost>
> 
>     <VirtualHost *>
>     ServerName www.domain2.org
>     DocumentRoot /home/domain2
>     </VirtualHost>
> 
> Once I enter http://localhost I get www.domain.com , how do I visualize 
> second web site 
>  www.domain2.org 

I presume you mean that you don't currently have any DNS set up for
domain.com or domain2.org - if this is the case you should configure
your /etc/hosts file with static DNS entries such as:

127.0.0.1 www.domain.com www.domain2.org

this way when you enter:

http://www.domain.com/ 

or

http://www.domain2.org/

a request will be made to 127.0.0.1 and the content will be served up
according to your vhost config above.


> and how do I see both of these sites over the internet.

To see these over the internet you need to make the DNS public -

- register the domain names with a registrar 
- configure DNS A records for www.domain.com and www.domain2.org so they
  both point to the IP address of the webserver that will be serving
  files for the domains

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org