trueCamelType trueCamelType - 1 year ago 67
PHP Question

Why isn't apache2 redirecting to https, or acting how I expect with mediawiki?

I have a mediawiki site on Ubuntu 14.04, that is working perfectly, and is housed at


I'm trying to get https setup on the server, and I haven't been able to get that done yet. Here's my current port 80 configs, and I'll show what I'm trying below that.


<VirtualHost *:80>
DocumentRoot /var/www/html


#this is the only relevant line...I think.
$wgServer = ""

The changes I'm making, in order, are below

1. Change
value to

2. Edit
to the following

<VirtualHost _default_:80>
Redirect permanent /

<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/my.crt
SSLCertificateKeyFile /etc/apache2/ssl/my.key

3. Stop apache from using the old
file by running
sudo a2dissite 000-default

4. Start using the new ssl default file by running
sudo a2ensite default-ssl

5. Restart Apache2
sudo /etc/init.d/apache2 restart

At this point, apache2 restarts correctly, and there are no errors from the output or in the error.log. However, when I go to the site by typing
it doesn't redirect me to
, and now it shows the
section of the site as the
Index of / html/

When I try to manually go to
, I get a page not available, like it's not even trying.

Where am I going wrong?

Answer Source

This was a silly solution, but I imagine on a product like mediawiki, I won't be the last to make this mistake.

I never enabled the ssl module

sudo a2enmod ssl

I went through tens of tutorials on how to setup ssl on mediawiki, and none of them mentioned this. It's pretty obvious if you work on lots of websites, but I don't, and hopefully this helps someone in the future.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download