Re: Is it possible to configure two subdomains for an IP address?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 15, 2009 at 4:03 AM, Krist van Besien <krist.vanbesien@xxxxxxxxx> wrote:
On Sun, Mar 15, 2009 at 7:34 AM, Rex C. Eastbourne
<rex.eastbourne@xxxxxxxxx> 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?

At first glance what you did is entirely correct. However your apache
instance might be confused by other virtualhost declarations. You say
you are doing this on Ubuntu, right? Are you using the apache that
comes with Ubuntu?

If so, could you tell us the following:
- What file under /etc/apache2 did you modify?
- What is the output of apache2ctl  -S?

Krist



Hello all,

Thank you for the very helpful replies. Here is the information that was requested:

- I'm running Apache2 on Ubuntu (on a Slicehost VPS)
- The snippet above is from /etc/apache2/httpd.conf

Here is the output of apache2ctl -S:

====
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Tue Mar 17 05:10:16 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Tue Mar 17 05:10:16 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Tue Mar 17 05:10:16 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:*                    is a NameVirtualHost
         default server production.173.45.243.172 (/etc/apache2/httpd.conf:3)
         port 80 namevhost production.173.45.243.172 (/etc/apache2/httpd.conf:3)
         port 80 namevhost testing.173.45.243.172 (/etc/apache2/httpd.conf:8)
         port * namevhost 127.0.0.1 (/etc/apache2/sites-enabled/000-default:2)
Syntax OK
====

Here is the beginning of /etc/apache2/sites-enabled/000-default:

===
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
[rest of file snipped for brevity]
===

So it looks like there is indeed a NameVirtualHost * in another file. What would be the best modification to make now?

Thank you very much,

Rex

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux