7.4.3 Changing web server settings by using server templates
To change the web server settings (other than standard properties), use server templates, which contain the settings required to run the web server. When changing the web server settings, either set extended properties or enter a directive directly into the server template. If you edit a server template, we recommend setting the extended properties.
Prerequisites
-
The domain administration server (DAS) is running.
-
Application Server for Developers has been set up.
Intended users
-
Application developers
Storage location and file names of the server templates
A server template is deployed after the domain is started for the first time.
The file names of the server templates are as follows:
-
httpsd.conf@windows.vtl
The server template for web server basic settings. This template contains basic settings other than those for web server request transmission and web server load balancing.
reverse_proxy.conf@.vtl
The server template for the settings for web server request transmission.
When the domain is started for the first time, files in the server template are deployed to the following location: installation_directory_for_Application_Server_for_Developers/javaee/glassfish/domains/domain_name/server_templates/webserver/conf.
Editing a server template
You can edit a server template as follows:
-
Use VTL syntax to set the extension properties.
Specify the VTL syntax in the server template, and then set up the web server by processing the extended property values of the set subcommand of the asadmin utility command.
-
Directly specify directives.
Set the web server by entering directives directly into the server template.
By using VTL syntax to specify extended properties, you will be able to change the web server settings by using the set subcommand of the asadmin utility command, and verify the changes by using the get subcommand.
When the create-webserver and start-webserver subcommands of the asadmin utility command are run, the server template is read by the DAS. The settings are then applied to the definition file that is read by the web server.
Procedure
To set extended properties by using VTL syntax, do the following:
The following procedure uses the ProxyPreserveHost directive of reverse_proxy.conf as an example.
Using a text editor, open the server template file reverse_proxy.conf@.vtl, and then specify the VTL syntax of extended properties.
To specify extended properties, add ex_ at the beginning of the directive name.
For example, for the ProxyPreserveHost directive, extended properties can be set by using ex_ProxyPreserveHost.value.
ProxyPreserveHost ${property.ex_ProxyPreserveHost.value}
Save the server template file.
To specify On for the value of the ex_ProxyPreserveHost.value extended property of the web server settings, run the set subcommand of the asadmin utility command.
asadmin set hitachi-webservers.hitachi-webserver.web_server_name. property.ex_ProxyPreserveHost=On
When this command is run, the result is displayed as follows:
hitachi-webservers.hitachi-webserver.web_server_name.property. ex_ProxyPreserveHost=On Command set executed successfully.
Run the get subcommand of the asadmin utility command to verify whether the value of the ex_ProxyPreserveHost.value extended property is the same as intended.
asadmin get hitachi-webservers.hitachi-webserver.web_server_name. property.ex_ProxyPreserveHost
When this command is run, the result is displayed as follows:
hitachi-webservers.hitachi-webserver.web_server_name .property.ex_ProxyPreserveHost=On Command get executed successfully.
When specifying a directive directly, do the following:
Open the server template file by using a text editor, and then directly specify the Web Server directive.
To specify the directive as a comment, start the line with a hash mark (#) followed by a half width space.
Save the server template file.
Initial values for the web server settings
When a web server is configured by using the individual files of each server template, the initial values for settings in each definition file of the web server as read by the DAS are as follows:
- httpsd.conf
-
Listen 80 HWSMaxQueueSize 8192 ThreadsPerChild 50 Timeout 30 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 3 HostnameLookups Off ServerRoot "installation_directory_for_Application_Server_for_Developers/httpsd" ServerName www.example.com DocumentRoot "installation_directory_for_Application_Server_for_Developers/javaee/glassfish/ nodes/localhost-domain1/Web1/root/htdocs" DirectoryIndex index.html UseCanonicalName Off ServerSignature Off ServerTokens ProductOnly TraceEnable Off LogLevel warn ErrorLog "|\"\"installation_directory_for_Application_Server_for_Developers/httpsd/sbin/ rotatelogs.exe\" \"installation_directory_for_Application_Server_for_Developers/javaee/logs/ nodes/localhost-domain1/Web1/error\" 86400 -fnum 8 -diff 540\"" HWSRequestLog "|\"\"installation_directory_for_Application_Server_for_Developers/httpsd/sbin/ rotatelogs.exe\" \"installation_directory_for_Application_Server_for_Developers/javaee/logs/ nodes/localhost-domain1/Web1/hwsrequest\" 86400 -fnum 8 -diff 540\"" LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent LogFormat "%h %l %u %t \"%r\" %>s %b %{hws_thread_id}P %{hws_ap_root}n %I %O %X %D \"%{Referer}i\" \"%{User-Agent}i\"" hws_trace LogFormat "%h %l %u %t \"%r\" %>s %b %T %{hws_thread_id}P %{hws_ap_root}n" hws_std HWSLogTimeVerbose On CustomLog "|\"\"installation_directory_for_Application_Server_for_Developers/httpsd/sbin/ rotatelogs.exe\" \"installation_directory_for_Application_Server_for_Developers/javaee/logs/ nodes/localhost-domain1/Web1/access\" 86400 -fnum 8 -diff 540\"" hws_std PidFile "installation_directory_for_Application_Server_for_Developers/javaee/logs/nodes/ localhost-domain1/Web1/httpd.pid" HWSTraceIdFile "installation_directory_for_Application_Server_for_Developers/javaee/logs/ nodes/localhost-domain1/Web1/hws.trcid" HWSTraceLogFile "installation_directory_for_Application_Server_for_Developers/javaee/logs/ nodes/localhost-domain1/Web1/hws.trclog" SSLDisable TypesConfig "installation_directory_for_Application_Server_for_Developers/httpsd/conf/ mime.types" AddEncoding x-compress .Z AddEncoding x-gzip .gz .tgz AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage tr .tr AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[01234]" redirect-carefully BrowserMatch "^gnome-vfs/1.0" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully BrowserMatch " Konqueror/4" redirect-carefully Alias /icons/ "installation_directory_for_Application_Server_for_Developers/httpsd/icons/" IndexOptions FancyIndexing AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t <Directory /> Options None AllowOverride None </Directory> <Directory "installation_directory_for_Application_Server_for_Developers/httpsd/htdocs"> Options None AllowOverride None </Directory> <FilesMatch "^\.(ht|key)"> Order allow,deny Deny from all </FilesMatch> Include "installation_directory_for_Application_Server_for_Developers/javaee/glassfish/nodes/ localhost-domain1/Web1/root/conf/reverse_proxy.conf" HWSGracefulStopLog On HWSGracefulStopTimeout 0 HWSPrfId PRF1 HWSPrfSpool "installation_directory_for_Application_Server_for_Developers/javaee/logs/nodes/ localhost-domain1/PRF1" SendBufferSize 131072
- reverse_proxy.conf
-
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so HWSSuppressModuleTrace mod_proxy.c hook ProxyVia Off ProxyTimeout 200 ProxyPass / http://localhost:28080/ connectiontimeout=2 ProxyPassReverse / http://localhost:28080/