이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Complete Working Examples
5.1. mod_cluster Example 링크 복사링크가 클립보드에 복사되었습니다!
This section contains a set of example configurations for a complete working example of how to use mod_cluster on a Red Hat Enterprise Linux system.
Load Balancer
To setup JBoss Core Services as a proxy server listening on localhost, create a configuration file in JBCS_HOME/httpd/conf.d/mod_cluster.conf and add the following:
Worker Configuration for Tomcat
Edit JWS_HOME/tomcat<VERSION>/conf/server.xml, and add the following Listener element to configure a Tomcat worker node:
<Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener" advertise="true"/>
<Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener" advertise="true"/>
Example iptables Firewall Rules
The following are a set of example firewall rules using iptables, for a cluster node on the 192.168.1.0/24 subnet.
/sbin/iptables -I INPUT 5 -p udp -d 224.0.1.0/24 -j ACCEPT -m comment --comment "mod_cluster traffic" /sbin/iptables -I INPUT 6 -p udp -d 224.0.0.0/4 -j ACCEPT -m comment --comment "JBoss Cluster traffic" /sbin/iptables -I INPUT 9 -p udp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication" /sbin/iptables -I INPUT 10 -p tcp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication" /etc/init.d/iptables save
/sbin/iptables -I INPUT 5 -p udp -d 224.0.1.0/24 -j ACCEPT -m comment --comment "mod_cluster traffic"
/sbin/iptables -I INPUT 6 -p udp -d 224.0.0.0/4 -j ACCEPT -m comment --comment "JBoss Cluster traffic"
/sbin/iptables -I INPUT 9 -p udp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
/sbin/iptables -I INPUT 10 -p tcp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
/etc/init.d/iptables save
5.2. mod_auth_kerb Example 링크 복사링크가 클립보드에 복사되었습니다!
This section contains instructions for a basic example for configuring Kerberos authentication with JBoss Core Services' Apache HTTP Server and mod_auth_kerb on Red Hat Enterprise Linux.
5.2.1. mod_auth_kerb Example Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
The following is a list of prerequisites for the working example. Ensure that all prerequisites are met before attempting to use the example instructions.
- Install curl with GSS-negotiated support (for testing the configuration).
- Configure and run a Kerberos or LDAP server (for example ApacheDS) on the same host as JBoss Core Services.
If using an LDAP server, create the following LDAP users:
Create the user
krbtgt:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the user
ldap:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the user
HTTP:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create user
hnelson(test user):Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2.2. Configure the Kerberos Client 링크 복사링크가 클립보드에 복사되었습니다!
Create the
krb5.confconfiguration file in the/etcdirectory, and add the following to the file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a key tab in the
JBCS_HOME/httpd/conffolder with the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Environment variables are not expanded within the ktutil prompt. Users will need to substitute the full path for the JBCS_HOME variable.
As the root user, run the following commands to apply the correct group and permissions to the key tab:
chgrp apache JBCS_HOME/httpd/conf/krb5.keytab chmod 640 JBCS_HOME/httpd/conf/krb5.keytab
# chgrp apache JBCS_HOME/httpd/conf/krb5.keytab
# chmod 640 JBCS_HOME/httpd/conf/krb5.keytab
Ensure that the following host configuration is included in the
/etc/hostsfile:127.0.0.1 localhost
127.0.0.1 localhostCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2.3. Configure mod_auth_kerb 링크 복사링크가 클립보드에 복사되었습니다!
Create the auth_kerb.conf configuration file in the JBCS_HOME/httpd/conf.d/ folder, and add the following configuration to the file:
Environment variables are not expanded within the configuration files. Users will need to substitute the full path for the JBCS_HOME variable.
5.2.4. Test the Kerberos Authentication 링크 복사링크가 클립보드에 복사되었습니다!
-
Create a test page named
auth_kerb_page.htmlinJBCS_HOME/httpd/www/html/kerberostest/. Add the following contents to the test page (
auth_kerb_page.html):<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html><html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Optional: Set the log level for debugging in
JBCS_HOME/httpd/conf/httpd.conf. - Start Apache HTTP Server. See the Installation Guide for details.
Test the authentication as follows:
Initiate Kerberos authentication for the test user
hnelson:kinit hnelson
$ kinit hnelsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow View the details for the test user
hnelson:klist
$ klistCopy to Clipboard Copied! Toggle word wrap Toggle overflow A result similar to the following appears:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Test Apache HTTP Server Kerberos authentication as follows:
curl --negotiate -u : http://localhost/kerberostest/auth_kerb_page.html
$ curl --negotiate -u : http://localhost/kerberostest/auth_kerb_page.htmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow If it is working correctly, the following result appears:
<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html><html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
See http://modauthkerb.sourceforge.net/ for more information about mod_auth_kerb.