{"id":311,"date":"2013-04-18T22:43:14","date_gmt":"2013-04-18T20:43:14","guid":{"rendered":"http:\/\/bergs.biz\/blog\/?p=311"},"modified":"2013-04-18T22:43:14","modified_gmt":"2013-04-18T20:43:14","slug":"solved-wordpress-on-debian-and-media-uploads-not-working","status":"publish","type":"post","link":"https:\/\/bergs.biz\/blog\/2013\/04\/18\/solved-wordpress-on-debian-and-media-uploads-not-working\/","title":{"rendered":"Solved: WordPress on Debian and media uploads not working"},"content":{"rendered":"<p>I was struggling with a problem that I couldn&#8217;t upload media files to my blog &#8212; which I host myself on a Debian box in a multi-site configuration. When I tried to do so I got an error message saying that WordPress couldn&#8217;t write to the directory. Actually I had this very problem since 2005 when I started this blog &#8212; I never took the time to <em>really<\/em> investigate it (but used the work-around to refer to static content I manually uploaded to my web-server document directory)&#8230; \ud83d\ude09<\/p>\n<p>Now that my wife wanted to start blogging, I finally had a good reason to fix this issue. It took me about an hour, and it was done. What I had to do was just two entries in my admin&#8217;s Settings (I might not have set up WordPress cleanly when I started it, so you might not have to manually set this) as follows:<\/p>\n<p><a href=\"http:\/\/bergs.biz\/blog\/2013\/04\/18\/solved-wordpress-on-debian-and-media-uploads-not-working\/mediasettings\/\" rel=\"attachment wp-att-314\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-314\" title=\"Media Settings\" src=\"http:\/\/bergs.biz\/blog\/files\/2013\/04\/MediaSettings.png\" alt=\"\" width=\"741\" height=\"648\" srcset=\"https:\/\/bergs.biz\/blog\/wp-content\/uploads\/2013\/04\/MediaSettings.png 741w, https:\/\/bergs.biz\/blog\/wp-content\/uploads\/2013\/04\/MediaSettings-150x131.png 150w, https:\/\/bergs.biz\/blog\/wp-content\/uploads\/2013\/04\/MediaSettings-300x262.png 300w, https:\/\/bergs.biz\/blog\/wp-content\/uploads\/2013\/04\/MediaSettings-343x300.png 343w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/a>And then I needed one Alias in my Apache configuration to redirect the URL prefix to a directory under my web-server document root:<\/p>\n<pre># \"Intercepts\" files prefix and redirect to \"local\" (user's) directory\r\nAlias \/blog\/files \/home\/rabe\/var\/www\/bergs.biz\/blog\/files\r\n# This is the prefix to the root of my blog\r\nAlias \/blog \/usr\/share\/wordpress<\/pre>\n<p>That&#8217;s it! Sometimes things are so easy, and it only takes a short while to fix them&#8230; \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was struggling with a problem that I couldn&#8217;t upload media files to my blog &#8212; which I host myself on a Debian box in a multi-site configuration. When I tried to do so I got an error message saying that WordPress couldn&#8217;t write to the directory. Actually I had this very problem since 2005 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[75,74,73],"class_list":["post-311","post","type-post","status-publish","format-standard","hentry","category-debian","tag-media-upload","tag-multi-site","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":8,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions\/320"}],"wp:attachment":[{"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bergs.biz\/blog\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}