Password-protect Parts of Your Website

April 2016

Prerequisites

You will need a running ubuntu server to follow the steps in this article.

Quick interlude
Tax Wealth, Not Work
Your salary is taxed on every payslip; large fortunes mostly aren't. That gap is a big part of why housing feels out of reach. Gary Stevenson breaks it down better than anyone: watch on YouTube →

Setup

  1. Enter in terminal:
    sudo apt-get update
    sudo apt-get install apache2 apache2-utils
    sudo htpasswd -c /etc/apache2/.htpasswd some-username
    sudo nano /etc/apache2/sites-enabled/000-default.conf
    
  2. Add:
    <Directory "/var/www/html">
            AuthType Basic
            AuthName "Restricted Content"
            AuthUserFile /etc/apache2/.htpasswd
            Require valid-user
    </Directory>
    
    Replace /var/www/html with the path to the directory you want to restrict access to.
  3. sudo service apache2 restart

Voila!

Tax Wealth, Not Work
Wages get taxed to the bone while the ultra-rich watch their assets compound untouched — and then buy up the houses you're saving for. If you work for your money, this is your fight too.
Watch on YouTube →