{"id":102,"date":"2017-09-26T08:41:28","date_gmt":"2017-09-26T12:41:28","guid":{"rendered":"http:\/\/huckleberry.mhu.edu\/randommusings\/?p=102"},"modified":"2017-09-26T08:43:32","modified_gmt":"2017-09-26T12:43:32","slug":"apache-reverse-proxy-for-moodle-on-centos-7-3","status":"publish","type":"post","link":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/2017\/09\/26\/apache-reverse-proxy-for-moodle-on-centos-7-3\/","title":{"rendered":"Apache Reverse Proxy for Moodle on CentOS 7.3"},"content":{"rendered":"<h2>The Musing<\/h2>\n<p>As I&#8217;ve written previously, we moved our <a href=\"http:\/\/www.moodle.org\/\">Moodle<\/a>\u00a0server to a virtual server, but I also keep live backups of each term for as long as possible. Because we&#8217;ve been using Moodle for almost ten (10) years, we have mountains of data, and it won&#8217;t all fit on the virtual machine. I&#8217;d still like to keep it live, not just on backup disk\/dvd\/whatever.<\/p>\n<h2>The Situation<\/h2>\n<p>I still have the previously used physical server that ran Moodle. It has tons of storage available, and still runs well, but it&#8217;s no longer under warranty which is one reason we moved our production Moodle instance to a VM. I want the physical machine to host the files\/DB for all of the old Moodle installs, but so all of the URLs remain the same, use the VM as a frontend and reverse proxy (both http and https) to serve content from the physical machine.<\/p>\n<h2>The Fix<\/h2>\n<p>Essentially, I have to modify the VirtualHost entries for both http (80) and https (443).<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\r\n&lt;Location \/2017Summer&gt; \r\nProxyPass http:\/\/moodleoldIP\/2017Summer \r\nProxyPassReverse http:\/\/moodleoldIP\/2017Summer \r\nProxyPreserveHost On \r\nRequire all granted \r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>and in ssl.conf:<\/p>\n<pre class=\"brush: xml; gutter: false; title: ; notranslate\" title=\"\">\r\nSSLProxyEngine On\r\n&lt;Location \/2017Summer&gt;\r\nProxyPass https:\/\/moodleoldIP\/2017Summer\r\nProxyPassReverse https:\/\/moodleoldIP\/2017Summer\r\nProxyPreserveHost On\r\nRequire all granted\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>Now, do a <em>systemctl reload httpd<\/em> and everything seems to work!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Musing As I&#8217;ve written previously, we moved our Moodle\u00a0server to a virtual server, but I also keep live backups of each term for as long as possible. Because we&#8217;ve been using Moodle for almost ten (10) years, we have mountains of data, and it won&#8217;t all fit on the virtual machine. I&#8217;d still like to keep it live, not&hellip; <a href=\"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/2017\/09\/26\/apache-reverse-proxy-for-moodle-on-centos-7-3\/\">More &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,2],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-moodle","category-technology"],"_links":{"self":[{"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":6,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huckleberry.mhu.edu\/randommusings\/index.php\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}