Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 31st, 2004, 11:13 AM
Registered User
 
Join Date: Sep 2003
Location: Troy, MI, USA.
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
Reply With Quote
  #2 (permalink)  
Old December 31st, 2004, 03:27 PM
Authorized User
 
Join Date: Dec 2004
Location: , , .
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

Reply With Quote
  #3 (permalink)  
Old January 3rd, 2005, 12:36 PM
Registered User
 
Join Date: Sep 2003
Location: Troy, MI, USA.
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
Reply With Quote
  #4 (permalink)  
Old April 17th, 2011, 02:31 PM
Authorized User
Points: 45, Level: 1
Points: 45, Level: 1 Points: 45, Level: 1 Points: 45, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.