Basic HTTP Auth

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Basic HTTP Auth

Post by uberpolak »

I'm trying to get a heavily database-reliant site off the ground, and since my host doesn't allow external connections to MySQL, I've had to resort to installing phpMyAdmin. The installation is fine, but I want to install an HTTP auth scheme so phpMyAdmin isn't accessible to anyone who finds the URL, for hopefully obvious reasons. I've exhausted myself reading every guide I can find about the basic method, and I thought I had a good understanding of it. Evidently I was wrong. Here is how my .htaccess and .htpasswd files look, with the details changed. For the encryption I used an online tool people swear by (the one at http://www.4webhelp.net/), so I'm pretty sure that much is ok (although I could be wrong). Hopefully someone can find the problem here.

.htaccess

Code: Select all

AuthUserFile /full/path/.htpasswd
AuthName phpMyAdminLogin
AuthType Basic
require valid-user
.htpasswd

Code: Select all

admin:encryptedpassword
Thanks for helping.
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post by mrvanjohnson »

Not sure why you are doing this. phpMyAdmin has a couple of built in Authenication methods why wouldn't you use them?
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post by mrvanjohnson »

In the base directory of phpMyAdmin look at config.inc.php. There are three types right there.

Authentication method (config, http or cookie based)
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Re: Basic HTTP Auth

Post by redhair »

If you don't want to go through the above solution:
change .htaccess to

Code: Select all

AuthType Basic
AuthName "phpMyAdminLogin"
AuthUserFile /full/path/.htpasswd
require user admin
Post Reply