How to access apache web server on Ubuntu from windows

6,119

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

Share:
6,119

Related videos on Youtube

devdarsh
Author by

devdarsh

Updated on September 18, 2022

Comments

  • devdarsh
    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 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.

  • devdarsh
    devdarsh over 8 years
    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.
  • duelle
    duelle over 8 years
    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
    duelle over 8 years
    I added this to my answer above, too.
  • devdarsh
    devdarsh over 8 years
    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
    devdarsh over 8 years
    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.
  • duelle
    duelle over 8 years
    In 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'
    G-Man Says 'Reinstate Monica' over 6 years
    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?
  • Aang
    Aang about 6 years
    I'm just saying that the FQDN needed to be three levels deep in my cause