Syscribe Posted July 12, 2007 Share Posted July 12, 2007 Using Apache 2.2.3 under Windows XP Pro I'm trying to use .htpasswd to create a password file, but whatever filename I try to use, I get an error message that .htpasswd cannot create the file. If I manually create an empty file first and leave out the -c the error message changes to cannot modify the file. I would prefer to use a filename which relates to the particular site I'm setting up rather than .htpasswd to avoid the overhead of using groups - ie each site will have its own dedicated password file. From the online documentation, it looks like this should be possible but I'm beginning to doubt that I should take anything as read! Hope someone can help please Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 17, 2007 Share Posted July 17, 2007 Go: htpasswd -bn username pass That will give you a string like: username:KDE0RX5e08e/E Just put that in a file called any name you like. Typically .htpasswd is used as apache will not allow direct access to these files. (so someone cant browse and read your password). -steve Quote Link to comment Share on other sites More sharing options...
Syscribe Posted July 17, 2007 Author Share Posted July 17, 2007 Thanks for the advice stevie. In fact I've already bypassed the problem by downloading and using htpasswd Generator (www.htpasswdgenerator.com) which doesn't seem to have a problem creating the file and allows simultaneous viewing and editing of .htpasswd, .htgroup and .htaccess to ensure they're in agreement with each other. However, I'm still intrigued as to why the command line .htpasswd can't create the file. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 17, 2007 Share Posted July 17, 2007 Windows has a thing about files with no name before the file extension. i.e.: .htaccess Other possible reasons could be a lack of permissions etc. -steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.