connect to local host on Ubuntu Server from Windows.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
connect to local host on Ubuntu Server from Windows.
Hello, I am very new to linux an I am trying to learn. I have a computer that is running windows 7. On that computer I have installed Virtual Box which is running Ubuntu Server. On the Ubuntu Server I have installed apache2 and php5. If I look at the /var/www I am able to see the index.html which contains the sample "it works" file. I am trying to now connect to this local host using firefox via Windows 7 browser. I have already tried using ifconfig to get the ip address. When I tried to connect from the Windows Browser it timed out. What am I doing wrong, how can I do this?
In VirtualBox, in 'Network' settings for that VM make sure network adapter is set to be attached to bridged adapter (rather than NAT), boot up VM and check what IP your DHCP server (presumably your home router) has assigned to it. Then in Windows stick that IP as a URL.
OK, this is working great!! However what would I do if I had an apache server also running on my Windows Machine. How do I tell the browser which one to point to? Would it get assigned a different ip? Also I know apache is for mysql database. If I wanted to connect to an Oracle database, what would I use instead of apache?
"However what would I do if I had an apache server also running on my Windows Machine. How do I tell the browser which one to point to?" - that's your localhost if you are connecting from the machine Apache is running on (i.e. Windows). Or you can use IP 127.0.0.1 (which is the same as localhost) or you can use your LAN IP (usually something like 192.168.x.x or 10.0.x.x).
"Also I know apache is for mysql database" - no. Apache is a web server and has nothing to do with MySQL which is a database server. You can use any other web server instead of Apache - Nginx, Lightpd, IIS etc. To connect to a database server your application uses a connector/module like php5-mysql.
"If I wanted to connect to an Oracle database, what would I use instead of apache?" - see above, this question does not make sense (Apache can still be used, connecting to Oracle DBs is not dependent on a web server in use).
Last edited by klearview; 02-05-2012 at 12:03 PM.
Reason: clarification, grammar
OK, I am still confused about one thing. Why is it that when I shut down my vm and virtual box, I am still able to connect to my local host and view the "it works page"? If apache is running on the vm and the vm is shut down, apache web server would also not be running right?
Localhost - is your local machine (a local host). So when you enter 'localhost' in a browser's address bar, you connect to port 80 of that machine where the browser is running on.
"If apache is running on the vm and the vm is shut down, apache web server would also not be running right?" - right, but you are not trying to connect to VM, are you, if you are connecting to localhost
Ah, I see now. Thanks for being so helpful. I have one more question. I am trying to upload files to Ubuntu Server via WinSCP which is on Windows. I have used the hostname command in Ubuntu to get the correct hostname, and I know my username and password are also correct but it when I try to connect it says connection refused. Could I by using the wrong port number(22)? If so, how do I know what the port number is?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.