How To Fix 401 Unauthorized Error wordpress on DigitalOcean , My previous tutorials was “How to create a website on DigitalOcean in a minutes” after installing wordpress , browser ask you admin user & password. well you can find the user namd and password by command:
But this is a solution to complete the wordpress initial setup page. but every time when you will try to visit wordpress admin area browser will ask admin user & password.
its simple to fix the problem , log into your droplet via the command line, and run :
Now, you need to find the section that deals with the “/wp-admin/” section. It should look like this:
<DirectoryMatch ^.*/wp-admin/> AuthType Basic AuthName "Please login to your droplet via SSH for login details." AuthUserFile /etc/apache2/.htpasswd Require valid-user </DirectoryMatch>
This entire section can be commented out by placing the “#” character before each line, like this:
#<DirectoryMatch ^.*/wp-admin/> # AuthType Basic # AuthName "Please login to your droplet via SSH for login details." # AuthUserFile /etc/apache2/.htpasswd # Require valid-user #</DirectoryMatch>
Press “Enter” to save the .conf file. Its done.