Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5     Rate this Document

How to Setup Security for the G Server?

Primary Software: LabVIEW Toolkits>>Internet Developers Toolkit
Primary Software Version: 6.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
How do I set up security for the G Server?


Solution:
To password protect a directory several files are needed. Below is a description of how to create each file and the purpose of the file.
  1. User File
    The security provided by the htaccess.txt file allows either group level or user level security or a combination of the two. The user file lists the users of the protected folder and (or) documents.

    To create a user file:

    1. Open LabVIEW.
    2. Select Tools->Internet Toolkit->G Web Server Configuration.
    3. Click the Advanced Tab.
    4. Select Access Configuration.
    5. Select New Directory. Name the Directory.
    6. Select Authorization.
    7. Select Edit User (pencil under AuthUserFile).
    8. Click Cancel on the Open File Prompt.
    9. Select Add User and enter the User Name and Password. Repeat as necessary.
    10. Click Save and save the file as pwd.txt.


  2. Group File (Optional)
  3. This file places the users into groups. If you are planning to change the users that can access the website regularly, a group file can save much time, because a person can update the group file instead of each htaccess file.

    To create a group file:

    1. Open a new Text Document.

    2. Enter users in groups in the following format:
      group1:user1 user2 user3
      group2:user4 user5 user6

    3. Save the file as grp.txt.


  4. Htaccess File
  5. The htaccess file is used to point the server to files and to restrict access to files and folders.

    To create a htaccess file:

    1. Open a new Text Document.

    2. Place the following text into the file (You will need to modify the items in italics):
      AuthName Name
      AuthUserFile pwd.txt
      AuthGroupFile grp.txt

    3. <Limit GET POST>
      require group name
      require user name
      require user name
      </Limit>

    4. Save this file as htaccess.txt and place it in the folder you wish to protect.


    AuthName is the text description that will be displayed in the login screen when a user tries to access the directory. This can be any text you would like display on the login screen. The require statements (either group or user name) will limit access such that only listed groups or users may access that directory after successful login.

    The htaccess.txt file now points the server to pwd.txt and grp.txt. For this to work correctly pwd.txt and grp.txt must be in the same folder as the htaccess.txt file you just created. This, however, could allow users to view the pwd.txt and grp.txt files. It is recommended that you place these files in a subdirectory. Then use name/grp.txt and name/pwd.txt in the htaccess file so the files are properly referenced. Now you may add an additional htaccess file in the name folder, which will further restrict access to these files.

    Note:

    1. Once a htaccess file is placed in a folder all the subdirectories are protected with the same htaccess file. The AuthUserFile and AuthGroupFile do not need to be defined again if they are already defined in the parent directory, unless you would like to further restrict access to subdirectories.

    2. In the htaccess file, you may limit GET and/or POST actions.


Related Links: Protecting Content With .htaccess Files

Attachments:





Report Date: 11/24/2004
Last Updated: 12/30/2005
Document ID: 3FNERTVB

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit