Files_dir setting?

in the file config.inc.php I had set files_dir to an absolute path one level above where I had installed ojs:
files_dir = /home/admin/ojs/ojs-files
I had some other error (file too big…) and read a post that this entry should not start with a slash, meaning it would be relative to the base of the install(?).
[This however seems the opposite of the advice to not have it on any www accessible path?]

So I changed it to be just “ojs-files” and made a local directory in the installation root for that and copied the files from the original version one directory level up.
This failed, and the main entry page now displays but without any formatting, as if some css files are not found. and any link from the front page gives a 404 error nicely formatted by OJS (header, colors, …), for example the index link gives this:

The requested resource /ojs-files/index was not found on this server.

I then changed the files_dir back to the original full pathname, but it still gives this same error result - it should have gone back to the previous behaviour, so I have goofed up something!
Any ideas or hints?

OJS-3.4.0-5
Debian Linux
Apache2

Hi @guthrie,

I think you’ve probably introduced ojs-files somewhere else other than the files_dir setting, and that’s what’s causing problems. Check e.g. your base_url settings, or any rewrite rules you’ve configured at the Apache level.

The files_dir setting’s value should never appear in a URL, which suggests to me that you’ve introduced it somewhere else.

To be clear, there shouldn’t be any problem with a leading slash in the files_dir setting; that’s a perfectly normal way to set it. If you set files_dir wrong, you’ll only see OJS start to misbehave when you try to work with submission files – e.g. uploading a file to a submission, or viewing a PDF.

My advice to keep files_dir somewhere that is not web-accessible is definitive! Any contrary advice that you get is bad advice.

Regards,
Alec Smecher
Public Knowledge Project Team