Firefox not loading Virtual Hosts with no network connection

I admit I don’t understand a lot about the network stuff, so I might have something really awkward set up.

I have a wireless Internet connection. And I have a local Ethernet card and connection I connect to a printer and an old windows machine. I also have set up Apache and PHP to run a local host server for testing purposes with listening on ports 80 and the virtual hosts id set to 127.0.0.1 with the hostnames set to 127.0.0.1.

Rather than putting development files in the \srv directory, I have them in a development directory on my home partition. I have set the virtual hosts accordingly. As long as I’m connected to the wireless connection, or connected to my local network, Firefox will bring up my virtual hosts fine. But if I’m not connected, it doesn’t, saying server not found. However, if I enter “localhost” or “127.0.0.1”, it brings up the \srv “It works for me” default page. Firefox does not work on my virtual hosts, but Konqueror does work.

The differences between my 13.1 (yes, still trying to change over), is that the Network settings is using Traditional ifup in 13.1 (and using qinternet) and NetworkManager in 42.2. Also, I am using an older version of Firefox (which may be set up differently, too). If I go into Network Settings and attempt to change something, like temporarily change to traditional and set the IP address thinking it might make a difference or setting it to activate at boot time, then going back and change to Network Manager, save it, I get a message saying no network running. IP ROUTE gives nothing, as I would expect.

I’ve read Firefox decided to make changes and something like not let you go offline if you have an Internet connection and force it offline if you don’t. Not sure why people shouldn’t be able to choose or if that’s the problem here.

OK,
Pls verify that this is what you are describing…

Internet <> WiFi connection <> Your openSUSE <> wired connection <> Windows and Printer

You’re running an Apache webserver on your openSUSE, but instead of deploying to /srv/www/htdocs/, your website files are at some location on your /home directory.
Your Apache website is bound to 127.0.0.1 which is OK if no other machine or person than yourself logged into your openSUSE needs to see it.

So, some basics… if the above is all true…
Some basic terminaology…
You have to know what a network address, a network mask, are. They are fundamental to how you configure machines to communicate with each other.
You should also know what a hostname is, and that it isn’t an IP address but a mapping of the IP address to text characters (a recognizable name).
You <may> need to understand webhosting architecture, If you use YaST defaults you might be able to get away without deeper knowledge but when you do things like change the default location, then you introduce possible problems you’d need to know how to troubleshoot. Bottom line, if you know less then don’t make unnecessary changes.

You have two networks configured, one wireless and the other wired. They each must have a different NetworkID, which is determined by your network address and network mask (see your network settings for each address on your openSUSE). See any tutorial on the Internet that describes setting up an IPv4 network address with network mask to understand how this is done.

If the tutorial doesn’t also describe as part of configuring your network address and mask, you should also know how to determine basic network connectivity, which typically uses the utility “ping” pointing to an IP address or a hostname.

Some misc. items…
It’s unlikely that Firefox is unable to access anything Konqueror can access on you local file system. You <may> have a caching issue, be sure to clear your browser cache and make it as tiny as possible (too bad nowadays there is still no way to disable web browser caches altogether). And/or reload the page to force the browser to re-fetch the page. This is why web browsers are notoriously unreliable ways to test connectivity and functionality. You can use something like wget if needed, but I doubt should be necessary for what you’re doing.

Forget about whatever version of Firefox you’re running, it’s not likely relevant to what you’re trying to do.

You should also know that the website address you’re using (127.0.0.1) is functional only if networking is running and your website is configured as you describe. Now, what your website <does> may require additional network connectivity (your printer?) but that is different… Your website should be visible in a web browser and not throw a “500” type error (could be 501, 502, etc). You should see a web page.

Your website may need to be configured to retrieve information from another machine, since your post contains no info about this, no way to comment.

If you still have questions, just post… But include hard info about your systems like
Windows - ipconfig, route print
openSUSE - ip addr, ip route

HTH,
TSU

Yes, as far as I know, you have it understood.

Since this was a new install, and I hadn’t used Konqueror before on the virtual host, and I also visited pages that I normally don’t just to make sure it wasn’t cached, I think Konqueror is acting differently than Firefox. It’s a simple site generated by PHP, no other third parties.

From my 13.1 system managed by ifup:
Both offline, but not sure that’s meaningful since the ethernet on 13.1 is at boot time. Not sure the MAC address should be listed or helpful so marked it out, but between the Suse versions, both were the same.

  ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
           valid_lft forever preferred_lft forever
    2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
        link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
        inet 192.168.2.100/24 brd 192.168.2.255 scope global enp2s0
           valid_lft forever preferred_lft forever
    3: wlp0s18f2u5: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
        link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
  /sbin/route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    loopback        *               255.0.0.0       U     0      0        0 lo
    192.168.2.0     *               255.255.255.0   U     0      0        0 enp2s0

From 42.2 managed my NetworkManager:

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:99:99:99:99:99brd ff:ff:ff:ff:ff:ff
/sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

(nothing)

Based on what you just posted…

First your 13.1 connection, which is mis-configured…
You don’t have network settings configured for your WiFi connection, so you aren’t able to communicate with the Internet
Your wired LAN card (connecting to y9ur Windows and printer) is mis-configured with only a NetworkID and no network address. This means that your openSUSE is communicating with the Windows box and printer using broadcasts only and not with directed TCP/IP connections. You can read up on why broadcasts are bad for network connections and should be minimized.

For your 42.2 connection, which as you are aware is also mis-configured…
Like your 13.1 connection, you haven’t configured your WiFi connection, so you aren’t able to communicate with the Internet.
Unlike your 13.1 connection, you haven’t configured your wired interface at all… Whereas your 13.1 connection is mis-configured but by chance is able to function in its own way, you haven’t configured your wired connection at all so there isn’t any possibility to function properly.

Suggested solutions…
For your 13.1 connection, you should open up YAST, select your wired device (eth0), and configure an IP address, which must be unique on your LAN. You didn’t post the addresses of your Windows box and printer (Is the printer connected to the Windows box or directly to your LAN?), if I were to make a wild suggestion that won’t conflict I’d have a chance of 252/254 chances of working… so try the following address

eth0
network address 192.168.2.157
subnet mask 255.255.255.0

Also, assuming that your wireless gateway provides a DHCP service, while you are in YaST you should also configure your wlan0 interface to be a DHCP client.

As for your 42.2,
Network Manager will look different depending on which Desktop you are using (KDE? Gnome? something else?)
You will want to open Network Manager and <create> network connections for both your WiFi and wired interfaces… similar to what I suggested for your 13.1 configuration, you should create a
WiFi Connection
Set up as DHCP (likely all default settings)
Wired connection (enp2s0)
Configure a static (manually configured) configuration
Address 192.168.2.158
subnet mask 255.255.255.0
(Leave the routing, default gateway and dns settings blank)

After your configurations settings, you can ping a remote machine to test (Somewhere on the Internet to test Internet connectivity, your Windows or printer to test LAN connectivity). I recommend you ping the IP address of the remote machine on you LAN because at this point I don’t know that you have name resolution set up properly.

HTH,
TSU

Ok, something I must not be communicating correctly. I should say I have a router I plug in when I connect to the Windows machine and printer. On my 13.1 box I had chosen 192.168.2.100/24 for statically assigned address. The Windows machine and printer are 192.168.2.something. Am I correct the /24 means 255.255.255.0 for the subnet mask?
The wlan is set to Dynamic address of DHCP. Here is what it looks like when I’m connected:

3: wlp0s18f2u5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global wlp0s18f2u5
       valid_lft forever preferred_lft forever

Just to be clear, the 99:99…'s * I put in place of the card address.

Also, with the NetworkManager for 42.2, I think I had set that up statically, I’ll have to check. I can’t ping my remote machine when I’m not connected which means I’m not asking or saying something correctly. I’m not too concerned about the Windows machine at this point. I haven’t actually even attempted to connect them with 42.2, though at some point I will want to. In fact, maybe my question could be the same as I not having a network card nor a wireless connection and wanting to access my virtual hosts through Firefox. Which I can using “localhost” or “127.0.0.1”, but not using the host names which also point to 127.0.0.1, set to Determine Request Server by Server IP Address.

Your clarifications are important, because they’re not reflected in what you posted originally.
You don’t have to sanitize the link/other address with 9’s, it’s not a significant security leak of some kind… no attack can make use of that information unless the hacker already has a toe-hold within your LAN and know how to get past your Gateway device.

Your localhost interface with address 127.0.0.z is a special interface which exists only within your machine by default, and does not need configuration. It always exists unless you specifically disable it. But, because it exists only within your machine, it’s not an indication of external network connectivity (connecting to other machines). By default, anything deployed on 127.0.0.1 only has access to resources on the same machine. To access resources on another machine, you need to configure a working network connection configuration for your wired network interface, and in your case has to have a NetworkID of 192.168.2.0/24. Note that your <network address> cannot be 192.168.2.0, that zero has to be an unused number between 1-254, and I highly recommend it also not be the same number as what you configured in 13.1.

Setting up your Webserver Virtual Host should be easy if you use YaST, if you point to 127.0.0.1, it should work. You specified an extra complication by not using the standard website location (which would be /srv/www/htdocs) but if you specify that correctly, it can work, too. If you’re specifying your website by IP address (192.168.0.1), then your website should work immediately. If you wanted to access your website by a name, then you should configure an entry in /etc/hosts (which you can do in YaST), if there is any confusion you should not be configuring some virtual host named “127.0.0.1” or something like that. Configuring website virtual hosting is not the same as hostname configuration… Website virtual hosting is a way to configure multiple websites to share the same IP address which is completely different.

But, website hosting shouldn’t even be touched until you have <all> your required basic networking working properly.

TSU

Ok, I tried again and now couldn’t get anything to work in Firefox, neither when connected nor when not connected. It was at one time when connected, but when I started trying different things, must have messed something up. I looked at the advanced settings and changed it to no proxy, system, manual, and nothing worked except for localhost. So I don’t know what I messed up, but created a new profile and it seems to work for my virtual hosts when not connected as I wanted. I had already started writing the following so don’t know if it’s important now or not. Maybe something is still not correct. I doubt I fixed anything in my previous attempts.

Anyway, while connected:

/sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    600    0        0 wlan0
192.168.0.0     *               255.255.255.0   U     600    0        0 wlan0

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:99:99:99:99:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global dynamic wlan0
       valid_lft 86113sec preferred_lft 86113sec
    inet6 *{99s::}*:10e/64 scope link 
       valid_lft forever preferred_lft forever

Sorry for the confusion with the 99s, but thought certain things recorded your mac address and tagged you.

I did use the same static 192.168.2.100/24 for both versions, but booting in between should be ok, right? Or once I connect to Windows, it might be confused?

Ok, this part indicates something I don’t understand. I’ve struggled with it and thought I did, but sometimes my 13.1 system says I can’t have more than one pointing to 127.0.0.1 and saying something about it pointing to a system host, and sometimes it wipes my hosts file out. I have found it odd I had to specify the address for both the hosts file and for the virtual hosts in the HTTP Server. Redundant entry. Now it sounds like I’m doing something wrong here.

I did not want to use the /srv directory because 1), want to keep them on my home partition, 2) I have multiple sites and want to refer to them at the root level instead of subdirectories. I have hosts like A, B, C stored in my development directory. I want to enter in Firefox http://A, etc. and have it show the root of each one. That’s why I set up the each virtual hosts with each document root pointing to its folder in development. That’s my intent, anyway.

Originally, in 13.1 and previous, I had them set to 192.168.0.100, but didn’t want to have to have my router plugged in when not using the Windows machine. I came across the idea of using the 127.0.0.1 and my 13.1 appears to work.

Tracing back, it looks like my Firefox setting of network.dns.disableIPv6 to true is causing the problem. In Yast network settings, I had unchecked Enable IPv6 due to past recommendations. But in Firefox, setting disableIPv6 to false lets it work connected or not connected, but when setting it to true only lets it work when I’m connected. Is that odd or expected?

By the way, in KDE NetworkManager, I can find no setting for a static IP address or mask.
Never mind, just found it! Under the IPv4 tab, method of manual. At the bottom of both that tab and IPv6 is a checkbox for make it required for this connection. Does that have something to do with the Firefox setting? That is, when connected does it default to IPv6 which then lets Firefox work through that but not when it’s disabled ---- or something…?

No idea about the permutations, but is mentioned as one of server setting to check in this mozilla documentation
https://support.mozilla.org/t5/Fix-problems-with-websites/Firefox-can-t-load-websites-but-other-browsers-can/ta-p/2496

TSU