 |
(1) コンテンツAPサーバーが分かれていて、URLも分かれる設定方法
PC用とスマートフォン用で、コンテンツを提供するAPサーバーが分かれていて、ユーザーからアクセスするURLも分かれる場合には、フォワーダのインスタンスを複数立てることで対応します。

[利用例]
@ユーザーはTOPページにアクセスします。
https://www.example.com/
ATOPページのApache設定により、User-AgentにiPhoneまたはAndroidの文字が含まれる場合、以下に遷移します。
https://www.example.com/mobile/dfw/portal/
B含まれない場合、以下に遷移します。
https://www.example.com/pc/dfw/portal/
このようにHP IceWall SSOフォワーダを構成する際には、TOPページのApacheにて以下のように設定します。
User-AgentによるURL書き換えを設定(/etc/httpd/conf/httpd.conf)
<Directory "/var/www/html">
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} iPhone [NC]
RewriteRule ^$ https://www.example.com/mobile/dfw/portal/ [R,L]
RewriteCond %{HTTP_USER_AGENT} Android [NC]
RewriteRule ^$ https://www.example.com/mobile/dfw/portal/ [R,L]
RewriteRule ^$ https://www.example.com/pc/dfw/portal/ [R,L]
</Directory>
|
※上記はあくまで設定例です。実際に運用する場合には、例えばiPadなどのタブレット端末は、PC用コンテンツを表示するなど検討が必要です。
HP IceWall SSOフォワーダのインスタンスを複数立てます。
# cd /opt/
# mkdir pc
# mkdir mobile
# cp -pr icewall-sso pc/
# cp -pr icewall-sso mobile/
|
オリジナルのインスタンスの他に2つのインスタンスが作成されたことを確認します。
# ls /opt/
icewall-sso mobile pc
|
※オリジナルのインスタンス(icewall-sso)は認証モジュール、ライブラリ参照用などのために、そのままにしています。
HP IceWall SSOフォワーダを2つ設定(/etc/httpd/conf/httpd.conf)
Alias /img/ "/opt/pc/icewall-sso/dfw/html/image/"
Alias /cont/ "/opt/mobile/icewall-sso/dfw/shtml_stylish/contents/"
SetEnv LD_LIBRARY_PATH "/opt/icewall-sso/lib/dfw:/usr/lib64"
ScriptAlias /pc/ "/opt/pc/icewall-sso/dfw/cgi-bin/"
<Directory "/opt/pc/icewall-sso/dfw/cgi-bin">
AllowOverride All
Options ExecCGI
SetHandler cgi-script
Order allow,deny
Allow from all
</Directory>
ScriptAlias /mobile/ "/opt/mobile/icewall-sso/dfw/cgi-bin/"
<Directory "/opt/mobile/icewall-sso/dfw/cgi-bin">
AllowOverride All
Options ExecCGI
SetHandler cgi-script
Order allow,deny
Allow from all
</Directory>
|
※各HP IceWall SSOフォワーダ設定ファイルはインストール先を変更したため、参照先ファイルパスの変更が必要になります。
PC用フォワーダ設定(/opt/pc/icewall-sso/dfw/cgi-bin/dfw.conf)
#------------------------------------------------------------------------------
# [ Template HTML File Info ]
# DOCS : template HTML configuration file location
# (default: /opt/icewall-sso/dfw/cgi-bin/html.conf)
# LOCATIONURL : location allowed for redirection in the template HTML
# LOCATIONRETRY : retries allowed for redirection to the template HTML page
# (default: 1)
# HTML_CHARSET : character set for the template HTML
#------------------------------------------------------------------------------
DOCS=/opt/pc/icewall-sso/dfw/cgi-bin/html.conf
|
PC用HTMLテンプレート設定(/opt/pc/icewall-sso/dfw/cgi-bin/html.conf)
#------------------------------------------------------------------------------
# IceWall SSO 10.0 Configuration File for Document Forwarder.
# $Workfile: html.conf $ $Revision: 7 $ $Date: 10/02/25 18:54 $
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# [ HTML Files Info ]
# XXXXXX=file://[Local HTML File Location][,[status code],[status message]]
# http://[host:port][[File Location],[status code],[status message]]
# https://[host:port][[File Location],[status code],[status message]]
#------------------------------------------------------------------------------
LOGIN_UID=file:///opt/pc/icewall-sso/dfw/html/login.html
LOGIN_CERT=file:///opt/pc/icewall-sso/dfw/html/login_cert.html
(省略)
|
スマートフォン用フォワーダ設定(/opt/mobile/icewall-sso/dfw/cgi-bin/dfw.conf)
#------------------------------------------------------------------------------
# [ Template HTML File Info ]
# DOCS : template HTML configuration file location
# (default: /opt/icewall-sso/dfw/cgi-bin/html.conf)
# LOCATIONURL : location allowed for redirection in the template HTML
# LOCATIONRETRY : retries allowed for redirection to the template HTML page
# (default: 1)
# HTML_CHARSET : character set for the template HTML
#------------------------------------------------------------------------------
DOCS=/opt/mobile/icewall-sso/dfw/cgi-bin/html.conf
|
スマートフォン用HTMLテンプレート設定(/opt/mobile/icewall-sso/dfw/cgi-bin/html.conf)
#------------------------------------------------------------------------------
# IceWall SSO 10.0 Configuration File for Document Forwarder.
# $Workfile: html.conf $ $Revision: 7 $ $Date: 10/02/25 18:54 $
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# [ HTML Files Info ]
# XXXXXX=file://[Local HTML File Location][,[status code],[status message]]
# http://[host:port][[File Location],[status code],[status message]]
# https://[host:port][[File Location],[status code],[status message]]
#------------------------------------------------------------------------------
LOGIN_UID=file:///opt/mobile/icewall-sso/dfw/shtml_stylish/login.html
LOGIN_CERT=file:///opt/mobile/icewall-sso/dfw/shtml_stylish/login_cert.html
(省略)
|
※同様に他の設定についても、参照先ファイル名の変更が必要です。
(2) コンテンツAPサーバーが分かれていて、URLが同一の設定方法
PC用とスマートフォン用で、バックエンドのコンテンツAPサーバーが分かれていて、ユーザーがアクセスするURLを1つにする場合、フォワーダのインスタンスは1つで実現できます。

