Discover Centmin Mod today
Register Now

Wordpress Reset wp-login.php HTTP Authentication Password?

Discussion in 'Blogs & CMS usage' started by lostincable, May 30, 2020.

  1. lostincable

    lostincable New Member

    Feb 17, 2018
    Local Time:
    3:56 AM
    Hi there

    During a WordPress install I didn't password protect the directory as offered by the installer.

    Is there an easy command to password protect my site now it's already setup?

    I can obviously use htpasswd but just checking if something is available in centminmod to do this.
  2. Jon Snow

    Jon Snow Active Member

    Jun 30, 2017
    Local Time:
    2:56 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    FAQ item 43

    Don't think there's another way.
  3. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    3:56 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    FAQ item 43 is general way to do it and same outlined below just specific to menu option 22 created Wordpress ites.

    When you run menu option 22 to create a Nginx based Wordpress site, there will be at end of the process all the relevant login details provided. If you answered yes to HTTP password protect login wp-login.php then those user/password details will be at end of menu option 22 run. As with all menu options logs are automatically saved at /root/centminlogs. So at end of menu option 22 run it will tell you were the log was saved.

    example at /root/centminlogs/centminmod_123.09beta01.b203_120719-221749_wordpress_addvhost.log
    Code (Text):
    vhost for wordpress setup successfully setup info log saved at:

    You can search for all the logs via grep filter below
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep '_wordpress_addvhost.log'

    or find command
    Code (Text):
    find /root/centminlogs/ -type f -name "*_wordpress_addvhost.log"

    example output
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep '_wordpress_addvhost.log'
    -rw-r--r--   1 root root  21K Feb  3 22:29 centminmod_123.09beta01.b421_030220-222801_wordpress_addvhost.log
    -rw-r--r--   1 root root  26K Apr 15 21:26 centminmod_123.09beta01.b490_150420-211636_wordpress_addvhost.log

    Code (Text):
    find /root/centminlogs/ -type f -name "*_wordpress_addvhost.log"

    To reset Wordpress wp-login.php HTTP password created by menu option 22 wordpress auto installer, you can use script
    Code (Text):
    /usr/local/nginx/conf/ create /home/nginx/domains/$vhostname/htpasswd_wplogin USERNAME PASSWORD

    where, you change USERNAME to your desired username and PASSWORD to your password and change to your wordpress site's domain name

    then restart nginx
    Code (Text):

    Or if you want to disable http password protection comment out both these lines
    Code (Text):
       auth_basic "Private";
       auth_basic_user_file /home/nginx/domains/;

    Code (Text):
       #auth_basic "Private";
       #auth_basic_user_file /home/nginx/domains/;

    then restart nginx