Solved

Managing .htaccess

Posted on 2011-03-05
14
488 Views
Last Modified: 2012-05-11
Can anyone recommend a good web/php front end for managing .htaccess and .htapasswd files? I would be willing to pay a licence fee.
0
Comment
Question by:cescentman
  • 6
  • 5
  • 3
14 Comments
 
LVL 12

Expert Comment

by:Amick
Comment Utility
DirectoryPass is an open source program that probably will do what you want.
http://www.directorypass.com/
0
 
LVL 12

Accepted Solution

by:
Amick earned 125 total points
Comment Utility
Here are some additional options: http://sourceforge.net/search/?q=.htaccess+management
0
 
LVL 1

Author Comment

by:cescentman
Comment Utility
Thanks for the replies. Have you any experience of these programs. I have already seen them in searches I have done. I'm looking to recommendations.
0
 

Expert Comment

by:PeggyOCO
Comment Utility
There are a number of these .htaccess and .htpasswd generators online that are very handy to use, but you need to know what it is you are making, and where to put the files.  Here is a nice one I have used before: http://www.htaccesseditor.com/en.shtml#a_basic
That link takes you to the Basic Access .htaccess and .htpasswd page.  But what is it exactly that you are making?  And what do you do with it once you have made it?  Here's what I do.  I am presuming you want to restrict access to a folder on your website so that the visitor has to put in a username and a password in order to see what is inside the folder.  First, inside the folder you wish to protect, create a file named htaccess, WITHOUT the dot in front of it!  Then create a file named htpasswd, also without the dot in front of it.  The reason for doing this is because once you put the dot in front of the name of the file, that file becomes a hidden file, and some ftp programs don't allow you to see these files.  So you want to be able to put some code in these files, before you put the dot in front of the name.
So, go to the Basic Authentication at the website url I pasted earlier, and the first thing you are going to do is prepare your htpasswd.  For instance, I put in admin for the username, and secret for the password.  The form then filled in this:  admin:6ge9bh2S2rdNQ   This is what you copy and paste into the htpasswd file you made on your website.  Then the form asks you for the path to your .htpasswd file.  This has to be the FULL PATH.  Usually, in your FTP program you can see the full path to the directory where your .htpasswd file is going to be kept.  You can put it anywhere you wish.   Once you put in the full path, this generator creates all the code that has to go into your htaccess file.  I just did it and I'm pasting it in here:
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
AuthUserFile /home/yourdomain/yourfolder/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
order deny,allow

Yours will be different, but it will look like this.  Paste all of this code into your htaccess file.  
Now you have pasted in all the right stuff to both your htaccess file and your htpasswd file.  Once you are done, change the name of htaccess to .htaccess  That is, put a dot in front of the name htaccess. Do the same for htpasswd.  Change the name of htpasswd to .htpasswd  Depending on your ftp program settings, these files might disappear from view (because of the dot) but don't worry, they are there.  Then, with a web browser, go to the folder you just protected and you should see a little box pop up that asks you for your user/pass.
0
 
LVL 1

Author Comment

by:cescentman
Comment Utility
PeggyOCO thanks for the info. I am in fact after a web interface to give to users so they can manage their access without generating the .htaccess and .htpasswd files manually. I agree there are a number of solutions around hence me seeking recommendations in the hope that I can shorten the list of candidates to check out.
0
 

Expert Comment

by:PeggyOCO
Comment Utility
Oh, I see.  I misunderstood the question then.  Sounds to me like you need a program to run on your server that will allow your users to create their .htaccess and .htpasswd files without them having to ftp anything up or do anything other than just fill out a form.  The program would have to write the files and put them in the right place.  Are you using php on your webserver?
0
 
LVL 1

Author Comment

by:cescentman
Comment Utility
Yes PHP
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:PeggyOCO
Comment Utility
0
 

Expert Comment

by:PeggyOCO
Comment Utility
I just uploaded a zip file (above).This is a highly rated class from phpclasses.org which contains the methods for managing htaccess files. A php program could be written fairly easily using this class.
0
 

Expert Comment

by:PeggyOCO
Comment Utility
Here's another possiblity.  WebMin is a very good open source control panel.  Along with it you get Usermin.  Usermin allows the users to manage their stuff -- among the things they can manage is htaccess files.  I've supplied Usermin for some clients and the response was good.  Usermin is pretty easy to use.  Webmin, for the administrator, is more complex, however, more powerful than CPanel.
0
 
LVL 1

Author Comment

by:cescentman
Comment Utility
Thanks for the suggestions. Webmin is definitely out as it is too complex. I merely need a way to manage .htaccess files. As I said I am looking for a front end. I could code but wanted to know if anyone had experience of any of the offerings online.
0
 
LVL 12

Expert Comment

by:Amick
Comment Utility
Directorypass is easy to install and easy to use.  It is definitely valuable for quickly adding protection to a directory and managing users by directory.

Although it is highly reviewed on the net and well thought of by sysadmins,  it is a perl cgi script, and some people have an aversion to that.  If that isn't a deal-breaker for you, though, it couldn't hurt to give it a try.
0
 
LVL 1

Author Comment

by:cescentman
Comment Utility
I was unable to get online this morning to update this question due the maintaneace on EEX. In the absence of recommendations I decided on a product called htprotector on Sourceforge. I did in fact look at DirectoryPass too. Nothing against Perl but it turns out it is awkward to set up if you want to protect the program itself with basic authentication as some severs are configured not to allow .htaccess in the cgi-bin folder..
0
 
LVL 1

Author Closing Comment

by:cescentman
Comment Utility
My request was for recommendations
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now