How To Fix 401 Unauthorized Error wordpress on DigitalOcean

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:

cat /root/WORDPRESS

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 :

nano /etc/apache2/apache2.conf

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>

here is a example ,screen shot:
wordpress

Press “Enter” to save the .conf file.  Its done.

2 thoughts on “How To Fix 401 Unauthorized Error wordpress on DigitalOcean

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.