Part II Web Site Administration in VS .NET

Encoder PDF-417 2d barcode in VS .NET Part II Web Site Administration
Part II Web Site Administration
PDF-417 2d Barcode Reader In .NET
Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in Visual Studio .NET applications.
Authenticating Users Via the mod_auth Module
PDF 417 Drawer In VS .NET
Using Barcode maker for VS .NET Control to generate, create PDF417 image in VS .NET applications.
The mod_auth module is Apache s default authentication module This module enables you to authenticate users whose credentials are stored in text files Typically a text file containing a username and encrypted password is used You can also use a text file to create user groups, which can be used to create authorization rules (discussed later in this chapter) It is recommended that you use mod_auth-based authentication for small numbers of users Often when a text file reaches even just a few thousand usernames, lookup performance drops dramatically So, if you have a very large user base, using this module is not recommended However, this module is perfect for a few hundred users or so You can use /usr/local/apache/bin/httpd -l to verify whether this module is already compiled into your Apache binary If not, you have to use the --enablemodule=auth option with the configure script, and recompile and reinstall your Apache distribution
Decoding PDF 417 In .NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
Understanding the mod_auth directives
Bar Code Drawer In .NET
Using Barcode creation for .NET Control to generate, create bar code image in VS .NET applications.
The mod_auth module offers the Apache directives AuthUserFile, AuthGroupFile, and AuthAuthoritative Let s look at these directives and some examples that use this module
Decoding Bar Code In .NET Framework
Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET framework applications.
AuthUserFile directive
Generating PDF-417 2d Barcode In C#
Using Barcode creator for .NET framework Control to generate, create PDF 417 image in Visual Studio .NET applications.
This directive sets the name of the text file that contains the usernames and passwords used in the basic HTTP authentication This directive requires that you provide a fully qualified path to the file to be used Syntax: AuthUserFile filename Context: Directory, per-directory access control file (htaccess) Override: AuthConfig For example, the following directive sets /www/mobidac/secrets/htpasswd as the username and password file:
PDF 417 Drawer In VS .NET
Using Barcode generation for ASP.NET Control to generate, create PDF 417 image in ASP.NET applications.
AuthUserFile /www/mobidac/secrets/htpasswd
PDF 417 Creation In VB.NET
Using Barcode encoder for .NET framework Control to generate, create PDF 417 image in Visual Studio .NET applications.
The username and password file is usually created using a utility called htpasswd, which is available as a support program in the standard Apache distribution The format of this file is very simple Each line contains a single username and an encrypted password The password is encrypted using the standard crypt() function
Creating Code 3/9 In .NET
Using Barcode maker for .NET framework Control to generate, create Code 39 Full ASCII image in .NET applications.
7 Authenticating and Authorizing Web Site Visitors
Bar Code Creation In VS .NET
Using Barcode drawer for .NET Control to generate, create barcode image in Visual Studio .NET applications.
Caution
Bar Code Generation In .NET
Using Barcode printer for VS .NET Control to generate, create barcode image in .NET framework applications.
It is important that the AuthUserFile-specified file resides outside the document tree of the Web site Putting it inside a Web-accessible directory might enable someone to download it
Drawing ANSI/AIM I-2/5 In .NET
Using Barcode generation for Visual Studio .NET Control to generate, create USS ITF 2/5 image in VS .NET applications.
AuthGroupFile directive
Code 39 Extended Recognizer In VS .NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
This directive specifies a text file to be used as the list of user groups for Basic HTTP authentication The filename is the absolute path to the group file You can create this file using any text editor Syntax: AuthGroupFile filename Context: Directory, per-directory access control file (htaccess) Override: AuthConfig The format of this file is:
Code 3/9 Maker In C#
Using Barcode creator for .NET framework Control to generate, create Code 3/9 image in VS .NET applications.
groupname: username username username []
Paint Code128 In Visual Basic .NET
Using Barcode printer for .NET Control to generate, create Code 128B image in .NET framework applications.
For example:
GTIN - 12 Drawer In Visual Studio .NET
Using Barcode generation for ASP.NET Control to generate, create GTIN - 12 image in ASP.NET applications.
startrek: kirk spock picard data
EAN128 Creation In Visual Basic .NET
Using Barcode creator for .NET Control to generate, create UCC - 12 image in .NET applications.
This creates a group called startrek, which has four users: kirk, spock, picard, and data The Caution icon in the previous section also applies to this directive
Create EAN13 In .NET
Using Barcode creation for ASP.NET Control to generate, create EAN13 image in ASP.NET applications.
AuthAuthoritative directive
Draw Bar Code In VB.NET
Using Barcode generation for Visual Studio .NET Control to generate, create bar code image in VS .NET applications.
If you are using more than one authentication scheme for the same directory, you can set this directive to off so that when a username/password pair fails with the first scheme, it is passed on to the next (lower) level Syntax: AuthAuthoritative On | Off Default: AuthAuthoritative On Context: Directory, per-directory access control file (htaccess) Override: AuthConfig For example, if you are using mod_auth_mysql (discussed later in this chapter) and the standard mod_auth module to provide authentication services, and a username/ password pair fails for one of them, the next module is used to authenticate the user, if possible When a user name/password pair fails all modules, the server reissues a 401 status header and sends the WWW-Authenticate response header for reauthentication However, if a particular module successfully authenticates a username/password pair, the lower-level modules never receive the username/ password pair It is recommended that you leave the default value as-is because you should not design a trickle-down authentication scheme in which a user may fail one and pass another
Bar Code Scanner In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
Part II Web Site Administration
Creating a members-only section in your Web site
By using the mod_auth directives you can create a members-only section on your Web site that requires username/password-based authentication For example, let s say that you want to create a members-only section called http:// your_server_name/memberonly Here is how to do it 1 Determine which physical directory you want to restrict access to Most people use a directory within the DocumentRoot-specified directory but you can use whatever directory you want as long as the Apache user (set by User directive) is allowed to read the contents of the directory Here, I assume that your DocumentRoot is set to /www/mysite/htdocs and that you want to restrict access to a directory named /www/mysite/htdocs/memberonly 2 Modify the httpdconf file to create a new alias called /memberonly/ as shown below:
Alias /memberonly/ /www/mysite/htdocs/memberonly/
3 Next add the following directives to the httpdconf file to setup /memberonly/ as a restricted section that requires user authentication
<Location /memberonly/> AuthName Member-Only Access AuthType Basic AuthUserFile /www/secrets/members require valid-user </Location>
Here the AuthName directive simply creates a label that is displayed by the Web browsers to the users This label should be something meaningful so that the user knows what is being requested Make sure you use double-quotes as shown above The AuthType is always set to Basic because HTTP only supports Basic authentication by default The AuthUserFile points to a password file called members The Require directive states that only valid users are allowed access 4 Now, use the htpasswd utility to create a password file Assuming you have installed Apache in /usr/local/apache, the htpasswd command should be run as follows only for the first time: