Posts Tagged “ubuntu”

Updating to the latest version of git on Ubuntu

If you’re using git on Ubuntu, the version distributed via apt may not be the newest version of git (I use git to deploy changes on all of the sites I manage). You can install the latest stable version of git provided by the maintainers as follows:

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update

Installing HTTP/2 on Ubuntu 16.04 with virtual hosts

Now that HTTP/2 is fairly stable and widely available, I decided to try and install and run it on this server. I’m currently running the Ubuntu 16.04.2 LTS with virtual hosts configured so I can serve a number of sites beyond this one. All of the sites this server hosts are also served securely using certificates from LetsEncrypt.

To install HTTP/2 I SSH’d in to the server and ran the following commands:

# add the new apache repository to your server's sources

sudo add-apt-repository -y ppa:ondrej/apache2

# update apache

sudo apt-key update

sudo apt-get update

# WARNING: answering yes at the prompts following this command will overwrite your apache.conf file located in /etc/apache2

sudo apt-get --only-upgrade install apache2 -y

# enable http2

sudo a2enmod http2

Next, navigate to /etc/apache2/sites-available and edit a virtual file of your choice, adding the following line after the ServerName declaration:

Protocols h2 h2c http/1.1

Finally, restart apache:

sudo service apache2 restart

Your site should now be served using http2. You can verify this using the KeyCDN tool located here.

Did I miss anything? Let me know.

Clearing mod_pagespeed cache

I use mod_pagespeed on this server to help speed up asset delivery and force optimization best practices across all of the sites I host. Occasionally, during deployments, it’s helpful to clear the module cache. Doing so is as simple as the following:

touch /var/cache/mod_pagespeed/cache.flush