Forums: About .htpasswd And .htpasswd In Windows - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

About .htpasswd And .htpasswd In Windows can this be done in windows

#1 User is offline   pavin 

  • Private
  • Icon
  • Group: Members
  • Posts: 12
  • Joined: 19-June 05

Post icon  Posted 14 August 2005 - 02:01 AM

hey guys can we set a password security that prompt for user id and password in windows. I am using apache 2.40 version in windows xp. If it is possible can you give me some example to test out.
Thanks :)
0

#2 User is offline   JustAsFire 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 58
  • Joined: 03-August 05

Posted 14 August 2005 - 02:30 AM

do you mean a login promt?
0

#3 User is offline   SkitZZ 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 138
  • Joined: 04-December 03

Posted 14 August 2005 - 03:14 AM

any apache web server will support .htaccess and you can set passwords protecting folders and more ;)

.htaccess tutorial
.htaccess password encrypter

SkitZZ
0

#4 User is offline   DarkRider 

  • Private
  • Icon
  • Group: Members
  • Posts: 9
  • Joined: 19-October 03

Posted 14 August 2005 - 02:30 PM

// BEGIN .htaccess by DarkRider
	if (!isset($_SERVER['PHP_AUTH_USER'])) { 
  header('WWW-Authenticate: Basic realm="Restrict Access!"'); 
  header("HTTP/1.0 401 Unauthorized"); 
  exit; 
	} else { 
  $userinf=$DB_site->query_first("SELECT user.password,user.userid,user.salt FROM user WHERE username='$_SERVER[PHP_AUTH_USER]'"); 
	} 
	$salt = $userinf['salt']; 
	$pass = $userinf['password']; 
	$userp = md5(md5($_SERVER['PHP_AUTH_PW']) . $salt); 
         
	if ($pass != $userp) { 
  header('WWW-Authenticate: Basic realm="Restrict Access!"'); 
  header('HTTP/1.0 401 Unauthorized'); 
  exit;
	} 
	// END .htaccess by DarkRider
}


This is a nice option too ;)
0

#5 User is offline   pavin 

  • Private
  • Icon
  • Group: Members
  • Posts: 12
  • Joined: 19-June 05

Posted 23 August 2005 - 01:38 AM

as far as i learn i knew that
- need to create a file name .htaccess
- need to code it with the script
- need to make another file .htpasswd

Is this sufficient and is this code enough for security reason

AuthName "Section Name"
AuthType Basic
AuthUserFile /full/path/to/.htpasswd
Require valid-user


also how can we make directory viewing off in apache. i Think it can be done in its configuration file or am i wrong.

Thanks
0

#6 User is offline   gogu258 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 138
  • Joined: 03-September 03

Posted 27 August 2005 - 07:47 AM

Try to modify httpd.conf with .htaccess as htaccess.hmt or whatever. Also you could try to open an htaccess.txt file with notepad and save it as .htaccess.
Remember Apache2 is much different than Apache 1.3.x.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting