You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Glen Barber <gl...@gmail.com> on 2009/03/15 08:57:39 UTC

Re: [users@httpd] Is it possible to configure two subdomains for an IP address?

On Sun, Mar 15, 2009 at 2:34 AM, Rex C. Eastbourne
<re...@gmail.com> wrote:
> Hello,
>
> I am completely new to Apache. I have a static IP address that's being
> hosted on an Ubuntu server. (I do not own a domain name yet.) I would like
> to have two versions of a web app on my IP address (let's call it X.X.X.X):
>
> test.X.X.X.X
> production.X.X.X.X
>
> Is this possible with Apache? I have gone through the Apache documentation
> on VirtualHosts, which I presume is how I would configure this. Here is what
> I have tried putting in my httpd.conf file
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
>     DocumentRoot /www/production
>     ServerName production.X.X.X.X
> </VirtualHost>
>
> <VirtualHost *:80>
>     DocumentRoot /www/test
>     ServerName test.X.X.X.X
> </VirtualHost>
>
> However, when I do this, I get the following error message:
>
> [error] VirtualHost *:80 -- mixing * ports and non-* ports with a
> NameVirtualHost address is not supported, proceeding with undefined results
>
> This is probably a very elementary error, but I am new to Apache and am
> having trouble understanding many of these terms. Could anybody provide some
> guidance on how I can get started with this setup?
>

I believe you are missing the 'ServerAlias' directive.

http://httpd.apache.org/docs/2.0/vhosts/name-based.html

-- 
Glen Barber

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is it possible to configure two subdomains for an IP address?

Posted by Krist van Besien <kr...@gmail.com>.
On Sun, Mar 15, 2009 at 8:57 AM, Glen Barber <gl...@gmail.com> wrote:

> I believe you are missing the 'ServerAlias' directive.
>
> http://httpd.apache.org/docs/2.0/vhosts/name-based.html

I don't think that's the problem, as the OP doesn't want one site with
two names, but two sites each with their own name. The classic virtual
host setup.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org