Hitachi

Hitachi Application Server V10 User's Guide (For Windows® Systems)


9.2.2 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

Intended users

Storage location and file names of the server templates

The file names of the server templates are as follows:

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:

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

  1. If you are using a hardware load balancer, then block it.

    For more information about blocking, refer to the hardware load balancer manual.

    If the performance tracer, server instance, and web server are not stopped, go to step 2.

    If the performance tracer, server instance, and web server are already stopped, omit steps 1 to 5.

  2. To stop all performance tracers, server instances, and web servers at the same time, execute the stop-servers subcommand of the asadmin utility command.

    asadmin stop-servers

    When this command is run, the result is displayed as follows:

    Command stop-servers executed successfully.
  3. To display a list of performance tracers, run the list-prfs subcommand of the asadmin utility command.

    asadmin list-prfs

    When this command is run, the result is displayed as follows. Ensure that the statuses of the performance tracers are not running.

    performance_tracer_name not running
    Command list-prfs executed successfully.
  4. To display a list of server instances, run the list-instances subcommand of the asadmin utility command with the --long option specified.

    asadmin list-instances --long=true

    When this command is run, the result is displayed as follows. Ensure that the statuses of the server instances are not running.

    server_instance_name host_name port_number process_ID cluster_name not running
    Command list-instances executed successfully.
    
    • cluster_name is displayed only for cluster configurations that contain multiple Java EE servers.

  5. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are not running.

    web_server_name not running
    Command list-webservers executed successfully.
  6. 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.

    1. 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}
    2. Save the server template file.

    3. 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.
    4. 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.
      
  7. When specifying a directive directly, do the following:

    1. 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.

    2. Save the server template file.

      If you are finished making changes, go to step 8.

      If you want to change the following environment definitions, define each environment setting without starting the servers that configure Application Server.

      Application Server settings

      Java VM options

      Environment variables to be applied to the processing of the asadmin utility command

  8. To start Application Server at once, run the start-servers subcommand of the asadmin utility command.

    asadmin start-servers

    When this command is run, the result is displayed as follows:

    Command start-servers executed successfully.
  9. To display a list of performance tracers, run the list-prfs subcommand of the asadmin utility command.

    asadmin list-prfs

    When this command is run, the result is displayed as follows. Ensure that the statuses of the performance tracers are running.

    performance_tracer_name running
    Command list-prfs executed successfully.
  10. To display a list of server instances, run the list-instances subcommand of the asadmin utility command with the --long option specified.

    asadmin list-instances --long=true

    When this command is run, the result is displayed as follows. Ensure that the statuses of the server instances are running.

    server_instance_name host_name port_number process_ID cluster_name running
    Command list-instances executed successfully.
    
    • cluster_name is displayed only for cluster configurations that contain multiple Java EE servers.

  11. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are running.

    web_server_name   running
    Command list-webservers executed successfully.
  12. If you are using a hardware load balancer, unblock it.

    For more information about unblocking, refer to the hardware load balancer manual.