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 June 8th, 2004, 09:52 PM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chp 11 - Creating htaccess

This is found in Chp 11 p319. Creating htaccess and htpasswd files.

In DOS prompt, I typed C:\Program Files\Apache Group\Apache2\bin>
htpasswd users james
The message returned: Automatically using MD5 format.
htpasswd: cannot modify file users; use '-c' to create it

Does anyone encounter this problem and how to solve it?

Thanks ;)
 
Old June 9th, 2004, 11:55 AM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using the -c command line switch, like so:

htpasswd -c users james


 
Old June 11th, 2004, 12:50 PM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks! It works.

However, my attempt to use htaccess does not work as intended.

I created a htaccess file, labeled it as "a.htaccess" (It has to have a name, right?)

The content of the file is as follows:

AuthType Basic
AuthUserFile c:\website\test
AuthName "Restricted"
<LIMIT GET POST>
require valid-user
</LIMIT>

So where does it go wrong? Please help! Thanks ;)
 
Old June 12th, 2004, 12:36 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem. Windows does not seem to allow you to create a file called ".htaccess". I still don not know how to work around it.

 
Old June 14th, 2004, 09:17 AM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't remember off the top of my head the limitations Windows places on file names on creation... but you *can* rename that file to .htaccess... as follows:

Open a Command Prompt/DOS Window
Go to the directory with your a.htaccess (or whatever) file
issue the following command: ren a.htaccess ".htaccess"

The file should then be renamed properly. (Worked on XP, should work in 2k, unsure about anything previous)

 
Old June 14th, 2004, 10:05 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yap, it worked.
Thanks
Christian
Note: Can't overstimate the power of DOS

 
Old June 15th, 2004, 08:01 AM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It should also be noted, using quotes works in windows dialog boxes as well. When saving your file for the first time in your editor of choice, just put quotes around the filename ( ".htaccess" ) and it should work fine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Media Player 11 Object in Access VBA LouG Access VBA 12 October 20th, 2008 10:12 AM
Ch 11 creating a user reg script ed123 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 September 28th, 2007 11:36 AM
**UPDATE** CH 12 Creating htaccess and htpasswd TheDudeTux BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 April 8th, 2007 08:17 PM
Chp.11 CodeCompileUnit.ReferencedAssemblies studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 2 February 20th, 2007 06:24 PM
Chp 11: Database entry problem jamcp34 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 August 10th, 2004 11:11 AM





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