multiple sites on one ip
Posted by: nateharper (---.cable.mindspring.com)
Date: October 15, 2006 05:10PM

i have been trying to set up two web sites off of one ip, but i dont know what to modify.
i have seen this on the forums before, but i couldnt find it again. please let me know what to file to modify or where the other form post was.

thank you in advance.

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: yfastud (---.cable.mindspring.com)
Date: October 15, 2006 06:09PM

Open httpd.conf in wamp/apache2/conf and roll to Virtual Host section almost in the bottom and add these codes:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName sub1.domain.com
DocumentRoot C:/wamp/www/sub1
</VirtualHost>

<VirtualHost *:80>
ServerName sub2.domain.com
DocumentRoot C:/wamp/www/sub2
</VirtualHost>

<VirtualHost *:80>
ServerName sub3.domain.com
DocumentRoot C:/wamp/www/sub3
</VirtualHost>

Check this post if using ip:

[forum.wampserver.com]

Note: After modified httpd.conf, you have to restart apache. Also, the provided codes are very basic, just for testing. If they work, you should configure more to meet your desire.

Hope this help

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: nateharper (---.cable.mindspring.com)
Date: October 15, 2006 07:17PM

i inserted what you gave me into the httpd.conf file so it looked like this at the very end:

#
# Use name-based virtual hosting.
#
#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>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
ServerName sub1.domain.com
DocumentRoot e:/wamp/www/sub1
</VirtualHost>

<VirtualHost *:80>
ServerName sub2.domain.com
DocumentRoot e:/wamp/www/sub2
</VirtualHost>

<VirtualHost *:80>
ServerName sub3.domain.com
DocumentRoot e:/wamp/www/sub3
</VirtualHost>


Include "e:/wamp/apache2/conf/alias/phpmyadmin.conf"
Include "e:/wamp/apache2/conf/alias/sqlitemanager.conf"

did i do it right or am i just not going to the right url when i test it our? i tried going to sub3.domain.com but it just said that page couldnt be found.
i am just running it on my personal computer with a dynamic ip. is this a problem or do i need to tell windows to look at the server to find it or what?

if i enter in my computer ip (192.168.1.6) it will go to an index of the sub1.domain.com


please help me.


thank you



Post Edited (10-15-06 19:20)

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: yfastud (---.cable.mindspring.com)
Date: October 16, 2006 01:39AM

Sorry, I forgot to tell you to replace ServerName with your real domain and sub-domain names. For example, your domain is nateharper.com, and you have 3 sub-domains are home, mail, and forum, then the codes should be like this:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName home.nateharper.com
DocumentRoot e:/wamp/www/home
</VirtualHost>

<VirtualHost *:80>
ServerName mail.nateharper.com
DocumentRoot e:/wamp/www/mail
</VirtualHost>

<VirtualHost *:80>
ServerName forum.nateharper.com
DocumentRoot e:/wamp/www/forum
</VirtualHost>

And you also have to register your sub-domains in your dns service to make it work as well, like mine:

[test.jlbn.com]
[mail.jlbn.com]
[forum.jlbn.com]
[ftp.jlbn.com]

Hope this help



Post Edited (10-16-06 01:40)

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: nateharper (69.91.34.---)
Date: October 16, 2006 03:31AM

is the dns server an outside company or is it on my computer?
im really just into testing and not too big on getting a giant expensive web site right now. do you know of any free dns services that are reliable?
or do i modify windows somehow?

thank you

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: yfastud (72.236.169.---)
Date: October 16, 2006 03:09PM

Get free dns account from dyndns.org or my favorite zoneedit.com which is easier to setup for a newbie, just like you and me.

Hope this help

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: nateharper (69.91.34.---)
Date: October 19, 2006 01:06AM

i regestered with zoneedit.com, waited the 72 hours or whatever. i put
NameVirtualHost *:80

<VirtualHost *:80>
ServerName ns10.zoneedit.com
DocumentRoot e:/wamp/www/sub1
</VirtualHost>

in the appache httpd file and then went to mail.nateharper.com and firefox said that the server couldnt be found.
could this be a problem with the appache file or is something else making it not work? i am connected to the internet through a router, that might be doing it, i just dont know.

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: yfastud (---.cable.mindspring.com)
Date: October 19, 2006 05:14AM

It's completely wrong.

First, after registered account at zone edit, you will be provided 2 server names that you need to replace them at the place you bought your domain.

Second, in vh, it should be your domain, not zoneedit, so it should be

NameVirtualHost *:80

<VirtualHost *:80>
ServerName mail.nateharper.com
DocumentRoot e:/wamp/www/sub1
</VirtualHost>

Also, you have to register mail.nateharper.com at zoneedit.com, for exmaple

mail.nateharper.com 100.101.102.103

Asume that 100.101.102.103 is your web ip which you get by [www.whereismyip.com]

Also check my post here for basic setup

[forum.wampserver.com]

Hope this help

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: Bulle Bas (---.solcon.nl)
Date: October 21, 2006 06:12PM

See also this tutorial [johnbokma.com] and the comments, especially that of user website-ontwikkeling.

Options: ReplyQuote
Re: multiple sites on one ip
Posted by: nateharper (69.91.34.---)
Date: November 07, 2006 05:30AM

i think ive got it. almost. with the domain thing, im trying to go for free, and so i registered for yahoo geocities. can i do the domain through yahoo for free?
if not, is there somewhere else that i could do it for free?

thanks

Options: ReplyQuote


Sorry, only registered users may post in this forum.