Topic on Project:Support desk

Chauncey edgar (talkcontribs)

I have a new install of mediawiki 1.30.0. It's running on a physical server (not a VM). My php version is 5.6.35. The database is mysql 5.6.40. All this is running on FreeBSD 11.1-RELEASE-p9 with apache 2.4.33.

Here's the issue: I got wikimedia installed and running. Login worked fine. Afterwards, I enabled SSL on the wiki site. Now, when a user logs in, he gets redirected to https://example.comindex.php/Main_Page - note the lack of a '/' between the domain and 'index.php...' - and of course it can't be found. If you manually put the '/' where it belongs, Main_Page loads properly. Before I enabled SSL, this worked correctly. Any ideas? Thanks.

PS - I'd rather not leave apache running until a couple of other unrelated things are resolved.

Ciencia Al Poder (talkcontribs)

If clicking on the logo doesn't redirect you to the faulty address, I'd say the problem may be in redirect rules from apache (if you have any)

Chauncey edgar (talkcontribs)

Clicking the logo gets me to the correct Main_page; but I have to click the Back button in my browser in order to see the logo. Immediately after login, I only see my browser's "not found" page.

Thanks.

Chauncey edgar (talkcontribs)

Another way to phrase the question: when a user enter his password and clicks 'Log in,' which file processes the login and generates the URL?

AhmadF.Cheema (talkcontribs)

Unless you have changed anything in MediaWiki core files, the issue shouldn't be from there.

Can you show your Apache redirect rules (if any), and the values for $wgScriptPath, $wgArticlePath from your LocalSettings.php file.

Chauncey edgar (talkcontribs)

I don't think I've changed those things, but I have $wgScriptPath = ""; $wgArticlePath does not appear in my LocalSettings.php.

Chauncey edgar (talkcontribs)

Update: the same problem appears when creating a new page. When you click the "Save" button, you get sent to the new page's URL, but the same '/' is missing (between the domain and 'index.php'). It also appears when saving an edit to an existing page, or searching on a page that exists. Searching on a nonexistent page works properly, i.e. offers you the opportunity to create it.

To address Ciencia Al Poder's other point: The only apache redirect is from HTTP to HTTPS; this works fine.

You can try it at https://navseadoc.org/. There is a test user called Testa (how do they think of these things?) with the password Rossa.

Chauncey edgar (talkcontribs)

After triple-checking all the mediawiki files, I rechecked my apache config and did some experimenting. I found that if I have apache listen on port 80 only, my wiki works fine. It's only listening on port 443 that causes the "wrong URL" issue, whether using a redirect from port 80 to 443, or with a straight 443-only setup. Here are the relevant parts of httpd.conf as it stands now, which causes the "wrong URL" problem. The parts that are obviously bogus have "real" values in the actual httpd.conf.

Listen 443

<VirtualHost *:80>

       ServerName navseadoc.org

       Redirect "/" "https://navseadoc.org"

</VirtualHost>

<VirtualHost *:443>

       ServerName navseadoc.org

       ServerAdmin myname@example.com

       SSLEngine on

       SSLCertificateFile "/path/to/certificate"

       SSLCertificateKeyFile "/path/to/private/key"

     # The following is a symlink to wherever mediawiki ended up:

       DocumentRoot /usr/local/www/apache24/data/sites/navseadoc.org   

</VirtualHost>

Behavior is unchanged whether I use a symlink or the real path to mediawiki in the DocumentRoot line. If it matters, I am not using mod_rewrite. I do have shell access to the server.

Ciencia Al Poder (talkcontribs)
Chauncey edgar (talkcontribs)

Adding the trailing '/' to the apache redirect fixed it. The $wgServer change doesn't seem to have any effect, although I left it in place on general principles.

Thank you so much!