Page 1 of 1

Login to protect prototype

Posted: Tue Jan 22, 2008 4:56 pm
by arpowers
this might be a newbie question but...

I'm uploading the prototype version of a project I'm working on to our server.. what is the best way to make sure the public can't get access to the page?

Thanks!

Re: Login to protect prototype

Posted: Tue Jan 22, 2008 6:46 pm
by Christopher
Most webservers will allow you to password protect a directory. What type of webserver is it?

Re: Login to protect prototype

Posted: Wed Jan 23, 2008 10:40 am
by arpowers
I am using apache on a linux machine...

Re: Login to protect prototype

Posted: Wed Jan 23, 2008 11:28 am
by Zoxive
#1 Go to the Directory of the Site

#2 Make the .htpasswd file
Run the following

Code: Select all

htpasswd -bc .htpasswd username password
If you can't ssh to your server, you would be able to make this on any server, and then copy the file over.
OR simply do the following in the .htpasswd file.

Code: Select all

username:XO5UAT7ceqPvc
The Password (After the colon) is the same as the output of the Crypt() command in php.

#3 Create .htaccess File (Same directory)

Code: Select all

AuthType Basic 
AuthUserFile /path/to/the/.htpasswd 
AuthName "Protected Area" 
require valid-user

Re: Login to protect prototype

Posted: Wed Jan 23, 2008 11:52 am
by arpowers
Thanks for the help...!

Guess its time to learn apache!

Re: Login to protect prototype

Posted: Wed Jan 23, 2008 12:22 pm
by VladSun
Also, if you access it with permanent IP you can add the following lines:

Code: Select all

 
Order Allow,Deny
Allow from Your_IP_Here
Satisfy Any
 
and it won't ask you for password when accessing it from Your_IP_Here :)