Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | 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 June 8th, 2004, 09:52 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
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 ;)
Reply With Quote
  #2 (permalink)  
Old June 9th, 2004, 11:55 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

htpasswd -c users james


Reply With Quote
  #3 (permalink)  
Old June 11th, 2004, 12:50 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
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 ;)
Reply With Quote
  #4 (permalink)  
Old June 12th, 2004, 12:36 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
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.

Reply With Quote
  #5 (permalink)  
Old June 14th, 2004, 09:17 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
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)

Reply With Quote
  #6 (permalink)  
Old June 14th, 2004, 10:05 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #7 (permalink)  
Old June 15th, 2004, 08:01 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
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.
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
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



All times are GMT -4. The time now is 03:05 PM.


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