0

I am a server newbie, I have 2 websites running on my webserver that are my dads. I'm currently trying to enable http2 protocol.

Server OS: Ubuntu 16.04 Using apache2

I ran the following commands on my server:

a2enmod http2

a2enmod ssl

systemctl restart apache2

After the mods were enabled and restarted I added to my ssl virtualhost on port 443:

Protocols h2 http/1.1 

After this I ran:

apt-get update
apt-get upgrade

And after that restarted the bunch again but with no changes.

So all the tutorials show the exact process I have already done but my websites just decide to stay in the HTTP 1 protocol.

I have tried googeling around but as I am not a pro with this, I am scarred ill mess something up badly. So I would love your input in things I should try.

My virtualhost for my SSL.

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        Protocols h2

        ServerName domain.nl
        ServerAlias www.domain.nl

        ServerAdmin email.com
        DocumentRoot /var/www/domain.nl/public_html

        <Directory "/var/www/domain.nl/public_html">
         AllowOverride All
         Allow from All
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/stinger_error.log
        CustomLog ${APACHE_LOG_DIR}/stinger_access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.nl/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.nl/privkey.pem
</VirtualHost>
</IfModule>

What have I missed?

Granny
  • 101
  • 1
  • Post entire config, but anonymize private data. Make sure you configure SSL certificates. – Mircea Vutcovici Apr 11 '19 at 14:45
  • @MirceaVutcovici Hi! Thanks for your response, SSL certificates are fine and up and running. What config would you like? Apache2 has them split up into multiple files I believe. – Granny Apr 11 '19 at 14:54
  • Virtual host at least – Mircea Vutcovici Apr 11 '19 at 15:01
  • Are you using prefork mpm? If so should be a line in the error logs and HTTP/2 is ignored. Other issues could be due to a proxy in your PC (e.g. if running anti virus) or weak SSL setup (HTTP/2 requires strong ciphers). You also need OpenSSL 1.0.2 or above but should be on that as on Ubuntu 16. Is it a public facing server? Can you run https://www.ssllabs.com/ssltest/ on it and paste results? – Barry Pollard Apr 13 '19 at 10:31
  • My apologies for my late response. I have been extremely busy with work lately. I was unable to respond. Currently at school, ill see if I can post my virtualhost and if I can find out if I am using a prefork mpm. – Granny Apr 16 '19 at 13:15
  • I added the virtualhost – Granny Apr 18 '19 at 10:36

1 Answers1

0

Turned out to be a prefork that was uncompatible with HTTP2.

I used the following guide to fix it.

https://techwombat.com/enable-http2-apache-ubuntu-16-04/

Granny
  • 101
  • 1