Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apache proxy, Node.js and Default Websites

Hello everyone !


I'm currently using a mac mini server under OS X Mavericks (10.9.1) and Server 3.0.2


I've been very happy with it, and found it was quite nice to use... until I decided to host a Ghost blog (https://ghost.org) on it. Ghost runs on Node.js (http://nodejs.org).


I have a domain (domain.com), and two subdomains (www.domain.com and sub.domain.com).

The server and it's default websites use sub.domain.com, with http://sub.domain.com redirecting to https://sub.domain.com


I want to use both domain.com and www.domain.com for the blog.

Using cloudflare for the DNS, I created a CNAME for domain.com, pointing to www.domain.com (domain.com CNAME www.domain.com).


Node.js and Ghost install both went well, with Node.js listening on port 2368.


I then started configuring a virtual host (www.domain.com) in the Server.app for the Ghost blog , along with an Apache Reverse Proxy, by editing www.domain.com's .conf and replacing everything in it by


<VirtualHost 10.0.1.2:80>
ServerName www.domain.com
ProxyPreserveHost on
ProxyPass / http://localhost:2368/
</VirtualHost>


Going to www.domain.com, I correctly end up on the Ghost blog.

But, amusingly and annoyingly, when trying to access the default website through sub.domain.com... it's also the blog that shows up ! 😕


After setting up another website (sub2.domain.com) in the Server.app and configuring the DNS appropriately at Cloudflare, I could notice that I end up on the default page for "empty" websites (the "welcome to Server... blabla" page).


So the server's default website is the only one getting this issue...


I've been spending two days on it, trying nearly every other Apache Reverse Proxy configuration I could find (yes, even the weird one where you go through DNS settings that you can find somewhere in these forums).


Anyway, some help would be greatly appreciated 😍

MAC MINI SERVER (LATE 2012), OS X Mavericks (10.9.1), Server 3.0.2

Posted on Feb 12, 2014 7:32 AM

Reply
Question marked as Best reply

Posted on Feb 13, 2014 6:07 AM

Ok... So, while I did not find a solution, I did find a workaround.


Get ready people...


First, create www.yourdomain.com on port 8080 in the Server App.

Then, create www.yourdomain.com on port 80 in the Server App, and choose to make a redirection from this site to www.yourdomain.com:8080.


After, go to the 0000_any_8080_www.yourdomain.com.conf file, and open it with textedit.

Replace everything in it with


<VirtualHost *:8080>

ServerName www.domain.com

ProxyPreserveHost on

ProxyPass / http://localhost:2368/

</VirtualHost>


Save it (don't forget replace the original 0000_any_8080_www.yourdomain.com.conf with it if needed and to keep the.conf extension)


And there you go !


For SSL, do the same thing, except you need to replace the 80 port by the 443 port, and the 8080 port by the 8443. And don't forget the certificates, for both of them.

2 replies
Question marked as Best reply

Feb 13, 2014 6:07 AM in response to ElFitz

Ok... So, while I did not find a solution, I did find a workaround.


Get ready people...


First, create www.yourdomain.com on port 8080 in the Server App.

Then, create www.yourdomain.com on port 80 in the Server App, and choose to make a redirection from this site to www.yourdomain.com:8080.


After, go to the 0000_any_8080_www.yourdomain.com.conf file, and open it with textedit.

Replace everything in it with


<VirtualHost *:8080>

ServerName www.domain.com

ProxyPreserveHost on

ProxyPass / http://localhost:2368/

</VirtualHost>


Save it (don't forget replace the original 0000_any_8080_www.yourdomain.com.conf with it if needed and to keep the.conf extension)


And there you go !


For SSL, do the same thing, except you need to replace the 80 port by the 443 port, and the 8080 port by the 8443. And don't forget the certificates, for both of them.

Apache proxy, Node.js and Default Websites

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.