Dokuwiki returning 404 file not found?

1. Output of caddy version:


2. How I run Caddy:

a. System environment:

On an Arch Linux image on vultr! Using php-fpm7, no docker

b. Command:

sudo caddy reload --config /etc/caddy/Caddyfile

d. My complete Caddy config: {
	encode gzip zstd
	root * /home/a/website/wiki

	#Remember to comment the below forbidden block out when you're installing, and uncomment it when done.
	#@forbidden path /data/* /conf/* /bin/* /inc/* /install.php
	#handle @forbidden {
	#	respond * 403
	#End of the forbidden block

	try_files {path} {path}/index.html

	route {
		handle_path /_media/* {
			rewrite * /lib/exe/fetch.php?media={path}&{query}
		handle_path /_detail/* {
			rewrite * /lib/exe/detail.php?media={path}&{query}
		handle /_export/* {
			@export path_regexp export ^/_export/([^/]+)/(.*)
			rewrite @export /doku.php?do=export_{re.export.1}&{query}&id={re.export.2}
		handle / {
			rewrite * /doku.php?{query}
		try_files {path} /doku.php?id={path}&{query}

	php_fastcgi unix//run/php-fpm7/php-fpm.sock

# don't ask but I also need to expose a file on a very specific URL {
	root * /var/www/test

3. The problem Iā€™m having:

Currently Iā€™m just trying to get my wiki to work, then eventually push it under the path of /wiki.

4. Error messages and/or full log output:

I get: File not found. when I visit the website.

Paste logs/commands/output here.

5. What I already tried:

I followed this config file as a baseline:
I have tried commenting and uncommenting the selected blocks

and I also tried messing around with file permissions:
but still no luck!

I tried: Issues porting v1 dokuwiki config to v2 - #4 by matt
Changing unix// to unix/ which gives me a 502 instead opposed to 404

I think I fixed it by chmoding to 777 and fixing the php-fpm socket path.

:grimacing: 777 is almost never necessary, and can often lead to exploits. Instead, set proper users and groups! :100:

Agree, 777 is a bad idea.
But if 777 work, then most likely is file ownership issue.
Try to change ownership from root:wheel to www:www by command chown www:www filename the file/folder after change it back to 744.


1 Like

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