Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2004, 11:13 AM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to markdawkins
Default Unable to make htaccess work.

I followed the Try it out steps exactly as they are in the book for this program in chptr 11 and it did not work. Is there an error in these directions that I do not know about.

I never get prompted for a password like the book states.

I am using windows so my .htaccess file looks like this.

AuthType Basic
AuthUserFile C:\Program Files\Apache Group\Apache2\htdocs\protected
AuthName "Restricted"
<LIMIT GET POST >
require valid-user
</LIMIT>

-----------

I am able to create a user file.

What am i doing wrong ?

MARK G Dawkins
 
Old December 31st, 2004, 03:27 PM
Authorized User
 
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had a little trouble getting .htaccess to work as well. So try the information provided at the following link. It ended up helping me, so maybe it'll be the same for you.

http://sniptools.com/vault/windows-a...entication.htm

 
Old January 3rd, 2005, 12:36 PM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to markdawkins
Default

Thanks this post helped me to fix the problem. You just have to be sure to read all the way thru to the bottom.

Thanks.

MARK G Dawkins
 
Old April 17th, 2011, 02:31 PM
Authorized User
 
Join Date: Jan 2010
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default More notes about .htaccess in Windows

Wow... after a few painful hours, I can share with you a little more about using .htaccess in Windows as opposed to Linux. There are some things that the book doesn't tell you, but the site linked to above does— still there is just a little info left out that I think should be mentioned explicitly.

For one, like the site says, you'll want to use an absolute path to the file which will house the usernames and passwords. You can name this file whatever you like. Use the htpasswd.exe program in the bin folder of your Apache installation to create the password file:

Code:
C:/Program Files (x86)/Apache Software Foundation/Apache 2.2/bin>htpasswd -c userauth john
Now, if you create the password file like this, you'll want to run CMD with Administrative privileges. Otherwise, it may not actually create the file. This happens with 64-bit Vista or 7 if you install this program in the Program Files (x86) folder. If you install Apache into another directory, you should be able to avoid this issue. Otherwise, you can just create the file elsewhere. To do so, simply specify the password file's path and fileaname in the command:

Code:
C:/Program Files (x86)/Apache Software Foundation/Apache 2.2/bin>htpasswd -c E:/Any/Other/Location/logins.txt john
It is advised that you place the htpasswd files somewhere above or outside of Apache's DocumentRoot directory. And, of course, you can avoid going to the bin folder every time to run the commands by putting the folder's absolute path in your Windows PATH environment variable.

Last edited by enderandpeter; April 17th, 2011 at 02:40 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
where to install the JSTLs, how to make them work dpettus JSP Basics 2 August 9th, 2007 03:39 AM
how to make it work? ashokparchuri ADO.NET 2 March 4th, 2005 07:00 AM
Cannot make site work wenlanli BOOK: ASP.NET Website Programming Problem-Design-Solution 1 September 3rd, 2004 11:39 AM
Cannot make my IIS work w_erik BOOK: Beginning ASP.NET 1.0 2 May 11th, 2004 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.