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 enter example.comfrom another system in my local network , it opens my router configuration page.

I forwarded router port 80 to server port 8080 in the network.

But I also want to access the website from other systems in my local network. is it possible?

Mr. White

Your router may not support "NAT loopback", where you access services on your local network through the router's WAN IP. Most consumer grade routers do not support NAT loopback .

You only have two options:

  1. Change your router to one that doesn't support "NAT loopback".
    E.g. Which NETGEAR routers support NAT loopback

  2. Instead, your service is accessed through an internal IP address. You can override public DNS with a local HOSTS file.

The way I usually "solve" this and make the site accessible to all machines/devices on the LAN is to define a subdomain local ( record A) in the public DNS that points to the local IP address . So when on the LAN, I'll be accessing the site via the subdomain local.example.com.

A related question on Security SE, which details what network traffic actually looks like:

Related


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 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 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 web server from local virtual network

Akalenuk I have installed several virtual machines. Some uder Windows, some under Fedora Linux. On one of the Fedora machines, I have the Apache web server installed. 172.16.27.129:80I set the server name in httpd.conf to , make sure access to the html directo

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 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 configurat

Apache server allows access from local network

Matthew Meehan optional I've installed fedora server but can't seem to get web requests through it. I can ping it, and as far as I can tell, apache is functioning fine on the computer. I listen on httpd.conf as Listen *:80 and the server name is ServerName 19

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 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 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 web server from local virtual network

Akalenuk I have installed several virtual machines. Some uder Windows, some under Fedora Linux. On one of the Fedora machines, I have the Apache web server installed. 172.16.27.129:80I set the server name in httpd.conf to , make sure access to the html directo

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

Apache server allows access from local network

Matthew Meehan optional I've installed fedora server but can't seem to get web requests through it. I can ping it, and as far as I can tell, apache is functioning fine on the computer. I listen on httpd.conf as Listen *:80 and the server name is ServerName 19