Jump to content
The Uniform Server Community

Adding Vhosts Problem


vegbasket
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...