Jump to content

Archived

This topic is now archived and is closed to further replies.

calvinmcdaniel

Apache Virtual Host

Recommended Posts

I need some help. I am running Apache server and would like to run 2 website from same IP. I've read the docs on how to set up the virtual hosts, but still can't get it.

I'm confused about the main server area at the top of httpd file for document root and directory. Are those to be left blank in order to pick up the virtual host information.

My sites come in on port 8000.

I've added this without luck.

namevirtualhose *:8000

<virtualhost *:8000>
documentroot c:\apache2\htdocs\cmcwebsite
servername www.cmcdaniel.com
</virtualhost>

<virtualhost *:8000>
documentroot c:\apache2\htdocs\awesomeframes
servername www.awesomeframes.com
</virtualhost>

Where am I messing up, please.

Thanks
Calvin McDaniel

Share this post


Link to post
Share on other sites
try to check this place for how to use virtual hosts in apache

[a href=\"http://www.debianhelp.co.uk/virtualhosts.htm\" target=\"_blank\"]Name and IP based Virtual hosts configuration[/a]

Share this post


Link to post
Share on other sites
You want to use "name based hosts" as follows:


<virtualhost www.cmcdaniel.com>
documentroot c:\apache2\htdocs\cmcwebsite
servername www.cmcdaniel.com
</virtualhost>

<virtualhost www.awesomeframes.com>
documentroot c:\apache2\htdocs\awesomeframes
servername www.awesomeframes.com
</virtualhost>

It is tricky on local binary systems (self installed AMP or phptriad or WAMP).

But it should work. You may have to turn on the name based Vhost mod.

This is assuming that the 2 sites are folders with full websites contained within. If you have one website set up in htdocs, and a folder for the other it will not work.

Share this post


Link to post
Share on other sites

×

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.