Jump to content


Photo

Adding Vhosts Problem


  • Please log in to reply
1 reply to this topic

#1 vegbasket

vegbasket

    Newbie

  • Member
  • Pip
  • 1 posts
  • Main OS: Windows 7

Posted 22 August 2013 - 06:17 AM

Ok have tried to set up the following vhosts

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/trunk/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#--US_START--------------Do not remove
#--US_END----------------Do not remove
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

# First Virtual Host must be a shallow duplicate of the main host
# in httpd.conf

<VirtualHost _default_:80>
DocumentRoot C:/moonbidserver/UniServer/www
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@moonbid.com
DocumentRoot C:/moonbidserver/UniServer/vhosts/moonbid.com
ServerName moonbid.com
ServerAlias www.moonbid.com *.moonbid.com
ErrorLog logs/moonbid.com-error.log
CustomLog logs/moonbid.com-access.log common
<Directory "C:\moonbidserver\UniServer\vhosts\moonbid.com">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@moonbid.co.uk
DocumentRoot C:/moonbidserver/UniServer/vhosts/moonbid.com
ServerName moonbid.co.uk
ServerAlias www.co.uk *.co.uk
ErrorLog logs/moonbid.co.uk-error.log
CustomLog logs/moonbid.co.uk-access.log common
<Directory "C:\moonbidserver\UniServer\vhosts\moonbid.com">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@sellmycrafts.co.uk
DocumentRoot C:/moonbidserver/UniServer/vhosts/sellcrafts
ServerName sellmycrafts.co.uk
ServerAlias www.co.uk *.co.uk
ErrorLog logs/sellmycrafts.co.uk-error.log
CustomLog logs/sellmycrafts.co.uk-access.log common
<Directory "C:\moonbidserver\UniServer\vhosts\sellcrafts">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@woodsncrafts.com
DocumentRoot C:/moonbidserver/UniServer/vhosts/woodsncrafts
ServerName woodsncrafts.com
ServerAlias www.woodsncrafts.com *.woodsncrafts.com
ErrorLog logs/woodsncrafts.com-error.log
CustomLog logs/woodsncrafts.com-access.log common
<Directory "C:\moonbidserver\UniServer\vhosts\woodsncrafts">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@sellmycrafts.servebeer.com
DocumentRoot C:/moonbidserver/UniServer/vhosts/sellcrafts
ServerName sellmycrafts.servebeer.com
ServerAlias www.servebeer.com *.servebeer.com
ErrorLog logs/sellmycrafts.servebeer.com-error.log
CustomLog logs/sellmycrafts.servebeer.com-access.log common
<Directory "C:\moonbidserver\UniServer\vhosts\sellcrafts">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

The vhost sellcrafts is meant to resolve at sellmycrafts.co.uk buy resolves at moonbid.co.uk / .com

The only reason i can see this is happening is that even though both domains are pointed to my ip address they are also hosted with the same company under the same dns name servers

Any other vhost created who's urls are hosted on different names servers resolve at the vhost's created ie www.woodsncrafts.com and sellmycrafts.servebeer.com

Is there a way i can get sellmycrafts.co.uk to resolve at its respective vhost folder

#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 22 August 2013 - 12:53 PM

I think it’s an issue with ServerAlias:

You have:
ServerName moonbid.co.uk
 ServerAlias www.co.uk  *.co.uk
Should be:
ServerName moonbid.co.uk
  ServerAlias www. moonbid.co.uk   *. moonbid.co.uk

Similarly:
ServerName sellmycrafts.co.uk
  ServerAlias www.co.uk  *.co.uk
Should be:
ServerName sellmycrafts.co.uk
  ServerAlias www. sellmycrafts.co.uk   *. sellmycrafts.co.uk

All the best
Ric




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users