Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage specific configuration objects using properties files
Work with web server properties files
We can 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 wsadmin.sh.
To start wsadmin using the Jython language, run...
WP_PROFILE/bin/wsadmin -lang jython
Use a properties file, you can 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.
Actions for web server properties files. We can create web server instances and modify or delete web server properties.
Action Procedure create 1. Create a properties file that specifies the following commands in the header and sets values for web server properties: CreateDeleteCommandProperties=true SKIP=false commandName=createWebServer2. Run applyConfigProperties.
modify Edit properties and then run applyConfigProperties to modify the value of a custom property. delete Specify the properties to delete in the properties file and then run deleteConfigProperties 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, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- 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 applyConfigProperties to create a web server configuration.
Run applyConfigProperties 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 applyConfigProperties to change a web server configuration.
Run applyConfigProperties 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]')
Results
We can 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.
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Delete server, cluster, application, or authorization group objects using properties files
Create, modifying, and deleting configuration objects using one properties file
Related
PropertiesBasedConfiguration command group using wsadmin.sh