Enabling HTTP/2, HTTPS, and going HTTPS-only on inf2

Featured image: John Moore | Unsplash (photo)

Inf2 is a web server at University of Rijeka Department of Informatics, hosting Sphinx-produced static HTML course materials (mirrored elsewhere), some big files, a WordPress instance, and an internal instance of Moodle.

HTTPS was enabled on inf2 for a long time, using a self-signed certificate. However, with Let’s Encrpyt coming into public beta, we decided to join the movement:

HTTPS was optional. Almost a year and a half later, we also enabled HTTP/2 for the users who access the site using HTTPS. This was very straightforward.

Mozilla has a long-term plan to deprecate non-secure HTTP. The likes of NCBI (and the rest of the US Federal Government), Wired, and StackOverflow have already moved to HTTPS-only. We decided to do the same.

Configuring nginx to redirect to https:// is very easy, but configuring particular web applications at the same time can be tricky. Let’s go through them one by one.

Sphinx-produced static content does not hardcode local URLs, and the resources loaded from CDNs in Sphinx Bootstrap Theme are already loaded via HTTPS. No changes were needed.

WordPress requires you to set the https:// URL in Admin, Settings/General. If you forget to do so before you go HTTPS only, you can still use the config file to adjust the URL.

Moodle requires you to set $CFG->wwwroot in the config file to https:// URL of your website.

And that’s it! Since there is a dedicated IP address used just for the inf2.uniri.hr domain, we can afford to not require SNI support from the clients (I’m sure both Android 2.3 users are happy for it).

How to get Facebook Messages working in Firefox for Android without the Messenger app

Featured image: Loic Djim | Unsplash (photo)

When one tries to use Facebook Messages from a browser on a phone or tablet running a relatively recent Android, the website (m.facebook.com or touch.facebook.com) will open the Google Play store. Some of us prefer using browsers and avoid installing apps when possible. Unfortunately for us, Messenger does not offer a mobile website, only a link to download the app.

Luckily for us, there a are a few tricks that will help get Facebook Messages working from a browser on Android.

Google Chrome

The trick to avoid Facebook’s nagging is to enable “Request Desktop Site” in Chrome Menu. The explanation of what this option does is available on Stack Overflow.

Mozilla Firefox

Firefox also has the “Request Desktop Site” but, unfortunately, it doesn’t do the job; you actually get the desktop version of Facebook and it’s quite unusable.

One option is to use mbasic.facebook.com. Unfortunately, mbasic is neither as functional nor as pretty as m, let alone touch.

The way to get Messages working on m or touch is to pretend to be running a version of Android that is unsupported by the Messenger app. In my experiments, anything older than 4.4 will do the trick, so I picked 4.3.1. You can pick your poison from Wikipedia, but bear in mind that using very old versions might get Facebook mobile website to use workarounds which are no longer needed and will break stuff if used.

To pretend to be using an old version of Android, we will alter the Firefox’s user agent string. In Firefox, go to about:config. Add a new String option called general.useragent.override the and set it to e.g.

Mozilla/5.0 (Android 4.3.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0

Compare this with the default usera gent string which is in my case

Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0

Note that this string will not be automatically updated when Firefox is updated, so you should take care to update it manually. For more information about the user agent override option, check out this Super User question.

Browser wars

Featured image: José Iñesta | Unsplash

Last week in Rijeka we held Science festival 2015. This is the (hopefully not unlucky) 13th instance of the festival that started in 2003. Popular science events were organized in 18 cities in Croatia.

I was invited to give a popular lecture at the University departments open day, which is a part of the festival. This is actually the second time in a row that I got invited to give popular lecture at the open day. In 2014 I talked about The Perfect Storm in information technology caused by the fall of economy during 2008-2012 Great Recession and the simultaneous rise of low-cost, high-value open source solutions. Open source completely changed the landscape of information technology in just a few years.

The talk was well received, but unfortunately was not recorded. However, I was invited to repeat it at Rikon 2014, and we have the recording from there posted on YouTube. The recording is in Croatian, but the Truth Happens Remix video I play during the talk is in English. I also have to credit Jim Whitehurst’s TEDx talk on Economics of the Information Revolution for inspiration.

University departments open day 2015

This year I wanted to talk more specifically about why open source succeeded, and ideally cover one really successful project the general public had prior experience with in the role of a user. Completely unrelated, I also really wanted to talk at some point about what I saw during the early years of Mozilla. These two were really easy to combine, and the topic of Browser wars was proposed and accepted.

The talk covered the rise of NCSA Mosaic, rise of Netscape Navigator/Communicator and later Microsoft Internet Explorer, the First browser war between the two, the fall of Netscape and appearance of Mozilla. I stressed the importance of web standards, and explained how they allowed Apple and Google to enter the competition with Safari and Chrome. Mozilla did not just make the entrance easier for them; it made the entrance possible at all. Mozilla did that by pushing its standards-compliant Firefox browser to the mainstream, which in turn forced webmasters to adapt.

Browser Wars
Browser market share over time, from 1996 to 2009. This timeframe only shows Mozilla Firefox biting into Internet Explorer’s market share, Google Chrome is not shown. (Image source: Wikimedia Commons.)

The talk has been recorded and will be has been uploaded to YouTube as soon as I get a hold of the recording. In the meantime, you can take a look at the 2012 version of the epic Mozilla Story video I played during the talk (for die-hard fans of Mozilla I will note that 2011 version is also available).

Article in the Universitas newspaper

University of Split newspaper Universitas published an article covering the talk in issue 65, pages 18 and 19. Tomislav Čizmić Marović helped me get the article in shape for publication, had no problem accepting drafts in OpenDocument format, and handled the typesetting very professionally. Thanks!

(Edit: text updated, video has been uploaded to YouTube.)