{"id":794,"date":"2016-10-03T10:58:05","date_gmt":"2016-10-03T09:58:05","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=794"},"modified":"2017-05-31T14:48:16","modified_gmt":"2017-05-31T13:48:16","slug":"adding-authtype-basic-http-authentication-wordpress-wp-admin-phpmyadmin-etc","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/10\/03\/adding-authtype-basic-http-authentication-wordpress-wp-admin-phpmyadmin-etc\/","title":{"rendered":"Adding AuthType Basic HTTP Authentication for WordPress wp-admin , phpMyAdmin, etc"},"content":{"rendered":"<p>Hey folks, so this comes up really often with Rackspace customers, how to add AuthType Basic HTTP authentication. This is akin to an additional user\/pass dialog box which appears when navigating to the url. It is really easy to create a new password:<\/p>\n<pre>htpasswd -c \/etc\/httpd\/.htpasswd-private username\r\n<\/pre>\n<p>Please note .htpasswd-private can be anything, however it&#8217;s better to make it a hidden file by prefixing with a . dot, also important to ensure that the password file isn&#8217;t in a web documentroot, the file should have user and group root root, but that should be done automatically when you create the file with root user.<\/p>\n<p>This is what I added to phpmyadmin configuration file in \/etc\/httpd\/conf.d\/phpMyAdmin.conf<\/p>\n<pre> <code>\r\n&lt;Location \"\/phpMyAdmin\/\"&gt;\r\nAuthType Basic\r\nAuthName \"Private Server\"\r\nAuthUserFile \/etc\/httpd\/.htpasswd-private\r\nRequire valid-user\r\n&lt;\/Location&gt;\r\n<\/code>\r\n<\/pre>\n<p>You could do the same for WordPress;<\/p>\n<pre>&lt;Location \"\/wp-admin\/\"&gt;\r\nAuthType Basic\r\nAuthName \"Private Server\"\r\nAuthUserFile \/etc\/httpd\/.htpasswd-private\r\nRequire valid-user\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>Please note that I am using Location, but you can apply the same thing within a directive instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey folks, so this comes up really often with Rackspace customers, how to add AuthType Basic HTTP authentication. This is akin to an additional user\/pass dialog box which appears when navigating to the url. It is really easy to create &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/10\/03\/adding-authtype-basic-http-authentication-wordpress-wp-admin-phpmyadmin-etc\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,9,61,3],"tags":[],"class_list":["post-794","post","type-post","status-publish","format-standard","hentry","category-apache","category-linux","category-rackspace","category-security"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=794"}],"version-history":[{"count":7,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/794\/revisions"}],"predecessor-version":[{"id":1044,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/794\/revisions\/1044"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}