0

I'm using XAMPP on a VPS of mine, where I try to host 2 different websites at the moment. I plan on being able to host more. Currently; if I go to the VPS IP and one of the defined ports (in this case the two different ports I use are 8001 and 8002) a different site displays. Port 8001 reads from one directory and port 8002 from another.

Now comes the tricky part. I want a domain of mine - let's say www.foo.com - direct to the IP with port 8001 for example. How can I do this? I was thinking it was via DNS but I read something that DNS has no perception of ports.

UPDATE: As per usual I always plan things to be much more complicated than they are. Correct vHost-settings = no need for ports etc ;)

  • FYI, cross-posting is frowned upon. I flagged your question to be closed at Stack Overflow. – John Conde Apr 21 '17 at 12:38
  • @JohnConde Roger, deleted the post over there since it was pretty useless – Jonathan Öhrström Apr 21 '17 at 12:39
  • Possibly an aside, but... Is there a specific reason why you are using these/different ports? – MrWhite Apr 21 '17 at 13:52
  • @w3dk I just chose these ports since they're not used by my system, from what I've heard they'll work fine for apache if configured as such – Jonathan Öhrström Apr 22 '17 at 9:38
  • After some more research, I'm wondering if it's possible to create sort of a new IP that masks my original ip and port? – Jonathan Öhrström Apr 22 '17 at 21:37
0

You are trying to over complicate things. XAMPP includes Apache (which has vHost support). You do this much the same as any other vHost setup. You create a new vHost configuration setting the hostname to the right domain name and the document root to the appropriate file path on the file system. By doing this you are only using a single port (port 80, the default http port) but you can run as many websites as your server can handle based on simultaneous connections.

  • Yeah, I updated the OP a couple hours prior to your post regarding the whole over-complicating thing! It's pretty typical of me, reading just a bit of information and then trying to figure the rest out by myself for some reason haha. Thanks anyway, got some info now that's prolly useful – Jonathan Öhrström Apr 23 '17 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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