忍者ブログ

2024
09
17

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

2024/09/17 (Tue.)

2009
02
16

[Tomcat][SSO] JossoでSSO

JOSSOをダウンロードする
とりあえず、 apache-tomcat-6.0.18_josso-1.8.0をダウンロードすれば、すぐJOSSOで確認できる。

サンプルとして、webappディレクトリ以下にjossoとpartnerappがある。
http://localhost:8080/josso
http://localhost:8080/partnerapp
などとすることで、ログイン画面が表示されることを確認できる。

webapp/examplesを認証させる。

/lib/josso-agent-config.xml に以下追加する

<agent:partner-apps>
    <!-- 以下追加 -->
    <agent:partner-app id="Examples" context="/examples">
        <ignore-web-resource-collections>public-resources,img-resources</ignore-web-resource-collections>
    </agent:partner-app>
    <!-- 以上追加 -->

/webapps/examples/WEB-INF/web.xml 以下のように修正する。

---------------------------------------------------------------------------------------------------------------------------------
<!-- for SSO -->
    <security-constraint>
        <!-- Sample Security Constraint -->
        <web-resource-collection>

            <!-- We're going to protect this resource and make it available only to users in "role1". -->
            <web-resource-name>protected-resources</web-resource-name>

            <url-pattern>/*</url-pattern>
            <!--
            <url-pattern>/jsp/*</url-pattern>
            <url-pattern>/servlets/*</url-pattern>
            -->

            <http-method>HEAD</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>

        </web-resource-collection>

        <!-- NOTE: This role names will be retrieved by Josso using the proper identity store. -->
        <auth-constraint>
            <role-name>role1</role-name>
        </auth-constraint>

        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>

    </security-constraint>

<!-- for SSO -->

    <!-- Default login configuration uses form-based authentication -->

    <!-- We only need tomcat to redirect the user -->
<!-- for SSO -->
    <login-config>

        <auth-method>FORM</auth-method>

        <form-login-config>
            <!--
            NOTE: This will redirect the user to the proper login page provided by JOSSO.
            -->
            <form-login-page>/login-redirect.jsp</form-login-page>
            <form-error-page>/login-redirect.jsp</form-error-page>


        </form-login-config>

    </login-config>
<!-- for SSO -->
---------------------------------------------------------------------------------------------------------------------------------



PR

2009/02/16 (Mon.) Trackback() Comment(0) 未選択

2009
02
06

[JBoss] AS 5.0.0.GA でクラスタリングの注意

JBoss4.2からセキュリティー上の観点からバインド(監視)するアドレスの
デフォルト(初期設定)が127.0.0.1(稼動PC自身)になったのです。
#いままで(4.0.x系)は全てのIPアドレスをバインドしていました(設定0.0.0.0)

のようで、web上にはrun.bat -c all でOKなどとあるが、

run.bat -b xxx.xxx.xxx.xxx -c all

としないとクラスタリングできない。

さらにセッションレプリケーションのためには、

run.bat -b xxx.xxx.xxx.xxx -Djboss.messaging.ServerPeerID=X -c all

などとして、サーバーピアIDをユニークにしなければならない


2009/02/06 (Fri.) Trackback() Comment(0) 未選択

2009
02
05

[GlassFish] クラスタリング設定とか、apacheとの連携とか

glassfishのインストールからクラスタ設定など

http://sdc.sun.co.jp/java/series/glassfish/index.html


今回は、DAS(ドメイン管理サーバ),instance1,instance2って感じにした。
それぞれ別マシン
上記は、Soralisなので多少違うが、インスタンスの作成などはおなじように。

クラスタに配備したアプリケーションの動作確認 まで確認できれば、OK

そこから、webサーバにapacheを使用するので、設定が変わってくる。

ここからは、glassfishとapacheの連携はおこなった事があることを前提とする。
つまり、glassfishにtomcat-ajp.jarcommons-logging.jar and commons-modeler.jarなどが適切な場所にコピーされていること。わからなければここなんかを参考に

で、apacheでロードバランシングするには、クラスタ上の各instanceのAJPポートに
接続できるようになっていなければならない。

その設定が、ここ
とくにこの設定が、ほかのblogなどにはなかった。これしないと各instanceでAJPポート開いてくれない!!!
asadmin set server-config.http-service.http-listener.http-listener1.property.jkEnabled=true
もちろんこれも。
asadmin create-jvm-options -Dcom.sun.enterprise.web.connector.enableJK=8009

で、httpd.confやworker.propertiesの設定は、Tomcatのクラスタリングの時と同じです。



2009/02/05 (Thu.) Trackback() Comment(0) 未選択

2009
02
05

2009
02
05

カレンダー

08 2024/09 10
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

リンク

カテゴリー

フリーエリア

最新CM

[08/09 VMAXON]

最新記事

最新TB

プロフィール

HN:
No Name Ninja
性別:
非公開

バーコード

RSS

ブログ内検索

アーカイブ

最古記事

アクセス解析

FX NEWS


-外国為替-

コガネモチ