Unable to access apache2 virtual host from another computer


Kaikoura

I'm running an apache2 webserver from my computer and when I access the site from my computer it works fine, but when I try to access it from another machine (running windows) the browser outputs, The site cannot be reached. Here is my site configuration file:

<VirtualHost 192.168.1.96>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/example
    ServerName www.example.com

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Here is my /etc/hosts file

127.0.0.1   localhost
127.0.1.1   puter
127.0.1.1   noreply.com
192.168.1.96    www.vk1.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I have tried restarting apache and disabling and enabling the site, but it didn't work. Has anyone encountered such a problem?

Quentin

This /etc/hostsfile provides a host-to-IP address mapping for the computer on which it resides.

Your Windows computer does not read data from your Linux computer's /etc/hostsfiles so that 192.168.1.96when asked to www.vk1.com.

do you need:

  • Configure this mapping for your LAN in the DNS server
  • Put this information in the hosts file on the Windows computer

Related


Unable to access Apache virtual host from local network

username I have setup a virtual host with Apache2 using the following configuration: <VirtualHost *:8080> ServerName example.com DocumentRoot /var/www/example.com </VirtualHost> The website can be accessed from outside. example.com However, if I ente

Unable to access Apache virtual host from local network

username I have setup a virtual host with Apache2 using the following configuration: <VirtualHost *:8080> ServerName example.com DocumentRoot /var/www/example.com </VirtualHost> The website can be accessed from outside. example.com However, if I ente

Unable to access Apache virtual host from local network

username I have setup a virtual host with Apache2 using the following configuration: <VirtualHost *:8080> ServerName example.com DocumentRoot /var/www/example.com </VirtualHost> The website can be accessed from outside. example.com However, if I ente

Unable to access Apache virtual host from local network

username I have setup a virtual host with Apache2 using the following configuration: <VirtualHost *:8080> ServerName example.com DocumentRoot /var/www/example.com </VirtualHost> The website can be accessed from outside. example.com However, if I ente

Unable to access server on Virtual Box from host?

Banuradi I'm running Ubuntu 18.04.1 in Virtual Box for MacOS. I'm setting up a server localhostin Ubuntu with Python Flask running on Python Flask , http://127.0.0.1:5000/trying to access that localhost from a Mac, but can't. I used a bridge type connection fo

Unable to access server on Virtual Box from host?

Banuradi I'm running Ubuntu 18.04.1 in Virtual Box for MacOS. I'm setting up a server localhostin Ubuntu with Python Flask running on Python Flask , http://127.0.0.1:5000/trying to access that localhost from a Mac, but can't. I used a bridge type connection fo

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

Unable to access Apache httpd virtual host

alone I am new to linux and I can install my LAMP server on Manjaro. Got it all, but now I'm having issues setting up the virtual host. I used httpd and commented out "include conf/extra/httpd-vhosts.conf" in /etc/httpd/conf/httpd.conf . But after editing http

Unable to access Apache httpd virtual host

alone I am new to linux and I can install my LAMP server on Manjaro. Got it all, but now I'm having issues setting up the virtual host. I used httpd and commented out "include conf/extra/httpd-vhosts.conf" in /etc/httpd/conf/httpd.conf . But after editing http

Unable to access Apache httpd virtual host

alone I am new to linux and I can install my LAMP server on Manjaro. Got it all, but now I'm having issues setting up the virtual host. I used httpd and commented out "include conf/extra/httpd-vhosts.conf" in /etc/httpd/conf/httpd.conf . But after editing http

Unable to access Apache httpd virtual host

alone I am new to linux and I can install my LAMP server on Manjaro. Got it all, but now I'm having issues setting up the virtual host. I used httpd and commented out "include conf/extra/httpd-vhosts.conf" in /etc/httpd/conf/httpd.conf . But after editing http

Unable to access Apache httpd virtual host

alone I am new to linux and I can install my LAMP server on Manjaro. Got it all, but now I'm having issues setting up the virtual host. I used httpd and commented out "include conf/extra/httpd-vhosts.conf" in /etc/httpd/conf/httpd.conf . But after editing http