User login

Where to put the files directory

This is probably my all-time favorite conversation from the Drupal Documentation e-mail list.

Updated by: CogRusty
Status: active

Personally I consider it /bad practice/ to place 'files' under
'/sites/example.com/files'. This is a sure way to make your file links
dependent on your current domain name.

What I consider relatively better practice for a multisite's files is
to place them under '/files/s1' where 's1' is a general short
identifying name of the site which you can reuse elsewhere.

Also, I am not sure why multiple 'tmp' files are needed, so I think one
'files/tmp' would be enough.

[That was CogRusty. Now Boris Man]

It is easy to move. Create a symlink from your new domain name -- ln -s
/sites/example.com /sites/example2.com. Voila. Easy, and it keeps all
files for the site in *one* place.

Re: /sites/example.com/tmp -- this is again to keep all files for a
site together. If you have full control over the server and know
everything that is on there, no problem using /tmp. If there are
multiple sites, each having their own /tmp is a bit better security.

Boris Mann

That should work, but there is a price. My links entered in the content
would appear with the old domain name (a development site name or
anything). Is that worth it if I can just remember that a site's files
are somewhere under /files?

CogRusty

On second thought, I see that I could create symlinks under /files and
use those in the first place. So I would have the best of both words
(all site data in one place and domain-independent links). A handbook
explanation would be a bit elaborate though.

CogRusty

This is where this crosses over into best practices and there is no one
"right answer".

Boris Mann

The Agaric way: /sites/example.com/files

But name it well, example.com and not thisdamnclient.com because even with symlinks to file, I think Drupal-created links (including images entered through TinyMCE) will contain this path.

This is probably my all-time favorite conversation from the Drupal Documentation e-mail list.

Updated by: CogRusty
Status: active

Personally I consider it /bad practice/ to place 'files' under
'/sites/example.com/files'. This is a sure way to make your file links
dependent on your current domain name.

What I consider relatively better practice for a multisite's files is
to place them under '/files/s1' where 's1' is a general short
identifying name of the site which you can reuse elsewhere.

Also, I am not sure why multiple 'tmp' files are needed, so I think one
'files/tmp' would be enough.

[That was CogRusty. Now Boris Man]

It is easy to move. Create a symlink from your new domain name -- ln -s
/sites/example.com /sites/example2.com. Voila. Easy, and it keeps all
files for the site in *one* place.

Re: /sites/example.com/tmp -- this is again to keep all files for a
site together. If you have full control over the server and know
everything that is on there, no problem using /tmp. If there are
multiple sites, each having their own /tmp is a bit better security.

Boris Mann

That should work, but there is a price. My links entered in the content
would appear with the old domain name (a development site name or
anything). Is that worth it if I can just remember that a site's files
are somewhere under /files?

CogRusty

On second thought, I see that I could create symlinks under /files and
use those in the first place. So I would have the best of both words
(all site data in one place and domain-independent links). A handbook
explanation would be a bit elaborate though.

CogRusty

This is where this crosses over into best practices and there is no one
"right answer".

Boris Mann

The Agaric way: /sites/example.com/files

But name it well, example.com and not thisdamnclient.com because even with symlinks to file, I think Drupal-created links (including images entered through TinyMCE) will contain this path.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.