{"id":654,"date":"2015-12-13T21:06:05","date_gmt":"2015-12-14T04:06:05","guid":{"rendered":"http:\/\/10.0.1.201\/?p=654"},"modified":"2015-12-13T21:06:05","modified_gmt":"2015-12-14T04:06:05","slug":"os-x-server-5-shenanigans","status":"publish","type":"post","link":"https:\/\/strawhousepig.net\/wordpress\/2015\/12\/13\/os-x-server-5-shenanigans\/","title":{"rendered":"OS X Server 5 Shenanigans"},"content":{"rendered":"<p>OS X Server 5 for OS X 10.10. and 10.11, while a significant improvement to Lion Server for OS X 10.7, still behaves oddly when mixing SSL and non-SSL requests. Whereas before it wanted every request redirected to the SSL pipe, now it will let you do either. It won&#8217;t, however, let you do both.<\/p>\n<p>WordPress will try to do both. Why? I dunno. It should work, and did on plain Apache 2, but OS X Server 5 puts up a proxy to the WAN and serves from a different port. This is not presented upfront to the Server.app user, but is most likely in the docs. RTFM much? Ha-ha! No.<\/p>\n<p>The affect this had on my WordPress install is instead of logging in being presented with a page that merely stated,<\/p>\n<blockquote><p>You don&#8217;t have permission to view this page.\n<\/p><\/blockquote>\n<p>Or some such equally helpful information. A little web searching turned up the answer. To overcome this the following can be added to <strong>wp-includes\/http.php<\/strong><\/p>\n<p><code>\/* Adding this BS for OS X Server 5 being a dick... *\/<br \/>\nif ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {<br \/>\n\t$_SERVER['HTTPS']='on';<br \/>\n}<\/code><\/p>\n<p>I saw a <a href=\"https:\/\/wordpress.org\/support\/topic\/osx-server-v5034-breaks-wp-43x-install\" target=\"_blank\" rel=\"noopener\">post on wordpress.net<\/a> that said to put this into <strong>config.php<\/strong>, but that did not work for me. Neither did the mod_rewrite mumbo-jumbo in that thread and apparently it didn&#8217;t for the OP, either.<\/p>\n<p>I admit being ignorant to what <strong>HTTP_X_FORWARDED_PROTO<\/strong> is, but it appears to be a HTTP header from an Apache mod Apple is running. Unique to them or something well known? I dunno. I don&#8217;t pretend to try to keep up with this stuff any longer. That&#8217;s why I went to WordPress; So I wouldn&#8217;t have to.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OS X Server 5 for OS X 10.10. and 10.11, while a significant improvement to Lion Server for OS X 10.7, still behaves oddly when mixing SSL and non-SSL requests. Whereas before it wanted every request redirected to the SSL pipe, now it will let you do either. It won&#8217;t, however, let you do both. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,7],"tags":[9,15,28,30],"class_list":["post-654","post","type-post","status-publish","format-standard","hentry","category-code","category-web","tag-apache","tag-fixit","tag-os-x","tag-php"],"_links":{"self":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts\/654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=654"}],"version-history":[{"count":0,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts\/654\/revisions"}],"wp:attachment":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}