Caddy is working but nothing on default page

Hello. I am still new to Caddy and it is working fine on my almalinux 9.4 KDE machine. I did the same process on my Oracle Linux 9.4 Server in the Oracle Cloud but it is still not shown me the default page regardless of may times I try. So far I did the following:

  1. I opened ports in the firewall, specially port 80 and 443.
  2. I double checked that server CaddyFile is identical to my local machine.
  3. I checked the background processes multiple times since they were handling port 2019 and killed the old ones and started a new one, but it is the same.

I don’t know what to do anymore.

Please advise me and thank you.

Please fill out the help topic template as per the forum rules (click on New Topic, copy the template it shows you and write it as a new comment on this topic, then fill it out). Show your Caddy version. Show an example curl -v request. Show your logs.

1 Like

1. The problem I’m having:

Hello. I am still new to Caddy and it is working fine on my almalinux 9.4 KDE machine. I did the same process on my Oracle Linux 9.4 Server in the Oracle Cloud but it is still not shown me the default page regardless of may times I try. So far I did the following:
1. I opened ports in the firewall, specially port 80 and 443.
2. I double checked that server CaddyFile is identical to my local machine.
3. I checked the background processes multiple times since they were handling port 2019 and killed the old ones and started a new one, but it is the same.
I don’t know what to do anymore.

2. Error messages and/or full log output:

I tried to enable debug mode but it seems I don’t know yet where to place it in the Caddyfile. So far I manged to get the following.

Sep 22 15:46:05 d4s-ol9-web1 systemd[1]: Starting Caddy...
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: caddy.HomeDir=/var/lib/caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: caddy.Version=v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.GOOS=linux
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.GOARCH=arm64
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.Compiler=gc
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.NumCPU=4
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.GOMAXPROCS=4
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: runtime.Version=go1.21.11 (Red Hat 1.21.11-1.el9_4)
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: os.Getwd=/
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: LANG=en_US.UTF-8
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: NOTIFY_SOCKET=/run/systemd/notify
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: HOME=/var/lib/caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: LOGNAME=caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: USER=caddy
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: INVOCATION_ID=61a63fb8289b4ce3a2f712271e1590ae
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: JOURNAL_STREAM=8:27718
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: SYSTEMD_EXEC_PID=2036
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8400853,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8508868,"msg":"adapted config to JSON","adapter":"caddyfile"}
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.866099,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"ori>
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"warn","ts":1727019965.8691125,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS wi>
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8702362,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x40005b>
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8694046,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8780375,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json>
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8791323,"msg":"serving initial configuration"}
Sep 22 15:46:05 d4s-ol9-web1 systemd[1]: Started Caddy.
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8897347,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorag>
Sep 22 15:46:05 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727019965.8898368,"logger":"tls","msg":"finished cleaning storage units"}
Sep 22 15:54:06 d4s-ol9-web1 systemd[1]: Reloading Caddy...
Sep 22 15:54:06 d4s-ol9-web1 caddy[5247]: {"level":"info","ts":1727020446.2224655,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Sep 22 15:54:06 d4s-ol9-web1 caddy[5247]: {"level":"info","ts":1727020446.2230577,"msg":"adapted config to JSON","adapter":"caddyfile"}
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.2248302,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load",">
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.2255008,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"or>
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"warn","ts":1727020446.225584,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS wil>
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.22608,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.2261014,"logger":"http","msg":"servers shutting down with eternal grace period"}
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.2264597,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json>
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.226665,"logger":"admin.api","msg":"load complete"}
Sep 22 15:54:06 d4s-ol9-web1 systemd[1]: Reloaded Caddy.
Sep 22 15:54:06 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727020446.2293215,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.0610168,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load",">
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.0619073,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"or>
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"warn","ts":1727028783.0619822,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS wi>
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.062096,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.0621164,"logger":"http","msg":"servers shutting down with eternal grace period"}
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.0623655,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json>
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.062422,"logger":"admin.api","msg":"load complete"}
Sep 22 18:13:03 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028783.0625327,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Sep 22 18:16:25 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028985.5761862,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load",">
Sep 22 18:16:25 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028985.5766075,"msg":"config is unchanged"}
Sep 22 18:16:25 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727028985.5766516,"logger":"admin.api","msg":"load complete"}
Sep 22 18:17:15 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727029035.165594,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/stop","r>
Sep 22 18:17:15 d4s-ol9-web1 caddy[2036]: {"level":"warn","ts":1727029035.1658614,"logger":"admin.api","msg":"exiting; byeee!! 👋"}
Sep 22 18:17:15 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727029035.165876,"logger":"http","msg":"servers shutting down with eternal grace period"}
Sep 22 18:17:15 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727029035.1681182,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Sep 22 18:17:15 d4s-ol9-web1 caddy[2036]: {"level":"info","ts":1727029035.168136,"logger":"admin.api","msg":"shutdown complete","exit_code":0}
Sep 22 18:17:15 d4s-ol9-web1 systemd[1]: caddy.service: Deactivated successfully.
Sep 22 18:22:23 d4s-ol9-web1 systemd[1]: Starting Caddy...
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: caddy.HomeDir=/var/lib/caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: caddy.Version=v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.GOOS=linux
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.GOARCH=arm64
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.Compiler=gc
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.NumCPU=4
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.GOMAXPROCS=4
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: runtime.Version=go1.21.11 (Red Hat 1.21.11-1.el9_4)
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: os.Getwd=/
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: LANG=en_US.UTF-8
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: NOTIFY_SOCKET=/run/systemd/notify
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: HOME=/var/lib/caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: LOGNAME=caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: USER=caddy
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: INVOCATION_ID=2fd8ab4ad39e4b209c6bc891d39904b9
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: JOURNAL_STREAM=8:84188
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: SYSTEMD_EXEC_PID=11174
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: {"level":"info","ts":1727029344.0031667,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: {"level":"info","ts":1727029344.0038266,"msg":"adapted config to JSON","adapter":"caddyfile"}
Sep 22 18:22:24 d4s-ol9-web1 caddy[11174]: Error: loading initial config: loading new config: starting caddy administration endpoint: listen tcp 127.0.0.1:2019: bind: address already >
Sep 22 18:22:24 d4s-ol9-web1 systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Sep 22 18:22:24 d4s-ol9-web1 systemd[1]: caddy.service: Failed with result 'exit-code'.
Sep 22 18:22:24 d4s-ol9-web1 systemd[1]: Failed to start Caddy.
Sep 22 18:23:22 d4s-ol9-web1 systemd[1]: Starting Caddy...
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: caddy.HomeDir=/var/lib/caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: caddy.Version=v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.GOOS=linux
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.GOARCH=arm64
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.Compiler=gc
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.NumCPU=4
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.GOMAXPROCS=4
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: runtime.Version=go1.21.11 (Red Hat 1.21.11-1.el9_4)
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: os.Getwd=/
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: LANG=en_US.UTF-8
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: NOTIFY_SOCKET=/run/systemd/notify
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: HOME=/var/lib/caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: LOGNAME=caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: USER=caddy
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: INVOCATION_ID=32048fc5e2a249b4a9dd8bf7d6f51c12
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: JOURNAL_STREAM=8:85267
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: SYSTEMD_EXEC_PID=11196
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9931672,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.994184,"msg":"adapted config to JSON","adapter":"caddyfile"}
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9961705,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"o>
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"warn","ts":1727029402.9963677,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS w>
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.996463,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x400046>
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9966679,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9971797,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.jso>
Sep 22 18:23:22 d4s-ol9-web1 systemd[1]: Started Caddy.
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9980621,"msg":"serving initial configuration"}
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9998016,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStora>
Sep 22 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727029402.9998724,"logger":"tls","msg":"finished cleaning storage units"}
Sep 23 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727115802.9991949,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/var/lib/caddy/.local/share/cadd>
Sep 23 18:23:22 d4s-ol9-web1 caddy[11196]: {"level":"info","ts":1727115802.9997602,"logger":"tls","msg":"finished cleaning storage units"}

3. Caddy version: 2.8.4

4. How I installed and ran Caddy:

I used this website to install Caddy and that since Almalinux is the same for Oracle Linux.

a. System environment: Oracle Linux 9.4 on Oracle Cloud.

b. Command:

Only what have been used on the mentioned link

c. Service/unit/compose file: None

d. My complete Caddy config:

# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.


:80 {
        # Set this path to your site's directory.
        # root * /usr/share/caddy

        # Enable the static file server.
        file_server

        # Another common task is to set up a reverse proxy:
        # reverse_proxy localhost:8080

        # Or serve a PHP site through php-fpm:
        # php_fastcgi localhost:9000
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

Note: Move information will be provided as requested. Also, please mention the command that you need the information from.

Thanks,

Would you mind editing your post to put your Caddyfile in a code block for readability?

It’s the </> button at the top of the editor.

You might also do the same for your logs.

1 Like

Forgive me I am still new.
Done.

You commented out the root directive, so Caddy doesn’t know where to read the files for the default page.

It goes at the top, in the global options block. See Caddyfile Concepts — Caddy Documentation to understand the structure of the Caddyfile.

Some of your log lines like this one truncated (notice the > at the end of the line). Follow the instructions here to get your logs without truncation: Keep Caddy Running — Caddy Documentation

2 Likes

It somehow worked after modifying the Caddyfile.

Thanks,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.