Want to subscribe to topics you're interested in?
Become a Member

Wordpress How To enable wp_login protection after setting up site

Discussion in 'Blogs & CMS usage' started by skringjer, Aug 5, 2020.

  1. skringjer

    skringjer Member

    144
    17
    18
    Apr 21, 2019
    Ratings:
    +31
    Local Time:
    4:48 PM
    Hi everyone, i hope i am making thread in the right section.

    I wanted to know is it possible to setup wp_login protection on wordpress sites that does not have it?
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,201
    10,280
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,934
    Local Time:
    9:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    When you run centmin.sh 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 centmin.sh menu option 22 run. As with all centmin.sh menu options logs are automatically saved at /root/centminlogs. So at end of centmin.sh 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 domain.com wordpress setup successfully
    domain.com setup info log saved at:
    /root/centminlogs/centminmod_123.09beta01.b203_120719-221749_wordpress_addvhost.log
    -------------------------------------------------------------
    

    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"
    /root/centminlogs/centminmod_123.09beta01.b421_030220-222801_wordpress_addvhost.log
    /root/centminlogs/centminmod_123.09beta01.b490_150420-211636_wordpress_addvhost.log
    


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

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

    then restart nginx
    Code (Text):
    ngxrestart

    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/demodomain.com/htpasswd_wplogin;
    

    like
    Code (Text):
       #auth_basic "Private";
       #auth_basic_user_file /home/nginx/domains/demodomain.com/htpasswd_wplogin;
    

    then restart nginx

    And lastly to enable it, it's same as resetting instructions above, just need to ensure auth_basic elated settings are enabled in your wordpress vhost
     
  3. skringjer

    skringjer Member

    144
    17
    18
    Apr 21, 2019
    Ratings:
    +31
    Local Time:
    4:48 PM
    Okay thank you very much, :) :) :)