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
https://forums.phpfreaks.com/topic/3581-apache-virtual-host/
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
https://forums.phpfreaks.com/topic/3581-apache-virtual-host/#findComment-21253
Share on other sites

Archived

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

×
×
  • 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.