LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   running linux web apps in windows (https://www.linuxquestions.org/questions/linux-networking-3/running-linux-web-apps-in-windows-865312/)

ksmatthews 02-27-2011 09:39 AM

running linux web apps in windows
 
Hi all,

I have a simple home network consisting of 2 laptops - one is a linux box and the other runs windows and linux with a dual boot setup.

I develop my web apps on the linux box but would like to test them out on the windows machine using IE7. I have abandoned the idea of doing this in Linux using wine since in the real world this is unrealistic ...

How can I get my Windows machine to see the localhost web apps which run on the linux box ?

regards,

Steven Matthews

acid_kewpie 02-27-2011 09:45 AM

erm... open browser, go to address of linux box. Am I missing something? What level of "how" are you talking about? From physical connectivity to j2ee server configuration, there's a range of different things to look at.

fordeck 02-27-2011 09:59 AM

If the Ubuntu box has Apache running then it should be listening on port 80. You can use netstat -nat to check. If it is then you should be able to use the IP address of the Ubuntu box from the windows box to bring up the web pages that you have created on the Ubuntu box.

Or to use the virtual host name instead of the ubuntu IP, you can add them to your hosts (C:\WINDOWS\system32\drivers\etc\hosts) file on the windows box. For example:

Code:

xxx.xxx.xxx.xxx    www.example.com
Were www.example.com would be the name of you virtual host. You can have multiple virtual hosts pointing to the same IP address. While this works fine for testing, of course it would not work in production.

Regards,

Fordeck

ksmatthews 02-27-2011 03:23 PM

Thanks for that ....

My apps live in virtual servers with addresses like dev.fpc.com for example.

How would I direct the windows browser to a particular VS using the same IP address ?

regards,

Steven Matthews

fordeck 02-27-2011 03:41 PM

Quote:

How would I direct the windows browser to a particular VS using the same IP address ?
Do you mean virtual host?

If so then like I said in my previous post create an entry in the windows host file. You can have multiple names associated with an IP address. For example:

Code:

xxx.xxx.xxx.xxx    www.example.com dev.fpc.com
In the above host file entry both www.example.com and dev.fpc.com are associated with the same IP address. In your case the address of the Ubuntu box. So when you access either of the above names in Internet Exploder they will pull up the associated virtual host on the ubuntu box.

Again this works fine for testing, of course it would not work in production.

Regards,

Fordeck

acid_kewpie 02-27-2011 03:41 PM

well it depends on the virtualized networking. Ideally you'd just be using bridged networking, in which case there is no special action at all. The VM appears on the same subnet like any other physical device. If you have nat networking then you'd need the host to redirect certain ports into the VM of your choosing. It's probably worthwhile converting to bridged if you're not already doing this. ALso note that the name of your apps is of no consequence at all.

acid_kewpie 02-27-2011 03:42 PM

Quote:

Originally Posted by fordeck (Post 4273200)
Do you mean virtual host?

Well the term "virtual host" is one of the vaguest in IT today. This could mean all sorts of things. Apache VirtualHosts, Virtual Machines, Clusters, Cloud services...

fordeck 02-27-2011 03:48 PM

Your absolutely right, I should have Phrased the question differently. What I was wondering is if he was referring to an Apache VirtualHost?


Thanks for catching that.

Regards,

Fordeck

ksmatthews 02-28-2011 01:09 AM

Thanks fordeck ...

RE Or to use the virtual host name instead of the ubuntu IP, you can add them to your hosts (C:\WINDOWS\system32\drivers\etc\hosts) file on the windows box.

After editing this file do I need to reboot windows in order for the OS to pick it up ?

Steven Matthews

fordeck 02-28-2011 07:36 AM

Quote:

After editing this file do I need to reboot windows in order for the OS to pick it up ?
You should not need to reboot. To verify that the host file entries are working you could ping the names to see if they are resolving to the IP you associated them with.

Regards,

Fordeck


All times are GMT -5. The time now is 09:57 AM.