0

I have a server that runs win server and IIS, that machine also runs several linux vm's some are hosting sites with apache.

win server is useing domain.com i have set up virtualhost in apache in one of the vms to like sub.domain.com but how do i re-direct the trafic there, as it is now iis says like theres nothing here... i am a complete and utter newbie when it comes to this.

2 Answers2

1

First assign your VMs an IP Address and configure your VM Host to make it accessible - this highly depends on your architecture/design to do so (Either bridge your virtual adapter or virtual switch to your NIC if you only have one or use VLANs or a second adapter or ... or ... or).
Register this IP Address in DNS with your sub.domain.com. If you host DNS yourself (for an internal network for example) you can do it on your own, otherwise the service provider hosting your dns namespace will do that for you (if you ask him to do so).

Sebastian
  • 141
  • 5
  • uhm ok so i run hyper-v and my vm is on virtual adapter #1 which has 192.168.1.174 set as ip. and my vm got ip 192.168.1.178 set, so then i edit windows host file as this: 192.168.1.174 sub.domain.com? – per källström Nov 30 '16 at 09:35
  • i got an A record set för my sub.domain.com just to be clear :) – per källström Nov 30 '16 at 09:46
  • If you stay "local" on your host you can check functionality with your /etc/hosts file – Sebastian Nov 30 '16 at 10:16
  • What IP does the A record point to? Does the VM/Apache respond to http://? – Sebastian Nov 30 '16 at 10:17
  • the A record points on my external ip, since i only got 1 external ip. do i have to create some form of redirect from iis? since i reach the iis server no matter what adress i use pointed to my external ip. if i go to http://192.168.1.178 it points me right ofc. if i go to http://sub.domain.com on my vm it points me right – per källström Nov 30 '16 at 10:20
  • Then you need an dns alias sub.domain.com for the A record domain.com = 192.168.1.178. And as far as I know you cannot share :80 with your vm/apache (maybe there are implementations). Go for another Port on Apache (ex :88) and implement a redirect on IIS for sub.domain.com to 192.168.1.178:88 (which mighty be bad, if you want to access your page through firewalls). Another IP Address is preferred, I think – Sebastian Nov 30 '16 at 12:26
  • Ok, but if i point the A record to my local adress no one outside my network will be able to visit the site, right? – per källström Nov 30 '16 at 12:33
  • https://suntsu.ch/index.php?/archives/256-Setting-up-IIS-as-a-reverse-proxy.html This seems to work... :) – per källström Nov 30 '16 at 13:17
0

After googleing for what felt like 100 years this was my solution. https://suntsu.ch/index.php?/archives/256-Setting-up-IIS-as-a-reverse-proxy.html