Jump to content

Apache Virtual Host


calvinmcdaniel

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
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
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.

Link to comment
Share on other sites

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.