LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-02-2010, 02:10 AM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
Accessing Website Being Hosted on Virtual Machine


Hi,


I want to access the Website / Web Pages being hosted on the Virtual Machine (Linux) created with Sun VirtualBox onmy Host OS (Windows XP).

The website is working fine on the VM. But I can't access it from the Host OS (Windows XP).

What settings to do I need to configure to accomplish it?

Besides, how can I access the website, being hosted on the Host OS, from within the VM?

What settings to do I need to configure to accomplish it too?

Thanks!
 
Old 09-02-2010, 03:13 AM   #2
babunix
Member
 
Registered: Jul 2010
Location: India
Distribution: RHEL, Ubuntu
Posts: 35

Rep: Reputation: Disabled
Are you able to do ping from HOST to VM?
Are you able to access other service of VM machine?

What is your network card setting of VM Machine?
 
Old 09-02-2010, 03:30 AM   #3
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Connectivity Between Host OS and Guest OS

Quote:
Originally Posted by babunix View Post
Are you able to do ping from HOST to VM?
Are you able to access other service of VM machine?

What is your network card setting of VM Machine?

I am able to ping and ssh to the VM.

I have not tried accessing any other services yet.

I have set Bridged connection (in the VM Settings) to be able to connect to the VM through ssh and telnet, etc.
 
Old 09-02-2010, 04:13 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,223

Rep: Reputation: 132Reputation: 132
If you can ping to the VM machine, hope can access webserver too, just type & hit in web browser somewhere within your LAN as like http://vm machine ipaddress , please makesure the VM machine firewall allowed the webserver listening port

Last edited by kirukan; 09-02-2010 at 04:18 AM.
 
Old 09-02-2010, 06:24 AM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by kirukan View Post
If you can ping to the VM machine, hope can access webserver too, just type & hit in web browser somewhere within your LAN as like http://vm machine ipaddress , please makesure the VM machine firewall allowed the webserver listening port
I tried that too. But it is not working. Do I need to do any settings related to port? In /etc/httpd/conf/httpd.conf "Listen 80" is already given.

Any settings in that file need to be done?

When I type http://ip-of-vm:80 it is automatically replaced with http://ip-of-vm in the browser, and then website not found error comes up.
 
Old 09-02-2010, 09:20 AM   #6
babunix
Member
 
Registered: Jul 2010
Location: India
Distribution: RHEL, Ubuntu
Posts: 35

Rep: Reputation: Disabled
As kirukan said check firewall setting and also check selinux if running.

you can check http port responding or not using telnet command.

Code:
debian:~# telnet ip_of_server 80
Trying 10.0.7.234...
Connected to 10.0.7.234.
Escape character is '^]'.
after thar type GET command
Code:
GET
<html><body><h1>It works!</h1></body></html>
Connection closed by foreign host.
 
Old 09-02-2010, 09:31 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
You can also use curl to check your web server response

Code:
curl http://www.example.com -v
* About to connect() to www.example.com port 80
*   Trying 192.0.32.10... connected
* Connected to www.example.com (192.0.32.10) port 80
> GET / HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: www.example.com
> Accept: */*
....
....
 
Old 09-02-2010, 05:37 PM   #8
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by sem007 View Post
You can also use curl to check your web server response

Code:
curl http://www.example.com -v
* About to connect() to www.example.com port 80
*   Trying 192.0.32.10... connected
* Connected to www.example.com (192.0.32.10) port 80
> GET / HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: www.example.com
> Accept: */*
....
....

Thanks for introducing a new command to me!
 
Old 09-02-2010, 05:39 PM   #9
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by babunix View Post
As kirukan said check firewall setting and also check selinux if running.

you can check http port responding or not using telnet command.

Code:
debian:~# telnet ip_of_server 80
Trying 10.0.7.234...
Connected to 10.0.7.234.
Escape character is '^]'.
after thar type GET command
Code:
GET
<html><body><h1>It works!</h1></body></html>
Connection closed by foreign host.
Thanks for showing me how to use telnet and GET.
 
Old 09-02-2010, 05:41 PM   #10
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by kirukan View Post
If you can ping to the VM machine, hope can access webserver too, just type & hit in web browser somewhere within your LAN as like http://vm machine ipaddress , please makesure the VM machine firewall allowed the webserver listening port
Yes, it was Firewalls on both the boxes that were needed to be configured for the services.

Thanks!
 
Old 09-02-2010, 05:44 PM   #11
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Hi,


Here is how I solved the problem:

I was able to ping the VM using its IP but not by its host name. I made an entry in the file "c:\windows\system32\drivers\etc\hosts" and voila!

Well, I also enabled "Secure Web Server (HTTPS)", "Telnet", and "FTP" service in Firewall to flag them as a Trusted Services on the VM.

Now I can browse the website on the Host OS.

I have done similar settings in Firewall on the Windows Box also. I also in added an entry in /etc/hosts on the VM to ping the Host OS. Now I can access the website running on IIS within the VM.

So, the problem of accessing website from VM on Host OS and vice versa is resolved! I can also ping both the servers from each end.

Thanks to all of you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block a virtual machine from connecting with a website, from outside the VM jiml8 Linux - General 5 03-24-2010 06:13 PM
viewing an externally hosted website from within a given website andrews-mark Linux - Server 6 10-07-2008 12:11 AM
set up proxy server on hosted website secretlydead Linux - Server 1 09-06-2008 04:06 AM
Virtual hosted website not found toes Linux - Networking 7 07-14-2006 03:11 PM
How Can I password protect a sub-directory of a hosted website from client PC mark001 Linux - Newbie 18 11-12-2004 02:29 PM


All times are GMT -5. The time now is 05:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration