You are not logged in.
Hi everyone.
I'm having a strange problem with Apache. I use it for local development and I don't understand why, if I disconnect from the internet, I can no longer see my local websites.
When the computer is connected to the Internet, the local server also works perfectly.
Thank you all.
Offline
Check the logs, they will show what the problem is, usually anyway
cat /var/log/httpd/
access_log error_log Rlu: 222126
Offline
I went offline to reproduce the conditions where the local server is down and deleted the two files before restarting the local server.
[marco@archlinux ~]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
Drop-In: /etc/systemd/system/httpd.service.d
└─hardening.conf
Active: active (running) since Sat 2026-01-10 15:53:53 CET; 3s ago
Invocation: 54e4a192e51b460ea15d7298b785572e
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 4647 (httpd)
Status: "Processing requests..."
IP: 0B in, 0B out
IO: 0B read, 0B written
Tasks: 82 (limit: 9389)
Memory: 5.9M (peak: 6.1M)
CPU: 61ms
CGroup: /system.slice/httpd.service
├─4647 /usr/bin/httpd -D FOREGROUND -k start
├─4649 /usr/bin/httpd -D FOREGROUND -k start
├─4650 /usr/bin/httpd -D FOREGROUND -k start
└─4651 /usr/bin/httpd -D FOREGROUND -k start
gen 10 15:53:53 archlinux systemd[1]: Starting The Apache HTTP Server...
gen 10 15:53:53 archlinux systemd[1]: Started The Apache HTTP Server.
[marco@archlinux ~]$ cat /var/log/httpd/access_log
[marco@archlinux ~]$ cat /var/log/httpd/error_log
[Sat Jan 10 15:52:26.371654 2026] [mpm_event:notice] [pid 4431:tid 4431] AH00489: Apache/2.4.66 (Unix) configured -- resuming normal operations
[Sat Jan 10 15:52:26.371789 2026] [core:notice] [pid 4431:tid 4431] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[Sat Jan 10 15:53:53.169661 2026] [mpm_event:notice] [pid 4431:tid 4431] AH00491: caught SIGTERM, shutting down
[Sat Jan 10 15:53:53.258744 2026] [mpm_event:notice] [pid 4647:tid 4647] AH00489: Apache/2.4.66 (Unix) configured -- resuming normal operations
[Sat Jan 10 15:53:53.258882 2026] [core:notice] [pid 4647:tid 4647] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[marco@archlinux ~]$ Offline
If you access the root http://localhost you should get something in the access log.
Rlu: 222126
Offline
Okay. I don't understand what happened, but everything seems fine for now. When the problem arises again, I'll try to add more details.
Thank you SimonJ. Thanks everyone.
Offline
Now I understand what it depends on. I should have thought about it before.
I'm trying Tomoyo, and for a while I had swapped profile 1 of domain /usr/bin/httpd with profile 3. Then I put profile 1 back, and everything seemed to work. I didn't think about it again until this strange behavior appeared: everything works when my laptop in connected, but offline I can't access my local websites.
I tried the swap again, and it did it again, so it definitely depends on my policies. Something must have remained. When I'm offline, httpd doesn't work at all: it doesn't even write anything to the logs. When I'm online, everything works. I think it's really weird.
Anyway, there's no real problem: I do it all just because I enjoy learning something. Maybe I'll get there eventually, or maybe it'll seem too complicated and I'll give up.
For now, the problem is that I haven't understood why this odd behaviour disappeared at a certain point. Any ideas?
Offline