Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

  • Be the first to comment

  • Be the first to like this


  1. 1. Understanding Apache 2.2 Configuration <ul><ul><li>Brad Nicholes </li></ul></ul><ul><ul><li>Senior Software Engineer, Novell Inc. </li></ul></ul><ul><ul><li>Member, Apache Software Foundation </li></ul></ul><ul><ul><li>[email_address] </li></ul></ul>
  2. 2. Agenda <ul><li>Apache 2.2 Status </li></ul><ul><li>Multi-Processing Modules </li></ul><ul><li>Common Configuration Directives </li></ul><ul><li>Tips and Tricks </li></ul><ul><li>Authentication & Authorization </li></ul><ul><li>What’s new in Apache 2.3 </li></ul>
  3. 3. Apache Web Server Status <ul><li>Shipping: </li></ul><ul><ul><li>Apache 1.3.37 – Maintenance mode, no new development </li></ul></ul><ul><ul><li>Apache 2.0.59 – Maintenance mode, no new development </li></ul></ul><ul><ul><li>Apache 2.2.4 – Current release </li></ul></ul><ul><li>Development: </li></ul><ul><ul><li>Apache 2.2.5-dev – Stable </li></ul></ul><ul><ul><li>Apache 2.3.x-dev – Unstable, all new development happens here first </li></ul></ul>
  4. 4. Apache 2.2 for NetWare <ul><li>Apache 1.3 ported to NetWare in 2000 </li></ul><ul><li>All current versions of Apache including 2.2.x and 2.3.x are fully functional on the NetWare platform </li></ul><ul><li>Apache 2.0 became generally available on NetWare 6.5 </li></ul><ul><li>New releases are available from the Apache HTTP project download site: / </li></ul><ul><li>Installed by default on SYS:/Apache2 </li></ul>
  5. 5. Apache 2.2 on SuSE Linux <ul><li>File Locations </li></ul><ul><ul><li>Modules - /usr/lib/apache2 </li></ul></ul><ul><ul><li>Configuration - /etc/apache2 </li></ul></ul><ul><ul><li>Logs - /var/log/apache2 </li></ul></ul><ul><ul><li>Cgi-bin - /srv/www/cgi-bin </li></ul></ul><ul><ul><li>DocumentRoot - /srv/www/htdocs </li></ul></ul><ul><ul><li>Binary - /usr/sbin/httpd2 (symlink to actual binary) </li></ul></ul><ul><ul><ul><li>/usr/sbin/httpd2-worker </li></ul></ul></ul><ul><ul><ul><li>/usr/sbin/httpd2-prefork </li></ul></ul></ul><ul><ul><li>Other support binaries - /usr/sbin </li></ul></ul><ul><ul><li>Startup script – /usr/sbin/rcapache2 </li></ul></ul><ul><ul><ul><li>Symlink to /etc/init.d/apache2 </li></ul></ul></ul>
  6. 6. Multi-Processing Modules <ul><li>Accommodate a wide variety of operating environments on different platforms </li></ul><ul><li>Responsible for: </li></ul><ul><ul><li>Binding to network ports </li></ul></ul><ul><ul><li>Accepting requests </li></ul></ul><ul><ul><li>Dispatching worker threads to handle requests </li></ul></ul><ul><li>Allows customization for particular sites </li></ul><ul><ul><li>Scalability in a threaded environment – Worker MPM </li></ul></ul><ul><ul><li>Compatibility with older modules – Prefork MPM </li></ul></ul><ul><ul><li>Platform custom – NetWare MPM, WinNT MPM </li></ul></ul>
  7. 7. Worker MPM <ul><li>Combines multi-process and multi-threaded models </li></ul><ul><ul><li>Variable number of processes (parents) </li></ul></ul><ul><ul><li>Fixed number of threads </li></ul></ul><ul><li>Each child process handles many concurrent connections </li></ul><ul><li>Stability of multiple processes </li></ul><ul><li>Performance of multiple threads </li></ul><ul><li>Reduces the memory footprint </li></ul>
  8. 8. Multi-Processing Modules <ul><li>Worker MPM - Multi-Processing Module implementing a hybrid multi-threaded / multi-process web server </li></ul><ul><ul><li>StartServers - Number of child server processes created at startup </li></ul></ul><ul><ul><li>MinSpareThreads - Minimum number of idle threads allowed before additional worker threads are created </li></ul></ul><ul><ul><li>MaxSpareThreads - Maximum number of idle threads allowed before excess worker threads are destroyed </li></ul></ul><ul><ul><li>MaxClients - Maximum number of worker threads allowed </li></ul></ul><ul><ul><li>MaxMemFree - Maximum amount of memory that the main allocator is allowed to hold without calling free() </li></ul></ul><ul><ul><li>ThreadsPerChild - Number of threads created by each child process </li></ul></ul><ul><li> </li></ul>
  9. 9. Prefork MPM <ul><li>Stable but slower (based on documentation) </li></ul><ul><li>One parent (master server) </li></ul><ul><ul><li>many children (workers) </li></ul></ul><ul><li>Each child server is a process itself </li></ul><ul><li>Each child handles one connection at a time </li></ul><ul><li>Uses more memory </li></ul><ul><li>Similar to the NetWare MPM but using processes instead of threads </li></ul>
  10. 10. Multi-Processing Modules <ul><li>Prefork MPM - Implements a non-threaded, pre-forking web server </li></ul><ul><ul><li>StartServers - Number of child server processes created at startup </li></ul></ul><ul><ul><li>MinSpareServers - Minimum number of idle child server processes </li></ul></ul><ul><ul><li>MaxSpareServers - Maximum number of idle child server processes </li></ul></ul><ul><ul><li>MaxClients - Maximum number of child processes that will be created to serve requests </li></ul></ul><ul><ul><li>MaxMemFree - Maximum amount of memory that the main allocator is allowed to hold without calling free() </li></ul></ul><ul><li> </li></ul>
  11. 11. Reading the Documentation <ul><li>Online: </li></ul><ul><li>Also installed with every instance of Apache </li></ul><ul><li>Most directives consist of a name and a single value </li></ul><ul><ul><li>Some directives may have multiple, optional or boolean values </li></ul></ul><ul><li>Example directive: </li></ul>
  12. 12. Configuration File Syntax <ul><li>The default HTTPD.conf file contains a very good explanation of each directive that is used and why </li></ul><ul><li>The directives are not ordered </li></ul><ul><li>The configuration file contains one directive per line but the “” may be used to indicate that the directive continues to the next line </li></ul><ul><li>Configuration directives are case- insensitive but some arguments may be case- sensitive </li></ul><ul><li>Lines that begin with “#” are considered to be comments </li></ul><ul><li><IfDefine> can be used to block out sections of the configuration file that are only used if a specific environment variable has been defined </li></ul>
  13. 13. HTTPD.conf Highlights <ul><li>ServerRoot – Base directory for the server installation </li></ul><ul><ul><li>All relative paths are derived from the ServerRoot </li></ul></ul><ul><ul><li>If you have multiple installations of the web server, make sure that the ServerRoot points to the respective install locations </li></ul></ul><ul><li>PidFile - File where the server records the process ID of the daemon </li></ul><ul><ul><li>If an error message occurs when starting Apache on Linux indicating that HTTPD is already running, it may be that an old file was orphaned after an abnormal shutdown (ie. Kill -9) </li></ul></ul>
  14. 14. HTTPD.conf Highlights <ul><li>Timeout – Amount of time the server will wait for send or receive events before failing a request (Default 300 seconds or 5 minutes) </li></ul><ul><ul><li>If Apache appears to hang during a shutting down on NetWare, it may be that a worker thread is waiting for data from the client. After the timeout period has expired, Apache will shutdown normally. </li></ul></ul><ul><li>KeepAlive – Enable persistent connections (ie. Avoids having to reconnect with the same client on sub-requests) </li></ul><ul><ul><li>If the connection is not properly terminated by the client, the connection will be held for the duration of the KeepAliveTimeout value. This could cause unecessary latency when responding to new requests on a busy server </li></ul></ul>
  15. 15. HTTPD.conf Highlights <ul><li>Listen – Binds Apache to a specific IP address and/or port </li></ul><ul><ul><li>If only a port is specified, Apache will listen to that port on all IP addresses assigned to the box </li></ul></ul><ul><li>LoadModule – Loads an external Apache module </li></ul><ul><ul><li><IfModule> - Should surround module specific directives to prevent invalid configuration if a module has not been loaded </li></ul></ul><ul><li>UseCanonicalName – Determines how Apache constructs self-referencing URLs (ie. Redirects) </li></ul><ul><ul><li>ServerName – Used to construct a self-referencing URL when UseCanonicalName is set to ON. Otherwise Apache uses the host name supplied by the client </li></ul></ul>
  16. 16. HTTPD.conf Highlights <ul><li>DocumentRoot – Default location from which all documents are served </li></ul><ul><ul><li>If an alias for a URI is not found, Apache will attempt to serve the page from the DocumentRoot </li></ul></ul><ul><li>Options – Configures the features that are available in a specific directory </li></ul><ul><ul><li>Indexes – Allows a directory listing </li></ul></ul><ul><ul><ul><li>AddIcon - Specifies the location and file name of the icon that should be displayed for a given file type </li></ul></ul></ul><ul><ul><li>Multiviews – Allows language negotiation </li></ul></ul><ul><ul><li>ExecCGI – Allow CGI binaries or scripts to be executed </li></ul></ul><ul><ul><li>Includes – Enables Server-Side includes or parsed HTML </li></ul></ul>
  17. 17. HTTPD.conf Highlights <ul><li>Order/Allow/Deny – Specifies access control restrictions </li></ul><ul><ul><li>The Order directive determines whether Apache should be inclusive or exclusive when applying access control </li></ul></ul><ul><ul><li>Both Allow and Deny can be used to restrict access based on full or partial IP addresses, network masks or environment variables </li></ul></ul><ul><li>DirectoryIndex – Specifies the default file name(s) to serve when no page is specifed in the request </li></ul><ul><ul><li>The file index.html.var can be used to specify additional language negotiation rules rather than an actual web page </li></ul></ul>
  18. 18. HTTPD.conf Highlights <ul><li>CustomLog – Defines the location and format of a custom log file </li></ul><ul><ul><li>When used with the LogFormat directive, the contents of the log file as well as the format can be specified </li></ul></ul><ul><ul><li>Multiple log files can be defined containing different information or layouts (Warning: specifying additional log files may hurt performance) </li></ul></ul><ul><li>Alias – Associates a URI prefix with a physical directory location </li></ul><ul><ul><li><Directory>/<Location>/<Files> - Should accompany the Alias directive to indicate how files are accessed from the aliased location </li></ul></ul>
  19. 19. HTTPD.conf Highlights <ul><li>ErrorDocument – Defines a custom or user friendly response to an HTTP error </li></ul><ul><ul><li>The response can be in plain text, local redirect or external redirect </li></ul></ul><ul><ul><li>If the response is a redirect, the language can be negotiated so that it is appropriate for the request </li></ul></ul><ul><li>BrowserMatch – Customizes the request handling for particular browsers </li></ul><ul><ul><li>Can be used to force a response to HTTP 1.0 rather than 1.1 or to turn off keepalive connections for older browsers </li></ul></ul>
  20. 20. Modularizing the Configuration <ul><li>Functional blocks of directives can be put into a separate configuration file </li></ul><ul><li>Use the “Include” directive to instruct Apache to read additional configuration files </li></ul><ul><li>If the “Include” directive specifies a directory, all files within the directory will be read as additional configuration files </li></ul><ul><li>Wildcards can be used to specify a certain set of additional configuration files (include conf/*.conf) </li></ul>
  21. 21. Virtual Hosts <ul><li>Apache supports two types of virtual hosts </li></ul><ul><ul><li>Name-based virtual host </li></ul></ul><ul><ul><ul><li>Selects a virtual host configuration based on the domain name of the request </li></ul></ul></ul><ul><ul><ul><li>Allows more that one virtual host per IP address </li></ul></ul></ul><ul><ul><li>IP-based virtual </li></ul></ul><ul><ul><ul><li>Selects a virtual host configuration based on the IP address of the request </li></ul></ul></ul><ul><ul><ul><li>Each IP address belongs to a specific virtual host </li></ul></ul></ul><ul><li>Each virtual host can be configured independently </li></ul><ul><ul><li>ServerName, DocumentRoot, Aliases, log files, etc. </li></ul></ul>
  22. 22. Name-Based Virtual Host <ul><li>NameVirtualHost *:80 </li></ul><ul><li><VirtualHost *:80> </li></ul><ul><li>ServerName </li></ul><ul><li>ServerAlias * </li></ul><ul><li>DocumentRoot /www/domain </li></ul><ul><li></VirtualHost> </li></ul><ul><li><VirtualHost *:80> </li></ul><ul><li>ServerName </li></ul><ul><li>DocumentRoot /www/otherdomain </li></ul><ul><li></VirtualHost> </li></ul><ul><li>NameVirtualHost specifies the IP address that will be shared </li></ul><ul><li>ServerAlias directive allows access to a specific virtual host by different domain names </li></ul><ul><li>Apache uses the ServerName directive to decide which virtual host configuration applies </li></ul>
  23. 23. IP-Based Virtual Host <ul><li><VirtualHost> </li></ul><ul><li>ServerAdmin </li></ul><ul><li>DocumentRoot /groups/smallco/www </li></ul><ul><li>ServerName </li></ul><ul><li>ErrorLog /groups/smallco/logs/error_log </li></ul><ul><li>CustomLog /groups/smallco/logs/access_log combined </li></ul><ul><li></VirtualHost> </li></ul><ul><li><VirtualHost> </li></ul><ul><li>ServerAdmin </li></ul><ul><li>DocumentRoot /groups/baygroup/www </li></ul><ul><li>ServerName </li></ul><ul><li>ErrorLog /groups/baygroup/logs/error_log </li></ul><ul><li>CustomLog /groups/baygroup/logs/access_log combined </li></ul><ul><li></VirtualHost> </li></ul><ul><li>Apache determines which virtual host to use based off of the IP address </li></ul><ul><li>Almost any configuration directive can be put in a virtual host block with the exception of some of the process creation directives </li></ul>
  24. 24. Language Negotiation <ul><li>A single instance of the Apache Web server can be used to serve page content in multiple languages </li></ul><ul><li>Language negotiation does not depend on the server installed language </li></ul><ul><li>The <Directory> or <Location> block must contain one of the following: </li></ul><ul><ul><li>“ Option Multiviews” to enable language file matching </li></ul></ul><ul><ul><li>“ AddHandler type-map var” to specify a type-map file that contains language definitions </li></ul></ul><ul><li>Each HTML file encoded for a different language, must append the corresponding language extention </li></ul><ul><ul><li>Example: index.html.en – English, – French </li></ul></ul>
  25. 25. Language Negotiation <ul><li>The following directives are used by the language negotiation functionality: </li></ul><ul><ul><li>- AddLanguage - DefaultLanguage </li></ul></ul><ul><ul><li>- LanguagePriority - ForceLanguagePriority </li></ul></ul><ul><ul><li>- AddDefaultCharset - AddCharset </li></ul></ul><ul><li>Each browser request contains an “accept-language” header that indicates the language(s) that the client will accept </li></ul><ul><li>The languages are usually specified by either 2 or 4 character keys (en, en-us, fr, de, es, ...) </li></ul><ul><ul><li>- AddLanguage - DefaultLanguage </li></ul></ul><ul><ul><li>- LanguagePriority - ForceLanguagePriority </li></ul></ul><ul><ul><li>- AddDefaultCharset - AddCharset </li></ul></ul>
  26. 26. How Language Negotiation Works <ul><li>Multiviews enabled negotiation </li></ul><ul><ul><li>Apache matches the “accept-language” key to a file extension through the “AddLanguage” directives in the HTTPD.conf file </li></ul></ul><ul><ul><li>Apache first searches for an exact match of the specified file </li></ul></ul><ul><ul><li>Apache next searches for the specified file with the 2 or 4 character appended language extension </li></ul></ul><ul><li>Type-Map enabled negotiation </li></ul><ul><ul><li>Apache searches for the specified file with the type-map extension (usually .var) </li></ul></ul><ul><ul><li>Apache reads the .var file and selects the file name that is associated with the appropriate language </li></ul></ul><ul><li>If a language file is not found, Apache will fallback to the LanguagePriority and ForceLanguagePriority directives to determine how to handle the request </li></ul><ul><li>More info: </li></ul><ul><ul><li> </li></ul></ul>
  27. 27. <Directory> vs. <Location> <ul><li>Directives enclosed in a <Directory> block apply to the specified file system directory and sub-directories </li></ul><ul><li>Directives enclosed in a <Location> block apply to the specified web space container </li></ul><ul><ul><li><Location /private> would apply to any URL-path that begins with “/private” </li></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><li>Able to apply directives to locations that don't physically exist such as a module handler </li></ul></ul><ul><ul><ul><li><Location /server-status> </li></ul></ul></ul><ul><ul><ul><li>SetHandler server-status </li></ul></ul></ul><ul><ul><ul><li></Location> </li></ul></ul></ul>
  28. 28. SSL Encryption <ul><li>Default SSL port for an HTTP server is 443 </li></ul><ul><li>All SSL requests and responses are handled through the MOD_SSL module (NetWare handles SSL natively) </li></ul><ul><li>SSL configuration is done by creating a virtual host that listens the designated SSL port </li></ul><ul><li>Example SSL configuration is found in conf/extra/httpd-ssl.conf of the Apache HTTPD distribution </li></ul><ul><li>Additional documentation can be found at: </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>
  29. 29. Modular Authentication Architecture <ul><li>Terms / Authentication Elements: </li></ul><ul><li>Authentication Type – Type of encryption used during transport of the authentication credentials (Basic or Digest) </li></ul><ul><li>Authentication Method/Provider – Process by which a user is verified to be who they say they are </li></ul><ul><li>Authorization – Process by which authenticated users are granted or denied access based on specific criteria </li></ul><ul><li>Previous to Apache 2.2, every authentication module had to implement all three elements </li></ul><ul><ul><li>Choosing an AuthType limited which authentication and authorization methods could be used </li></ul></ul><ul><ul><li>Potential for inconsistencies across authentication modules </li></ul></ul><ul><li>Note: Pay close attention to the words Authentication vs. Authorization </li></ul>
  30. 30. New Modules - Introduction <ul><li>The functionality of each Apache 2.0 authentication module has been split out into the three authentication elements for Apache 2.2 </li></ul><ul><li>Overlapping functionality among the modules was simply eliminated in favor of a base implementation </li></ul><ul><li>The module name indicates which element of the authentication functionality it performs </li></ul><ul><ul><li>Mod_auth_xxx – Implements an Authentication Type </li></ul></ul><ul><ul><li>Mod_authn_xxx – Implements an Authentication Method or Provider </li></ul></ul><ul><ul><li>Mod_authz_xxx – Implements an Authorization Method </li></ul></ul>
  31. 31. New Modules – Authentication Type <ul><li>AuthDigestAlgorithm </li></ul><ul><li>AuthDigestDomain </li></ul><ul><li>AuthDigestNcCheck </li></ul><ul><li>AuthDigestNonceFormat </li></ul><ul><li>AuthDigestNonceLifetime </li></ul><ul><li>AuthDigestProvider </li></ul><ul><li>AuthDigestQop </li></ul><ul><li>AuthDigestShmemSize </li></ul>Mod_Auth_Digest MD5 Digest authentication – User credentials are received by the server in encrypted format <ul><li>AuthBasicAuthoritative </li></ul><ul><li>AuthBasicProvider </li></ul>Mod_Auth_Basic Basic authentication – User credentials are received by the server as unencrypted data Directives Modules
  32. 32. New Modules – Authentication Providers <ul><li>AuthDefaultAuthoritative </li></ul>Mod_Authn_Default Authentication fallback module <ul><li>AuthDBMType </li></ul><ul><li>AuthDBMUserFile </li></ul>Mod_Authn_DBM DBM file based user authentication <ul><li>Anonymous </li></ul><ul><li>Anonymous_LogEmail </li></ul><ul><li>Anonymous_MustGiveEmail </li></ul><ul><li>Anonymous_NoUserID </li></ul><ul><li>Anonymous_VerifyEmail </li></ul>Mod_Authn_Anon Allows “anonymous” user access to authenticated areas Directives Modules
  33. 33. New Modules – Authentication Providers <ul><li>AuthUserFile </li></ul>Mod_Authn_File File based user authentication <ul><li>AuthLDAPBindDN </li></ul><ul><li>AuthLDAPBindPassword </li></ul><ul><li>AuthLDAPCharsetConfig </li></ul><ul><li>AuthLDAPDereferenceAliases </li></ul><ul><li>AuthLDAPRemoteUserIsDN </li></ul><ul><li>AuthLDAPUrl </li></ul>Mod_Authnz_LDAP LDAP directory based authentication Directives Modules
  34. 34. New Modules - Authorization <ul><li>AuthzDefaultAuthoritative </li></ul>Mod_Authz_Default Authorization fallback module <ul><li>Require ldap-user </li></ul><ul><li>Require ldap-group </li></ul><ul><li>Require ldap-dn </li></ul><ul><li>Require ldap-attribute </li></ul><ul><li>Require ldap-filter </li></ul><ul><li>AuthLDAPCompareDNOnServer </li></ul><ul><li>AuthLDAPGroupAttribute </li></ul><ul><li>AuthLDAPGroupAttributeIsDN </li></ul><ul><li>AuthzLDAPAuthoritative </li></ul>Mod_Authnz_LDAP LDAP directory based authorization Directives Modules
  35. 35. New Modules - Authorization <ul><li>Require file-group* </li></ul><ul><li>Require group </li></ul><ul><li>AuthDBMGroupFile </li></ul><ul><li>AuthzDBMAuthoritative </li></ul><ul><li>AuthzDBMType </li></ul>Mod_Authz_DBM DBM file based group authorization <ul><li>Allow </li></ul><ul><li>Deny </li></ul><ul><li>Order </li></ul>Mod_Authz_Host Group authorization based on host (name or IP address) <ul><li>Require file-group* </li></ul><ul><li>Require group </li></ul><ul><li>AuthGroupFile </li></ul><ul><li>AuthzGroupFileAuthoritative </li></ul>Mod_Authz_GroupFile File based group authorization Directives Modules
  36. 36. New Modules - Authorization <ul><li>Require file-owner </li></ul><ul><li>AuthzOwnerAuthoritative </li></ul>Mod_Authz_Owner Authorization based on file ownership <ul><li>Require valid-user </li></ul><ul><li>Require user </li></ul><ul><li>AuthzUserAuthoritative </li></ul>Mod_Authz_User User authorization Directives Modules
  37. 37. Differences Between Apache 2.0 & 2.2 <ul><li>New Directives </li></ul><ul><ul><li>AuthBasicProvider On|Off|provider-name [provider-name]… </li></ul></ul><ul><ul><li>AuthDigestProvider On|Off|provider-name [provider-name]… </li></ul></ul><ul><ul><li>AuthzXXXAuthoritative On|Off </li></ul></ul><ul><li>Renamed Directives </li></ul><ul><ul><li>AuthBasicAuthoritative On|Off </li></ul></ul><ul><li>Multiple modules must be loaded (auth, authn, authz) rather than a single mod_auth_xxx module </li></ul>
  38. 38. Differences – More Authorization Types <ul><li>Apache 2.0 </li></ul><ul><ul><li>Require Valid-User </li></ul></ul><ul><ul><li>Require User user-id [user-id] … </li></ul></ul><ul><ul><li>Require Group group-name [group-name] … </li></ul></ul><ul><li>Apache 2.2 </li></ul><ul><ul><li>Same as Apache 2.0 </li></ul></ul><ul><ul><li>LDAP - ldap-user, ldap-group, ldap-dn, ldap-filter, ldap-attribute </li></ul></ul><ul><ul><li>GroupFile – file-group* </li></ul></ul><ul><ul><li>DBM – file-group* </li></ul></ul><ul><ul><li>Owner – file-owner </li></ul></ul><ul><li>Since multiple authorization methods can be used, in most cases the type names should be unique </li></ul>
  39. 39. Configuring Simple Authentication LoadModule auth_basic_module modules/ LoadModule authn_file_module modules/ LoadModule authz_user_module modules/ LoadModule authz_host_module modules/ <Directory /www/docs> Order deny,allow Allow from all AuthType Basic AuthName Authentication_Test AuthBasicProvider file AuthUserFile /www/users/users.dat require valid-user </Directory> The authentication provider is file based and the authorization method is any valid-user
  40. 40. Requiring Group Authorization LoadModule auth_basic_module modules/ LoadModule authn_file_module modules/ LoadModule authz_host_module modules/ LoadModule authz_groupfile_module modules/ <Directory /www/docs> Order deny,allow Allow from all AuthType Basic AuthName Authentication_Test AuthBasicProvider file AuthUserFile /www/users/users.dat AuthGroupFile /www/users/group.dat require group my-valid-group </Directory> The authentication provider is file based but the authorization method is group file based
  41. 41. Multiple Authentication Providers LoadModule auth_basic_module modules/ LoadModule authn_file_module modules/ LoadModule authz_user_module modules/ LoadModule authz_host_module modules/ LoadModule authnz_ldap_module modules/ LoadModule ldap_module modules/ <Directory /www/docs> Order deny,allow Allow from all AuthType Basic AuthName Authentication_Test AuthBasicProvider file ldap AuthUserFile /www/users/users.dat AuthLDAPURL ldap:// AuthzLDAPAuthoritative off require valid-user </Directory> The authentication includes both file and LDAP providers with the file provider taking precedence followed by LDAP
  42. 42. Multiple Authorization Methods LoadModule auth_basic_module modules/ LoadModule authn_file_module modules/ LoadModule authz_host_module modules/ LoadModule authz_groupfile_module modules/ LoadModule authnz_ldap_module modules/ LoadModule ldap_module modules/ <Directory /www/docs> Order deny,allow Allow from all AuthType Basic AuthName Authentication_Test AuthBasicProvider file AuthUserFile /www/users/users.dat AuthzLDAPAuthoritative OFF AuthGroupFile /www/users/group.dat AuthLDAPURL ldap:// require ldap-group cn=public-users,o=my-context require group my-valid-group </Directory> Set AuthzLDAPAuthoritative to “OFF” to allow the LDAP authorization method to defer if necessary
  43. 43. New Features Already in Apache 2.3 <ul><li>Moving from hook-based to provider-based authorization </li></ul><ul><li>“ AND/OR/NOT” logic in authorization </li></ul><ul><li>Host Access Control as an authorization type </li></ul><ul><ul><li>Require IP …, Require Host …, Require Env … </li></ul></ul><ul><ul><li>Require All Granted, Require All Denied </li></ul></ul><ul><ul><li>“ Order Allow/Deny”, “Satisfy” where did they go? </li></ul></ul><ul><ul><li>Backward compatibility with the 2.0/2.2 Host Access Control, use the Mod_Access_Compat module </li></ul></ul>
  44. 44. Adding “AND/OR/NOT” Logic to Authorization <ul><li>Allows authorization to be granted or denied based on a complex set of “Require…” statements </li></ul><ul><li>New Directives </li></ul><ul><ul><li><SatisfyAll> … </SatisfyAll> - Must satisfy all of the encapsulated statements </li></ul></ul><ul><ul><li><SatisfyOne> … </SatisfyOne> - Must satisfy at least one of the encapsulated statements </li></ul></ul><ul><ul><li><RequireAlias> … </RequireAlias> - Defines a ‘Require’ alias </li></ul></ul><ul><ul><li>Reject – Reject all matching elements </li></ul></ul>
  45. 45. Authorization using ‘AND/OR’ Logic Configuration <Directory /www/mydocs> Authname ... AuthType ... AuthBasicProvider ... ... Require user John < SatisfyAll > Require Group admins Require ldap-group cn=mygroup,o=foo < SatisfyOne > Require ldap-attribute dept=&quot;sales“ Require file-group </ SatisfyOne > </ SatisfyAll > </Directory> Authorization Logic if ((user == &quot;John&quot;) || ((Group == &quot;admin&quot;) && (ldap-group <contains user>) && ((ldap-attribute dept==&quot;sales&quot;)|| (file-group contains user)))) then Authorization Granted else Authorization Denied
  46. 46. Questions
  47. 48. <ul><li>Unpublished Work of Novell, Inc. All Rights Reserved. </li></ul><ul><li>This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability. </li></ul><ul><li>General Disclaimer </li></ul><ul><li>This document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for Novell products remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners. </li></ul>