Jump to content

Recommended Posts

I got apache up and running, and I'm able to access a site with a dynamic IP remotely.  So, apache is set up correctly and hosting just one (1) site.

 

If I want to host 2 sites, let's say www.domain1.com and www.domain2.com with my one apache computer, how do I do that?

 

Thanks!

sorry made a big error there the last post was to goto another webserver

    Port 80

    ServerName server.domain.tld

 

    NameVirtualHost 111.22.33.44

 

    <VirtualHost 111.22.33.44>

    DocumentRoot /www/domain

    ServerName www.domain.tld

    ...

    </VirtualHost>

   

    <VirtualHost 111.22.33.44>

    DocumentRoot /www/subdomain

    ServerName www.sub.domain.tld

    ...

    </VirtualHost>

 

link

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

 

apache has a nifty little app called 'MindReader' that helps it serve the correct files from the correct site...

 

don't listen to redarrow - he goes on about some kind of newfangled technology that can actually recognize things... a pipedream if you ask me.

 

 

see this please read you got google.

 

Server configuration

# Ensure that Apache listens on port 80

Listen 80

 

# Listen for virtual host requests on all IP addresses

NameVirtualHost *:80

 

<VirtualHost *:80>

 

DocumentRoot /www/example1

ServerName www.example1.com

 

# Other directives here

 

 

</VirtualHost>

 

<VirtualHost *:80>

 

DocumentRoot /www/example2

ServerName www.example2.org

 

# Other directives here

 

 

</VirtualHost>

 

 

do i need to goto the server and copy mine?

 

made it even easer now

 

# Listen for virtual host requests on all IP addresses

NameVirtualHost *:80

 

<VirtualHost *:80>

 

 

// this is where the web files are sitting.

 

DocumentRoot /www/example1

 

//this is your www. name

ServerName  htpp://example1.com

 

# Other directives here

 

 

</VirtualHost>

 

<VirtualHost *:80>

 

// this is where the web files are sitting.

 

DocumentRoot /www/example2

 

//this is your www. Name

 

ServerName http://example2.org

 

# Other directives here

 

 

</VirtualHost>

 

here u go fully tested configuration for free domain setup.

 

 

you dont add silly programs to goto files use the correct way or no way.

 

all the best redarrow

 

 

in apache config page

 

unmark these

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

 

 

add this to your page at the bottom

 

NameVirtualHost *:80

 

#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

<VirtualHost *:80>

ServerName  my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\web_site_1"

</VirtualHost>

 

<VirtualHost *:80>

ServerName   my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\web_site_2"

</VirtualHost>

 

<VirtualHost *:80>

ServerName   my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\web_site_3"

</VirtualHost>

 

<VirtualHost *:80>

ServerName  my_free_domain.com

ProxyPass / http://192.168.0.4:32000/mail/ <<example to another server with port settings

</VirtualHost>

 

 

 

apache is easy and good fun to learn please read the manual or a book, you need to learn as much as possable,

take your time good luck...............

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.