How to access apache web server on Ubuntu from windows
First of all you should check whether you can ping the ubuntu machine via IP and afterwards via its name (ping mylocal.loc
).
If that does not work, you should check your network settings. Possibly the problem could be, that the IPs are in different subnets. You should set both IPs in the same subnet. See that both IPs only differ in the last number (e.g. 192.168.0.4
and 192.168.0.5
).
If ping
succeeded:
You should be able to open the website with your browser by entering http://mylocal.loc
(depending on the configuration of Apache you might have to add some subfolder (e.g. http://mylocal.loc/myname
).
If you have a firewall installed you might have to open the corresponding port.
EDIT:
In case the mylocal.loc
is not resolved correctly to the IP of the Ubuntu machine, you might have to do this mapping, by either
- Adding the name/IP pair to the Windows machines host file ( http://www.ehow.com/how_5225562_edit-windows-hosts-file.html ) or
- Setting up a DNS server (especially useful if you want to map multiple names to IP addresses or if the IP address changes regularly)
Related videos on Youtube
devdarsh
Updated on September 18, 2022Comments
-
devdarsh over 1 year
I have Ubuntu server installed along with apache web server for php development. I have configured local network with ip 192.168.0.2 and setup domain as
mylocal.loc
for the ubuntu server.
And I have another system installed with ubuntu desktop having ip as 192.168.0.3 So I canhttp://mylocal.loc
from my ubuntu desktop machine. Now I want to access the http://mylocal.loc from my windows machine. I have ip for that machine as 192.168.1.4 but I can't connect to the web server installed on the ubuntu server.
I am not sure how to connect the wondows machine to the ubuntu network to browse local web server and share files. Any help would be greatly appreciated. -
devdarsh over 8 yearsHi, Thanks for your answer. I found that I can browse via direct IP i.e. 192.168.1.2 but I can't load mylocal.loc I don't know how to set to listen domain name for the server IP. In ubuntu m/c I gave the domain name in "Search domain" textbox. I don't know where to give domain name in windows.
-
duelle over 8 yearsThere are two ways to make your Windows machine resolve the name to the IP of your Ubuntu machine: 1. Add the name/IP-Address pair to your hosts file in Windows. Then the name is "hard-coded" in the system and it always resolves to the IP ( ehow.com/how_5225562_edit-windows-hosts-file.html ) 2. Set up a DNS server which does this. If the IP address does not change I would recommend (1).
-
duelle over 8 yearsI added this to my answer above, too.
-
devdarsh over 8 yearsThanks for your suggestion. I think I can add the IP to the hosts file, which I did the same thing in my ubuntu clients. Do you mean to setup DNS server in Ubuntu server?
-
devdarsh over 8 yearsActually, I did the DNS unfortunately it is not working correctly as I am not an expert in DNS setup with Linux servers. I can't ping the domain name from the same machine itself.
-
duelle over 8 yearsIn general it wouldn't make any difference which of your system runs the DNS server as long as they both use that DNS server and are in the same network.
-
G-Man Says 'Reinstate Monica' over 6 yearsSo are you saying that
.lan
is an inherently better TLD than.loc
? Or that the OP’s FQDNs must be at least three levels deep? -
Aang about 6 yearsI'm just saying that the FQDN needed to be three levels deep in my cause