1

Assuming the server uses Apache, where it is the most adequate folder to place uploaded files, contents and data in FreeBSD? This question is the extension to this one but specific for FreeBSD.

The Handbook only determines where the code files must be placed. For security reasons, data is kept separate from the DocumentRoot.

Looking at the HIER section it seems that I need to create a new folder under /usr/local perhaps /usr/local/srv ?

It seems odd to me as it says such /usr/local should contain

'local executables, libraries, etc.'

but says nothing about data.

4
  • Do you have more than one mounted file system? Are you using ZFS or jails? Sep 13, 2016 at 15:24
  • No jails. Does that matter? The question is not related to any particular filesystem, but to the recommended HIER place. Sep 13, 2016 at 16:01
  • What do you consider "data" and "contents"? Is there a difference? Nov 20, 2016 at 12:16
  • Contents may be media. Data means dynamically generated user data. Jan 6, 2017 at 14:08

1 Answer 1

0

With a few more years of experience, I think I can self-answer:

  • If uploaded into /var/www, it must be stored somewhere but outside of the DocumentRoot. With this approach, the backup is easier, as the backup scripts can simply take the entire /var/www folder and subfolders, with data and code.
  • Another suitable place is /var/ . As stated in Chapter 3. FreeBSD Basics - 3.5. Directory Structure.

/var/ Multi-purpose log, temporary, transient, and spool files. A memory-based file > system is sometimes mounted at /var. This can be automated using the varmfs-relate

  • Ultimately, user Apache may have a /home folder created to read/write data.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .