Apache reverse proxy for Cloud9 using ServerName

apache-2.2proxypassreverse-proxyvirtualhost

I am trying to setup a reverse proxy to a Cloud9 instance running locally on my server using Apache. I have the following setup:

<VirtualHost *:80>
  ProxyPreserveHost On
  ProxyPass / http://localhost:3131/
  ProxyPassReverse / http://localhost:3131/
  ServerAdmin cloud9@mydomain.org
  ServerName cloud9.mydomain.org
</VirtualHost>

I have also tried re-ordering the directives so the ServerAdmin and ServerName came first. So far, if I hit http://cloud9.mydomain.org, I get a browser error saying it could not connect. There is nothing logged in Apache's access.log or error.log either. I am thinking that I am missing some piece, but I am not sure as to what that missing piece might be yet. I also don't know if I am looking in the right place for logs. The Cloud9 process was started, and appears to be running on the 3131 port.

I don't plan to run Cloud9 wide open. The end-game I am shooting for is to eventually get Cloud9 hosted through SSL using some auth, maybe basic auth, but I figured before I started adding SSL and auth into the mix, I should probably get the basics working first.

Update
Output of apachectl -S:

# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server www.mydomain.org (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost www.mydomain.org (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost wp.mydomain.org (/etc/apache2/sites-enabled/001-wordpress:1)
         port 80 namevhost blog.mydomain.org (/etc/apache2/sites-enabled/001-wordpress:22)
         port 80 namevhost cloud9.mydomain.org (/etc/apache2/sites-enabled/003-cloud9:1)
Syntax OK

Output of curl -I cloud9.mydomain.org:

curl: (6) Couldn't resolve host 'cloud9.mydomain.org'

Output of curl -I localhost:3131:

HTTP/1.1 403 Forbidden
Content-Type: text/plain
Content-Length: 9
Set-Cookie: cloud9.sid.3131=bqk4zxV4ETq9rrO79E4mkJn9.YW7gMDRCsOO95utQJy1mYm8LfTfZC%2F7Fx59DeFRFDpU; path=/; expires=Thu, 19 Sep 2013 02:07:41 GMT; httpOnly
Date: Wed, 18 Sep 2013 22

When I try to hit the site externally using Chrome, I get:

Oops! Google Chrome could not find cloud9.mydomain.org

Did you mean: mydomain.org

Which is the default page Chrome displays when it cannot connect. Again, I don't see any errors in the access.log or error.log, unless for some reason it's not logging in the same place. I am going into /var/log/apache2 and doing an ls -lart to make sure I am seeing the latest log file.

Best Answer

<VirtualHost *.80> - change that to <VirtualHost *:80>.

That might be all that's needed, but if not, can you provide the output of apachectl -S?

Related Topic