This Season
 

How to Create a Login Web Page

A web page requesting a login appears when your web browser hits a directory on a web server that is password protected. The web manager for the site sets up usernames and passwords for the directory with a web site management tool, sometimes referred to as a web control panel, or by creating a file called .htaccess, which lists the authorized users.

Related Searches:
    Difficulty:
    Moderate

    Instructions

    Things You'll Need

    • Web hosting account
    • Web server management control panel (optional)
    1. Create Login with a Web Control Panel

      • 1
        cPanel X Window

        Navigate with your web browser to your web hosting account and log in to access your control panel. The example shown here is the cPanel X web site management tool.

      • 2

        Click the icon for "Password Protect Directories."

      • 3
        Web Directory List

        Locate the folder (directory) you want to password protect. Click on a "folder ICON " to go into that folder, click on folder "NAME" to select it as the one to protect.

      • 4
        Set Password Window

        Click the "check box" at the top to turn protection on, then enter a username and password on the set password screen, and click add/modify authorized user. You can also use this screen to change the password of an existing user or delete a user. Existing users are listed in the order they were added. The list is not alphabetical.

      • 5
        Web Login

        Exit your web host account and navigate to a web page in the directory with the password protection. A login box will prompt you for a username and password.

      • 6
        Password Failed

        Enter the appropriate username and password combination, then click "OK." If the login is correct you will have access to the page. If the login is wrong, you will receive an Authorization Required error page.

      Create Login with an .htaccess File

      • 1

        Log in to your web hosting account and access the command line level for your web server. This method is only recommended if you understand how to work on your sever at the system level and are familiar with UNIX commands.

      • 2

        Change directories into the folder you want to protect and create a text file there called .htaccess.

      • 3
        .htaccess code

        Enter the code you see in this figure, substituting the directory path highlighted in yellow with the path to your protected directory (remember the path starts at the root (/) level of your web server) and the username needed to access that directory.

      • 4

        Save the .htaccess file, then at the system prompt from your web server, enter the command: htpasswd -c .htpasswd username, where "username" is the username you put in the .htaccess file. The server will prompt you for a password for this username twice (to verify you entered it correctly).

      • 5

        Enter the password and press Enter/Return. This command creates an encrypted file called .htpasswd in the protected directory that contains the username and password combination you just entered.

      • 6

        Adjust the access privileges for the two files you just created by entering these two commands at the system prompt: chmod 755 .htpasswd, and chmod 755 .htaccess .

      • 7

        User your web browser to test the login.

    Tips & Warnings

    • Decide on a standard format for the usernames and passwords on your site, especially if you have a large organization. Inevitably someone will forget how to log in and having a standard set of log in instructions to send out will make troubleshooting easier. If you have a choice between using a web server control panel or creating an .htaccess file for password protection, use the control panel. Basically, the control panel is doing the same thing, but the technical aspects of editing the file are done behind the scenes, and it's easier to add multiple users and update passwords with the control panel.

    • If you decide to go with a shared password instead of individual passwords, be sure to change it at least every six months. Don't attempt the .htaccess method unless you have some familiarity with a UNIX environment and using UNIX commands. Typing the wrong command at the system prompt could have a negative effect your web server.

    Related Searches

    Resources

    Read Next:

    Comments

    You May Also Like

    Follow eHow

    Related Ads