4.6.4 Changing web server settings
To change the web server settings (other than standard properties), use the server template that describes 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. When editing a server template, we recommend setting the extended properties.
Prerequisites
-
The domain administration server (DAS) is running.
-
Application Server has been set up.
Intended users
-
System engineers
Storage location and file name of the server template
The server template is deployed after starting the domain for the first time.
The file name of the server template is as follows:
-
httpsd.conf@linux.vtl (in Linux)
The server template for the web server basic settings. This template contains basic settings other than those for request transmission to the web server and load balancing.
-
reverse_proxy.conf@.vtl
The server template for the request transmission settings of the web server. This template contains the settings for when the server instance of the request transmission destination is not in a cluster configuration.
-
proxy_balancer.conf@.vtl
The server template for the load balancing settings of the web server. This template contains the settings for when the server instance of the request transmission destination is in a cluster configuration.
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/javaee/glassfish/domains/domain_name/server_templates/webserver/conf.
Editing the server template
The server template can be edited 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 up 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 is 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 uses an example of setting the ProxyPreserveHost directive to reverse_proxy.conf to explain the procedure.
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:
Using a text editor, open the server template file, and then specify the directive of the Web Server directly.
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 individual server template files, 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 StartServers 20 MinSpareServers 10 MaxSpareServers 20 MaxRequestWorkers 150 MaxConnectionsPerChild 10000 Timeout 30 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 3 HostnameLookups Off User bin Group bin ServerRoot "installation_directory_for_Application_Server/httpsd" ServerName www.example.com DocumentRoot "installation_directory_for_Application_Server/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/httpsd/sbin/ rotatelogs Installation directory of Application Server/javaee/logs/nodes/ localhost-domain1/Web1/error 86400 -fnum 8 -diff 540" HWSRequestLog "|installation_directory_for_Application_Server/httpsd/ sbin/rotatelogs Installation directory of Application Server /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 %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 %P %{hws_ap_root}n" hws_std HWSLogTimeVerbose On CustomLog "|installation_directory_for_Application_Server/httpsd/sbin/ rotatelogs Installation directory of Application Server /javaee/logs/ nodes/localhost-domain1/Web1/access 86400 -fnum 8 -diff 540" hws_std PidFile "installation_directory_for_Application_Server/javaee/logs/nodes/ localhost-domain1/Web1/httpd.pid" HWSTraceIdFile "installation_directory_for_Application_Server/javaee/ logs/nodes/localhost-domain1/Web1/hws.trcid" HWSTraceLogFile "installation_directory_for_Application_Server/javaee/ logs/nodes/localhost-domain1/Web1/hws.trclog" SSLDisable TypesConfig "installation_directory_for_Application_Server/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/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/httpsd/htdocs"> Options None AllowOverride None </Directory> <FilesMatch "^\.(ht|key)"> Order allow,deny Deny from all </FilesMatch> Include "installation_directory_for_Application_Server/javaee/glassfish/ nodes/localhost-domain1/Web1/root/conf/reverse_proxy.conf" HWSGracefulStopLog On HWSGracefulStopTimeout 0 HWSPrfId PRF1
- 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/
- proxy_balancer.conf
-
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so LoadModule slotmem_shm_module modules/mod_slotmem_shm.so HWSSuppressModuleTrace mod_proxy.c hook HWSSuppressModuleTrace mod_proxy_balancer.c ProxyVia Off ProxyTimeout 200