IBM Http Server部署步驟

1.  ihs部署步驟

1.1     將ihs的服務端口添加至對應的was虛擬主機中

修改ihs對應的was配置,將was被訪問的虛擬主機中加入ihs的服務端口,若不進行該配置,was無法處理ihs轉發過來的交易。

如ihs的服務端口爲8080,訪問was的7001端口,對應的虛擬主機爲xxx_host,需將8080端口也添加到was的虛擬主機xxx_host中。

1.2     ihs7靜默安裝

a.   假如ih7安裝包解壓後在/ptf/IHS7/IHS目錄中,首先進入該目錄;

cd /ptf/IHS7/IHS

b.   創建響應文件,以下內容,=””中間不能有空格,否則會出錯

cat > ihs_install_responsefile.txt <<!

-OPT silentInstallLicenseAcceptance="true"

-OPT allowNonRootSilentInstall="true"

-OPT disableOSPrereqChecking="true"

-OPT installLocation="/was/IBM/HTTPServer"

-OPT httpPort="8080"

-OPT adminPort="8008"

-OPT createAdminAuth="true"

-OPT adminAuthUser="admin"

-OPT adminAuthPassword="admin"

-OPT adminAuthPasswordConfirm="admin"

-OPT runSetupAdmin="true"

-OPT createAdminUserGroup="true"

-OPT setupAdminUser="admin"

-OPT setupAdminGroup="admin"

-OPT installHttpService="true"

-OPT installAdminService="true"

-OPT installPlugin="true"

-OPT webserverDefinition="webserver1"

-OPT washostname="wasapp"

!

c.   以root用戶執行靜默安裝(若IHS安裝包對應屬主爲was,也可使用was用戶安裝),命令如下。在安裝前,不需創建/was/IBM/HTTPServer目錄,否則會報錯,在下一步驟的日誌文件中

./install -options ihs_install_responsefile.txt -silent

d.   檢查安裝日誌/was/IBM/HTTPServer/logs/install/log.txt,只要出現INSTCONFSUCCESS表示操作成功

e.   將/was/IBM/HTTPServer目錄屬主設爲was用戶

1.3     安裝ihs時需修改的配置

安裝ihs時,設置服務端口爲8080(若不進行該設置,需在httpd.conf文件增加Listen 8080),不使用80端口,否則需要使用sudo啓動ihs進程,將Web server名字設置爲webserver1。

1.4     修改htdocs目錄

將htdoc目錄改名爲htdocs_bak;

創建htdocs目錄;

將error.html、error.gif(錯誤提示頁面)上傳到htdocs目錄;

將htdocs目錄權限改爲555。

cd /was/IBM/HTTPServer

mv htdocs htdocs_bak

mkdir htdocs

將error.html、error.gif上傳到htdocs目錄

chmod 555 htdocs

1.5     修改httpd.conf

將/was/IBM/HTTPServer/conf/httpd.conf備份爲httpd.conf.bak,修改httpd.conf,修改內容如下(可使用修改好的文件直接替換):

a.   設置ihs服務端口(以8080爲例),ServerName統一修改爲*,方便替換文件

ServerName [主機名]:8080

改爲

ServerName *:8080

b.   指定監聽端口(以8080爲例)

Listen 8080

c.   設置不顯示目錄結構,若不進行該修改,在DocumentRoot "htdocs"目錄下若存在目錄dir,且目錄dir中不存在index.html,使用瀏覽器訪問http://xxxx:port/dir時,會列出dir目錄列表

Options Indexes FollowSymLinks

改爲

Options FollowSymLinks

d.   在HTTP返回內容中不顯示服務器版本等信息

ServerSignature On

改爲

ServerSignature Off

e.   在HTTP返回頭的Server字段不顯示服務器版本等信息

需確保爲ServerTokens Prod,不能修改爲其他值

f.   修改日誌在指定的目錄每天生成一個

CustomLog logs/access_log common

改爲

CustomLog "|/was/IBM/HTTPServer/bin/rotatelogs /was/log/ihs/access_log-%y%m%d.log 86400 480" common

ErrorLog logs/error_log

改爲

ErrorLog "|/was/IBM/HTTPServer/bin/rotatelogs /was/log/ihs/error_log-%y%m%d.log 86400 480"

g.   禁止對/icons/目錄的訪問權限

<Directory "/was/IBM/HTTPServer/icons">

    Options Indexes MultiViews

    AllowOverride None

    Order allow,deny

    Allow from all

</Directory>

改爲

<Directory "/was/IBM/HTTPServer/icons">

    Options None

    AllowOverride None

    Order allow,deny

</Directory>

h.   防止出現安全隱患

在尾部加上TraceEnable off

i.   修改錯誤提示頁面

ErrorDocument 400 /error.html

ErrorDocument 403 /error.html

ErrorDocument 404 /error.html

ErrorDocument 500 /error.html

ErrorDocument 501 /error.html

1.6     修改plugin-cfg.xml

將/was/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml備份爲plugin-cfg.xml.bak,修改plugin-cfg.xml,修改內容如下(可使用修改過的文件直接替換):

a.   VirtualHostGroup修改爲ocs_host,對應was的虛擬主機,需加入ihs的服務端口(8080)與was的服務端口(7001)

    <VirtualHostGroup Name="default_host">

        <VirtualHost Name="*:9080"/>

        <VirtualHost Name="*:80"/>

        <VirtualHost Name="*:9443"/>

改爲

    <VirtualHostGroup Name="ocs_host">

        <VirtualHost Name="*:8080"/>

        <VirtualHost Name="*:7001"/>

b.   Transport節點的Hostname需修改爲對應was的負載均衡主機名(以wasapp_f5爲例),Port需修改爲was的服務端口,由於was僅提供HTTP訪問,不提供HTTPS訪問,HTTPS相關配置可不考慮

            <Transport Hostname="newcallcenter8" Port="9080" Protocol="http"/>

            <Transport Hostname="newcallcenter8" Port="9443" Protocol="https">

                <Property name="keyring" value="/was/IBM/HTTPServer/Plugins/etc/plugin-key.kdb"/>

                <Property name="stashfile" value="/was/IBM/HTTPServer/Plugins/etc/plugin-key.sth"/>

改爲

            <Transport Hostname="ocs_wasapp_f5" Port="7001" Protocol="http"/>

            <Transport Hostname="ocs_wasapp_f5" Port="9443" Protocol="https">

                <Property name="keyring" value="/was/IBM/HTTPServer/Plugins/config/webserver1/plugin-key.kdb"/>

                <Property name="stashfile" value="/was/IBM/HTTPServer/Plugins/config/webserver1/plugin-key.sth"/>

c.   /custim/*對應was應用的上下文根

<UriGroup Name="server1_Cluster_URIs">

...  

改爲

<UriGroup Name="server1_Cluster_URIs">

        <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/custim/*"/>

    </UriGroup>

d.   使用VirtualHostGroup之前配置的ocs_host

    <Route ServerCluster="server1_Cluster"

        UriGroup="server1_Cluster_URIs" VirtualHostGroup="default_host"/>

改爲

    <Route ServerCluster="server1_Cluster"

        UriGroup="server1_Cluster_URIs" VirtualHostGroup="ocs_host"/>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章