0

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 can http://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.

2 Answers 2

1

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

6
  • Hi, 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.
    – devdarsh
    Commented Aug 14, 2015 at 16:21
  • 1
    There 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
    Commented Aug 14, 2015 at 18:02
  • I added this to my answer above, too.
    – duelle
    Commented Aug 14, 2015 at 18:07
  • Thanks 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
    Commented Aug 18, 2015 at 7:29
  • Actually, 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.
    – devdarsh
    Commented Aug 18, 2015 at 7:32
-1

I have a very similar setup.

You need to have a fully qualified name for this to work.

I did not set the domain on the server though, I set a static DNS entry on my local router.

So for example, you'll have to add a static DNS entry like myserever.local.lan which has the IP address of your server.

Now locally I (or anyone on my LAN) can type myserver.local.lan from the browser or ping that from the terminal, and will get to my server.

-Aang

2
  • So 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? Commented Dec 26, 2017 at 16:35
  • I'm just saying that the FQDN needed to be three levels deep in my cause
    – Aang
    Commented Feb 28, 2018 at 2:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .