Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a Meteor server on my Ubuntu server. But problems arise when I try to have Apache serving a subdomain on the same server. -> Meteor -> Apache

Meteor is running on port 80. I have previously tried to have Meteor run on port 3000 and served in reverse proxy with Nginx, but Meteor started to behave badly (tcp/websockets issues) and I spent too many evenings and nights to persist for my own sake.

So I reverted my setup to have Meteor being the main server (app works fine), and then install Apache the serve my subdomain. The problem is I cannot have Apache serve on port 80 too since it seems to overrun my Meteor server.

From experience, I try to stay away from reverse-proxying Meteor, but I'm not knowledgeable enough to get Apache to dedicate itself to my subdomain and without overwhelming "everything port 80" on my server.

How can I have both services behave with each other in this kind of setup?


Following EasyEcho suggestion, I turned to using 2 different ip addresses.

Let it be known, I'm using a "Next Generation" Cloud server on Rackspace (running the latest Ubuntu 12.04 LTS with latest grub2/updated kernel.

Rackspace does not allow additional IPs on their Cloud Servers (source)...

The next generation Cloud Servers platform powered by OpenStack does not yet support additional IP addresses.

... but you get 1 IPv4 and 1 IPv6 when creating a server. So why not hop into the IPv6 bandwagon? Easier said than done.

So here is my "new problem": After mapping my subdomain to the IPv6 address (AAAA in DNS) and configuring Apache to listen to the IPv6 address, I get this following behavior:

From my server remote desktop (using freeNX), in Firefox

  • http:// [my:ip:v6:address] -> Apache (WIN)
  • http:// -> Apache (WIN)
  • http:// my.ip.v4.address -> Meteor (WIN)
  • http:// -> Apache (FAIL)

From my workstation (Win7 x64), also in Firefox

  • http:// [my:ip:v6:address] -> The connection has timed out (FAIL)
  • http:// -> Server not found (FAIL)
  • http:// my.ip.v4.address -> Meteor (WIN)
  • http:// -> Meteor (WIN)

Here is my Apache configuration:


NameVirtualHost [my:ip:v6:address]:80
Listen [my:ip:v6:address]:80

<IfModule mod_ssl.c>
    Listen 443

<IfModule mod_gnutls.c>
    Listen 443


<VirtualHost [my:ip:v6:address]:80>
    ServerAdmin webmaster@localhost


    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined


Can this be fixed to work as "advertised"?

share|improve this question
What is returned from "dig" on the remote ubuntu machine? – EasyEcho Sep 6 '12 at 20:16
Thanks for your help!!! Just did the dig. Here are the results: – kinologik Sep 6 '12 at 21:11
Also, I found a very interesting thread here: - there might be a --binding=ip param in a future update of Meteor. Does not solve the problem in the "here and now", but nice to know I'm not alone with these kind of issues. – kinologik Sep 6 '12 at 21:17

If possible assign multiple IPs to the machine and set Meteor to bind to 80 on one of the ips and Apache to bind to port 80 on the other. See Apache Documentation and Meteor Demo which seems to cover what you are looking for.


Well that is lots of new info...

You likely can't connect to the IPv6 ip/host from your workstation because you are on IPv4.

share|improve this answer
Excellent point! But I'm trying to avoid the multiple IPs solution... Also, this is the Meteor server I'm talking about: Is there any other workaround beside going with multiple IPs? – kinologik Sep 5 '12 at 20:30
Damn that is confusing. It isn't possible to bind multiple applications to the same port/ip combination. Whichever application grabs the port first based on start order will be the winner. Apache can also function as a proxy server as well so that could be an option to try. – EasyEcho Sep 5 '12 at 20:34
Thank you very much for your feedback. Really appreciated. I'll try to proxy with Apache, but with the kind of results I got from Nginx, I'm a little skeptical... I'll post my result back here. – kinologik Sep 5 '12 at 20:54
I have tried with 2 IP adresses, but got very strange results (see my update). – kinologik Sep 6 '12 at 18:59

Hmm, you shouldn't need multiple IP addresses to do this.

Listen on with something lightweight like NginX or HAProxy (scaling won't be a problem), and then reverse proxy the traffic through to the relevant layer underneath, running on a separate ports (listen on localhost, not

So, request comes in for, and HAProxy internally routes the traffic through to Apache running on another port.

Request comes in for, and HAProxy internally routes the traffic through to Node.js...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.