-1

My PC is my server that runs on XAMPP, and I also made it accessible from a real domain name (www.example.com).

Now, how do i make a subdomain (node.example.com) to point to nodeJS, and all other domains/subdomain stay as they are?

I use Windows 8.1.

Also, do you then need to run the NodeJS server command prompt along side with XAMPP control panel? Or is it possible with XAMPP alone given that I have NodeJS installed and working.

Will
  • 24,082
  • 14
  • 97
  • 108
BorissOliSiin
  • 317
  • 1
  • 5
  • 13
  • My guess is that it's not directly programming-related. However, it seems that this is a development environment so I find it to be on-topic. Any questions related to networking or server applications should really go on [ServerFault](https://www.serverfault.com), however, questions related to setting up your development environment are on-topic for SO. Also, requesting a "long, step-by-step guide" might bring downvotes--on SO you're really supposed to post what you've tried and where you're stuck and ask specific questions. – Will Jul 13 '15 at 21:18
  • I posted here because I saw similar questions on this site before. (Thanks for ServerFault, tho). The reason why I asked for "long step-by-step" is because i am frustrated with this site with users avoiding the hard questions and just simply down-voting and not saying why. – BorissOliSiin Jul 13 '15 at 21:23
  • down-voted again. I think this is the last time I am posting here. It would take a miracle for me to use this site again. – BorissOliSiin Jul 13 '15 at 21:30
  • People here can definitely be too quick to downvote questions, but there are also a lot of guidelines to follow when posting a question. Try editing it and adding a bit more detail. I upvoted you, for the record. It's also against guidelines to downvote without a comment to explain why. Try the same question over at ServerFault--you wouldn't get the same results here if this were more-directly a programming question. I still think the `ProxyPass` is the way to go--can you maybe edit and post your `ProxyPass`/`VitrualHost` configuration for Apache so we can try to debug it? – Will Jul 13 '15 at 21:39
  • Thanks, I agree with what you said 100%. Well.. I'll stick around this post, in case someone (or myself) post a final answer. Thanks for ServerFault ! – BorissOliSiin Jul 13 '15 at 21:45
  • That's not true @Will - there are no guidelines stating a user must leave a comment when they down-vote. This topic has been [hotly debated on Meta](http://meta.stackexchange.com/questions/135/encouraging-people-to-explain-downvotes). – Jay Blanchard Jul 13 '15 at 22:00
  • Okay well, there are guidelines *suggesting* that users comment when they downvote (try clicking on a downvote button to see for yourself). I never said *must*, I said "guidelines against", and guidelines are not rules. It's the "right thing to do" to leave a comment when you downvote, and it's a bit rude not to (unless, of course, another comment already explains it well enough). I realize that it is not against the rules, but, it is officially suggested that it should be done. – Will Jul 13 '15 at 22:42
  • It upsets me that @BorissOliSiin is having a bad experience with SO on something that should be a valid question (though lacking some detail), and no one bothers to tell him how to improve his post. – Will Jul 13 '15 at 22:43
  • To be honest, someone did help me re-do my title and tags for this question. But, as it seems, Stack Overflow dislikes both silly and serious questions (I've noticed that a long time ago), and likes questions somewhere in the middle. – BorissOliSiin Jul 14 '15 at 07:28
  • My question is neglected both in here, and on ServerFault: http://serverfault.com/questions/705540/serving-php-and-node-js-from-the-same-apache-server-via-xampp. – BorissOliSiin Jul 14 '15 at 08:50
  • @Will [sf] doesn't accept questions about either home servers or developer environments, and this question appears to be both. – Michael Hampton Jul 14 '15 at 14:30
  • I'm well aware, but, he said he had a domain pointed at it. Is there another SE site more appropriate for his question? Why am I the only upvote, with 3 downvotes, for a question that seems to best fit on SO? It's lacking a bit of detail but not that much. No one explained their downvotes, just... me guessing at them. – Will Jul 14 '15 at 16:52

1 Answers1

0

They can easily both run on the same machine. You can continue to use mod_php to serve PHP requests, or configure php-fpm. For Node.JS, you can either use FastCGI/uWSGI, or just use Apache's mod_proxy and ProxyPass to proxy connections to the Node processes. This post explains the latter process well. You asked how to use a different subdomain--the way to this is with an Apache VirtualHost. This will get you started with configuring VirtualHosts, and then you'll want to use the ProxyPass method inside the Node VHost.

Community
  • 1
  • 1
Will
  • 24,082
  • 14
  • 97
  • 108
  • Thanks. I just came from that link you sent me. it DOES work, but only with the localhost:12345 in the url.. my question was how do i make a subdomain point to such a thing AND use ordinary php for other subdomains as before nodeJS. – BorissOliSiin Jul 13 '15 at 21:19
  • Well, that's the point of the ProxyPass. Apache isn't involved when you go directly to the node port. If `mod_proxy` is enabled and the `ProxyPass` is correctly configured, you won't need the port number. – Will Jul 13 '15 at 21:21
  • Edited to add some information about the subdomain; I missed that part in your original question. – Will Jul 13 '15 at 21:42