Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
password protection for certain pages
Old 08-15-2008, 05:56 AM password protection for certain pages
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
I don't know if this is the right forum. Forgive me if it isn't.

I'm currently building a website for my employer because she has been getting ripped off by the people who are currently handling it. There isn't anyone else around so we need to know how to do this ourselves. The problem is that I'm learning on the job.

Part of the site needs to be password protected. People will register first and then be able to enter the protected area with their email after registering.

Is there any particular software or service that you recommend for this?
missingtime is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-15-2008, 06:24 AM Re: password protection for certain pages
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
You can use apache basic auth to limit access to certain files and folders. Your registration script will have to manage the .htpasswd file which has rather simple format. Authorization process will be totally handled by apache, you will only have to implement adding new users and changing passwords for exisiting ones.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-15-2008, 06:49 AM Re: password protection for certain pages
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
You are lucky.
I was stumble-upon'ing, and just landed on that page
http://www.mtdev.com/2002/07/creatin...p-login-script
while your post was open.

I did not read it entirely, but it seems to approach it from a beginner and easy pov.
Just read it already, and ask if you need clarifications.
It's not a copy/paste login/register script, but it explains you how and what is needed to build one.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-25-2008, 05:38 PM Re: password protection for certain pages
Junior Talker

Posts: 1
Trades: 0
Hi

You can password protect a directory easily as follows. Let us consider we need to password protect the directory /home/username/public_html/sample

1) Change directory to /home/username/public_html/sample using cd command
cd /home/username/public_html/sample

2) Create .htaccess file
touch .htaccess [if it is already there you can use it no need to create one]

3) Add the following line to the .htaccess file

AuthUserFile /home/username/public_html/sample/.htpasswd
AuthName "Title for Protected Site"
AuthType Basic
Require valid-user


4) Create .htpasswd file in the same directory as .htaccess
touch .htpasswd

5) Create the password file using the following command.

htpasswd -c .htpasswd username
New password:
Re-type new password:
Adding password for user username

That's it you are done!!

<link drop removed >

Last edited by chrishirst; 08-26-2008 at 11:01 AM..
pratheesh is offline
Reply With Quote
View Public Profile
 
Old 09-09-2008, 07:18 AM Re: password protection for certain pages
Junior Talker

Posts: 4
Trades: 0
I don't think that web server authentication is the best solution for your needs.
Are you using a database for your system? If you are planing lot of users, then storing user information in files will be slow. At least use a db backend for your web server authentication if you choose to go this way.
there are apache modules for different db's - postgre, mysql etc. for example mod_auth_pgsql
active44 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to password protection for certain pages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34569 seconds with 12 queries