Skip to content

Instantly share code, notes, and snippets.

@saissemet
Last active November 20, 2020 12:27
Show Gist options
  • Save saissemet/c95f1510400b6a49386f2df36229befc to your computer and use it in GitHub Desktop.
Save saissemet/c95f1510400b6a49386f2df36229befc to your computer and use it in GitHub Desktop.
## We'll be creating and protecting a new website folder named "secreta" with the user "saissemet". ##
sudo nano /var/www/htmls/secreta/.htaccess
AuthType Basic
AuthName "Password Required"
Require valid-user
AuthUserFile /etc/apache2/.htpasswd
sudo nano /etc/apache2/sites-available/default-ssl.conf
<Directory /var/www/htmlapaches>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo htpasswd -c /etc/apache2/.htpasswd saissemet
sudo systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment