Results 1 to 13 of 13

Thread: password protection

  1. #1
    Registered
    Join Date
    Nov 2003
    Posts
    25

    password protection

    With the help of this site I have developed my company's website. (http://www.corrosionlab.com)
    I now would like to add a subweb that is password protected. The subweb will have multiple user access and must be secure.

    Any suggestions for software or if it is possible for me to do.

  2. #2
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    You could do it with .htaccess to protect a directory. Or you could use a scripting language like PHP and a database to store the passwords.

    .htaccess is probably easier if you don't have any experience with PHP. You just edit it like a normal text file.

  3. #3
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Sometime your host will have a control panel that automates the .htaccess password protecting process.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  4. #4
    Registered
    Join Date
    Nov 2003
    Posts
    25
    Thanks for the tip but I might need the protected files to be encrypted. I don't think htaccess does this.
    Is there way to do encryption another way?

  5. #5
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    How are you going to view the encrypted files?

    There is such a thing as an encrypted connection, that may be what you're looking for.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  6. #6
    Registered
    Join Date
    Nov 2003
    Posts
    25
    Sorry, I did mean an encrypted connection.

  7. #7
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You need an SSL certificate (try instantssl.com). A hosting account that can support SSL as well.

    This will encrypt the data between your server and the client's computer. This is not password protection.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  8. #8
    Registered
    Join Date
    Nov 2003
    Posts
    25
    thanks

  9. #9
    Registered
    Join Date
    Nov 2003
    Posts
    67
    If you are using apache, here is how to password protect your directory:

    1. Place the following code in your virtual server (in the apache.conf file):

    <Directory /home/mysite/htdocs/protectedDir>
    AllowOverride All
    order allow,deny
    allow from all
    </Directory>

    2. Create the .htaccess file in the directory which will be protected (or in other more secure location). Enter the following:


    order allow,deny
    allow from all
    require valid-user
    Authname DirectoryName
    Authtype Basic
    AuthUserFile /full_path/htpasswd_file


    3. Creating a new htpasswd file.

    $ /usr/sbin/htpasswd -c htpasswd_file username


    It will prompt you for the password twice.
    The "-c" option creates a new file. Enter the command without this option to only add a user to an existing file.


    Then restart apache with the follow command: service httpd restart

  10. #10
    Registered
    Join Date
    Nov 2003
    Posts
    25
    Is this protected directory setup correctly?

    http://www.corrosionlab.com/Restricted/restrict.htm

  11. #11
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    I can't access it. So long as the username and password works I'd say yes.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  12. #12
    Registered
    Join Date
    Nov 2003
    Posts
    25
    Can robots still spider the protected directory?

  13. #13
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    No
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •