Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure HTTPS Basic Authentication .htaccess on WD MyBookLive

I have WD MyBookLive 2TB, and did the following:

  • saved my own .htaccess to /var/www/mysebserver that points to my own .htpasswd located at /etc/apache2/.
  • Gave 777 permission to .htaccess
  • All my webpages located on the same folder with .htaccess.

The .htaccess file is:

AuthType Basic 
AuthName "Restricted Content" 
AuthUserFile /etc/apache2/.htpasswd 
Require valid-user

The issue is that the basic authentication is not enabled, I still can access the HTML files without any authentication.

Moreover it seems .htaccess files are ignored even if I set in apache2.conf the followings:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

404 Internal Server Error is thrown when AllowOverride All

Apache version: 2.2.9

It seems WD MyBookLive is ignoring the .htaccess and .htpasswd files

How do I activate Basic Authentication?

like image 820
Duna Avatar asked Feb 02 '18 06:02

Duna


1 Answers

So I just try your config in my .htaccess file and get base login form after that.

I found the article "How To Set Up Password Authentication with Apache on Ubuntu 14.04" (https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04)

I think it can happens becouse you don't installed apache2-utils.

Please, try next commands:

sudo apt-get install apache2-utils
sudo service apache2 restart
like image 155
Lakremon Avatar answered Nov 09 '22 06:11

Lakremon