Work with web server properties files
Use properties files to create, modify, or delete web server properties.
Determine the changes to make to your Web server configuration or its configuration objects.
Start the wsadmin scripting tool. To start wsadmin using the Jython language, run the wsadmin -lang jython command from the bin directory of the server profile.
Use a properties file to create a web server instance. We can also modify or delete web server properties.
Run administrative commands using wsadmin to extract a properties file for a web server, validate the properties, and apply them to the configuration.
Action Procedure create
- Create a properties file that specifies the following commands in the header and sets values for web server properties:
CreateDeleteCommandProperties=true SKIP=false commandName=createWebServer- Run the applyConfigProperties command.
modify Edit properties and then run the applyConfigProperties command to modify the value of a custom property. delete Properties to delete in the properties file and then run the deleteConfigProperties command to delete a property. If the deleted property has a default value, the property is set to the default value. create Property Not applicable delete Property Not applicable Optionally, we can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Tasks
- Create a properties file for a WebServer instance.
- Open an editor and create a properties file that specifies commands to create a WebServer instance and its properties.
For example, create a properties file such as the following for a WebServer instance:
# # Header # CreateDeleteCommandProperties=true SKIP=false commandName=createWebServer # # #Properties # name=IHS #String,required templateLocation=null #javax.management.ObjectName genUniquePorts=null #Boolean bitmode=null #String specificShortName=null #String clusterName=null #String targetObject=targetObject #null,required templateName=null #String genericShortName=null #String # # Step parameters # CreateDeleteCommandProperties=true SKIP=true stepName=serverConfig # # #Properties # webAppMapping=null #String pluginInstallRoot=null #String webProtocol=null #String webPort=null #Integer configurationFile=null #String serviceName=null #String errorLogfile=null #String webInstallRoot=null #String accessLogfile=null #String # # Step parameters # CreateDeleteCommandProperties=true SKIP=true stepName=remoteServerConfig # # #Properties # adminPort=null #Integer adminProtocol=null #String adminPasswd=null #String adminUserID=null #StringThe properties file sets the CreateDeleteCommandProperties command to true in the header and steps. It creates a web server named IHS and, in the steps, configures a server and a remote server.
- Run the applyConfigProperties command to create a web server configuration.
Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
- Modify the properties file.
- Open the properties file in an editor and change the properties as needed. Ensure that the environment variables in the properties file match the system.
To specify a custom property, edit the AttributeInfo value and properties values; for example:
# # Header # ResourceType=WebServer ImplementingResourceType=WebServer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:WebServer= AttributeInfo=components # # #Properties # name=IHS webserverAdminProtocol=HTTP #ENUM(HTTPS|HTTP),default(HTTP) logFilenameError="${WEB_INSTALL_ROOT}/logs/error.log" configurationFilename="${WEB_INSTALL_ROOT}/conf/httpd.conf" server=IHS#ObjectName(Server) logFilenameAccess="${WEB_INSTALL_ROOT}/logs/access.log" parentComponent=null webserverProtocol=HTTP #ENUM(HTTPS|HTTP),default(HTTP) serviceName=IBMHTTPServer7.0 webserverInstallRoot="C:\IBM\HTTPServer" webserverType=IHS #ENUM(HTTP_SERVER|IIS|DOMINO|APACHE|SUNJAVASYSTEM|HTTPSERVER_ZOS|IHS),default(IHS) # EnvironmentVariablesSection # # #Environment Variables cellName=myNode04Cell nodeName=myNode04 serverName=IHS- Run the applyConfigProperties command to change a web server configuration.
Running the applyConfigProperties command applies the properties file to the configuration.
- Delete web server properties.
To delete one or more properties, specify only those properties to delete in the properties file and run deleteConfigProperties.
AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]')
Use the properties file to configure and manage the web server instance and its properties.
What to do next
Save the changes to the configuration.
Subtopics
- Work with plug-in properties files
Use properties files to create, modify, or delete web server plug-in properties and custom properties.- Work with plug-in server cluster properties files
Use properties files to modify or delete plug-in server cluster properties of web servers.- Key store property files
Use properties files to modify or delete key store file properties of web servers.- Work with administrative server authentication properties files
Use properties files to modify or delete administrative server authentication properties of web servers.- Work with web server process definition properties files
Use properties files to modify or delete process definition properties of web servers.- Work with web server JVM properties files
Use properties files to modify or delete JVM properties of web servers.- Work with web server JVM system properties files
Use properties files to create, modify, or delete web server Java virtual machine (JVM) system custom properties.
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting Deleting server, cluster, application, or authorization group objects using properties files Create, modifying, and deleting configuration objects using one properties file PropertiesBasedConfiguration .