[利用例]
@ユーザーはTOPページにアクセスします。
https://www.example.com/fw/dfw/portal/
AフォワーダのApache設定によりUser-AgentにiPhoneまたはAndroidの文字が含まれる場合、dfw_mobile.confを読み込みます。
B含まれない場合はdfw.confを読み込みます。
このようにHP IceWall SSOフォワーダを構成する際には、フォワーダのApacheにて以下のように設定してください。なお、PC用フォワーダ設定は通常通りとなります。
User-Agentによるフォワーダ設定ファイルの書き換えを設定(/etc/httpd/conf/httpd.conf)
<Directory "/opt/icewall-sso/dfw/cgi-bin">
SetEnvIf User-Agent ".*iPhone" IWDFWCONFIG=/opt/icewall-sso/dfw/cgi-b in/dfw_mobile.conf
SetEnvIf User-Agent ".*Android" IWDFWCONFIG=/opt/icewall-sso/dfw/cgi-b in/dfw_mobile.conf
SetEnv LD_LIBRARY_PATH "/opt/icewall-sso/lib/dfw:/usr/lib64"
AllowOverride All
Options ExecCGI
SetHandler cgi-script
Order allow,deny
Allow from all
</Directory>
|
スマートフォン用フォワーダ設定ファイルを設定(/opt/icewall-sso/dfw/cgi-bin/dfw_mobile.conf)
#------------------------------------------------------------------------------
# [ Template HTML File Info ]
# DOCS : template HTML configuration file location
# (default: /opt/icewall-sso/dfw/cgi-bin/html.conf)
# LOCATIONURL : location allowed for redirection in the template HTML
# LOCATIONRETRY : retries allowed for redirection to the template HTML page
# (default: 1)
# HTML_CHARSET : character set for the template HTML
#------------------------------------------------------------------------------
DOCS=/opt/icewall-sso/dfw/cgi-bin/html_mobile.conf
#LOCATIONURL=welcome.hp.com:80
#LOCATIONRETRY=3
HTML_CHARSET=Shift_JIS
|
スマートフォン用HTMLテンプレート設定(/opt/icewall-sso/dfw/cgi-bin/html_mobile.conf)
#------------------------------------------------------------------------------
# IceWall SSO 10.0 Configuration File for Document Forwarder.
# $Workfile: html.conf $ $Revision: 7 $ $Date: 10/02/25 18:54 $
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# [ HTML Files Info ]
# XXXXXX=file://[Local HTML File Location][,[status code],[status message]]
# http://[host:port][[File Location],[status code],[status message]]
# https://[host:port][[File Location],[status code],[status message]]
#------------------------------------------------------------------------------
LOGIN_UID=file:///opt /icewall-sso/dfw/shtml_stylish/login.html
LOGIN_CERT=file:///opt /icewall-sso/dfw/shtml_stylish/login_cert.html
(省略)
|
(3-1) コンテンツサーバーが同一、URLも同一の設定方法
前述(2)の方法で、フォワーダ設定ファイルを複数設定すれば実現することができます。
(3-2) コンテンツサーバーが同一、URLも同一の設定方法
コンテンツを提供するコンテンツAPサーバーが動的に画面生成する場合、フォワーダのインスタンスは1つ、設定ファイルも1つで実現できます。
HP IceWall SSO PC・スマートフォン用コンテンツAPサーバー

[利用例]
@ユーザーはTOPページにアクセスします。
https://www.example.com/fw/dfw/portal/
Aフォワーダは画面テンプレートをHTTPプロトコルで動的に取得します。
このようにHP IceWall SSOを構成する際には、フォワーダのApache設定は通常通りとなります。
また、通常画面テンプレートは静的に決定しますが、HTTPプロトコルで動的に取得するよう変更します。使い方はlogin.plを、以下のURLでアクセスできるように設置します。
http://localhost/cgi-bin/login.pl
HTMLテンプレート設定(/opt/ icewall-sso/dfw/cgi-bin/html.conf)
#------------------------------------------------------------------------------
# [ HTML Files Info ]
# XXXXXX=file://[Local HTML File Location][,[status code],[status message]]
# http://[host:port][[File Location],[status code],[status message]]
# https://[host:port][[File Location],[status code],[status message]]
#------------------------------------------------------------------------------
LOGIN_UID=http://localhost/cgi-bin/login.pl
(省略)
|
login.pl
#!/usr/bin/perl
print "Content-type: text/html; charset=Shift_JIS\n\n";
$style="html";
foreach $var (keys(%ENV)) {
$name = $var;
$value = $ENV{$var};
if ( ($name eq "HTTP_USER_AGENT") && (-1 < index ($value, "iPhone") || -1 < index ($value, "Android")) ) {
$style="shtml_stylish";
break;
}
}
open(HTMLFILE, "< /opt/icewall-sso/dfw/$style/login.html");
while (my $line = <HTMLFILE>){
print "$line";
}
|
※上記はあくまで設定例です。実際に運用する場合にはCGIの配置場所や、パスワード変更画面、ログアウト画面、エラー画面などについても検討が必要です。 |
 |