Move to secure protocol (https) issues

Move to secure protocol (https) issues

by Wes Matchett -
Number of replies: 8

I attempted to move to SSL but ran in to a problem.  The certificate is installed and the rest of the web site is running fine.  I updated wwwroot in config.php. 

I can log in but styles are not working,  there are still urls that get a 404 error.  Specifically any url that follows the pattern <moodle path>/something.php/<more path> fails.  Note the ".php/" in the middle.  Only urls with that pattern gets a a 404.  I didn't even know such a url was valid.  Here are three examples that are failing...

https://<domain>/moodle/lib/javascript.php/1485990008/lib/jquery/jquery-1.12.1.min
https://<domain>/moodle/theme/image.php/afterburner/theme/1485990574/favicon
https://<domain>/moodle/theme/styles.php/afterburner/1485990574/all

How do I fix this?

Average of ratings: -
In reply to Wes Matchett

Re: Move to secure protocol (https) issues

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Do you have "Use slash arguments" enabled? This is in your admin settings for HTTP (http://[yoursite]/admin/settings.php?section=http

In reply to Mike Churchward

Re: Move to secure protocol (https) issues

by Wes Matchett -
I will check this when I return - I am not in the office until next week,

out of town.



On Thu, Feb 2, 2017 at 9:55 AM, Mike Churchward (via Moodle.org) <
In reply to Mike Churchward

Re: Move to secure protocol (https) issues

by Wes Matchett -

Thanks, it was not turned on, so I enabled AcceptPathInfo in apache. All the urls are now resolving correctly, but moodle still is displayed without styles.  See the capture below.  I viewed the source of the login page and checked every href= and src=.  Every one is found.  I restarted apache (when I set AcceptPathInfo), and I "cleared all caches".


Wham am I missing?  This system has been running fine for 5 years as http.  Going to htps changes something and I can't find it.

Attachment Screen Shot 2017-02-07 at 10.47.46 AM.png
In reply to Wes Matchett

Re: Move to secure protocol (https) issues

by Wes Matchett -

Interesting note...  when I access using http I also do not see styles applied.

In reply to Wes Matchett

Re: Move to secure protocol (https) issues

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Have you run the replace script on your database?  yoursite.com/admin/tool/replace/index.php.  It might just be that you still need to update the urls in the database to reflect the https.  Oh, and try clearing your caches too.

 

In reply to Emma Richardson

Re: Move to secure protocol (https) issues

by Wes Matchett -

Thanks for the reply.  Yes, "http://db02" (the test server name) was replaced with "https://replimat" (the production server name).  Caches were cleaned from the admin, "Purge All Caches", and the client browser caches have been wiped.

In reply to Mike Churchward

Re: Move to secure protocol (https) issues

by Wes Matchett -

Hmmm...  slash arguments are enabled and are no longer returning the 404, but they are not returning the proper results.  This url:

is not returning javascript but rather the php source of that file.  Viewing the login source and then opening the link show this:


<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>;.

/**
 * This file is serving optimised JS
 *
 * @package    core_lib
 * @copyright  2010 Petr Skoda (skodak)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
so apache is not parsing the slash argument urls as php.



In reply to Wes Matchett

Re: Move to secure protocol (https) issues

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon intrusion to discussion ...

2 Questions:

1. does server have a valid cert?  Not self generated or generated by #2 ...

2. does the network upon which it resides have anything in front of the moodle ... like something that would "guard' the moodle server?

What would happen if, from the command line of your server, using elinks (text based browser) to the server url  by FQDN and via http and then again with https

'spirit of sharing', Ken