The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-03-2008, 06:04 AM
What's Jailbreak?
 
Join Date: Dec 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Password Protection for Apache

I'm using Apache on my iPhone to serve personal files, such a bank account numbers and what not. While I understand that it's fairly unlikely that someone will connect to my iPhone is a web browser, I would feel much more comfortable having the files in a password protected directory. I've tried using .htaccess to password protect files and directories, but Apache seems to ignore .htaccess. Is there any simple way to use .htaccess for password protection on the iPhone?

Josh.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 01-03-2008, 11:43 AM
iPhoneaholic
 
Join Date: Sep 2007
Device + Firmware: iPhone 3GS, 3G & 2G
Operating System: OSX 10.5.x & Windows XP
Posts: 363
Thanks: 14
Thanked 63 Times in 52 Posts

Josh, it's definitely possible, and IMO, a good idea, especially if you're on a public network.

I use lightpd, and while I found a lot of info on doing this with Apache, and had to work pretty hard to figure out how to do it with Lighttpd. I ended up writing instructions for myself only for that, but the general principles involved should help you do it with Apache.

Lighttpd was missing the command htpasswd, so I ended up installing Apache temporarily, just to copy that file. You'll already have it so just:

- SSH in as root from your computer.
- htpasswd -c /usr/local/etc/apache-htpasswd.user [username]
- you'll be prompted for a password, and then to confirm it.

- Now the password file is there.

Now add something like this to the apache.conf file:

auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/usr/local/etc/apache-htpasswd.user"
auth.require = ( "/ProtectedDocs/" =>
(
"method" => "basic",
"realm" => "Documents",
"require" => "user=yourusername"
),
"/AnotherDir" =>
(
"method" => "basic",
"realm" => "Documents",
"require" => "user=yourusername"
)
)


Then, of course, you need to restart the server so it will use the new configuration.

The basic elements are:

- Create the password (in a directory not available to the server)
- Add the instructions to your configuration file to use the password, where it is stored, and which directories to protect.

This is working great for me, but I don't claim to have much knowledge about it beyond what I've described. As I say, I pieced it together from the Apache info I found. If you do a search on "Apache" "htpasswd" you should find several step by step instructions.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 01-03-2008, 03:49 PM
What's Jailbreak?
 
Join Date: Dec 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts

Where do I find the apache.conf file?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 01-03-2008, 04:08 PM
iPhoneaholic
 
Join Date: Sep 2007
Device + Firmware: iPhone 3GS, 3G & 2G
Operating System: OSX 10.5.x & Windows XP
Posts: 363
Thanks: 14
Thanked 63 Times in 52 Posts

Sorry, I believe it's actually called httpd.conf and is located here:

/ etc / httpd / httpd.conf

but I only used Apache for a very short time before switching to lighttpd, so I could be wrong

Here's a link to one of the many Apache guides I used to figure it out for lighttpd:

http://macosx.com/forums/howto-faqs/...e-folders.html

Last edited by DaveiPhone; 01-03-2008 at 04:14 PM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
The Following User Says Thank You to DaveiPhone For This Useful Post:
joshuatw (01-03-2008)
  #5  
Old 01-03-2008, 06:49 PM
What's Jailbreak?
 
Join Date: Dec 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts

That was the correct file. Thanks for the link, it was very helpful.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion

Thread Tools
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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 07:15 AM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top