# Servers Manager

Before you can deploy an enterprise application, web application, JSP file, servlet, or EJB module, an instance of the server to which you are going to deploy needs to be registered with the IDE.

The Servers Manager enables you to register and remove server instances and to specify additional configuration details for registered server instances. The settings that are available depend upon the server type.

Element | Description
--- | ---
Servers | This panel displays a list of registered server instances.
Add Server | Click to open the Add Server Instance dialog box.
Remove Server | Click to remove the server instance that is selected in the Servers panel.
Server Name | Name specified for the server instance when the server was added. This field is read-only.
Server Type | Type of the server instance. This field is read-only.

You can modify the following settings for registered instances of the Apache Tomcat or TomEE web servers.

Element | Description
--- | ---
Connection | The Connection tab enables you to set the server port numbers and the username and password for the manager role. You can view the server password by clicking Show next to the password field. You can also enable the HTTP monitor in this tab.
Catalina Home | Specifies the location of the server installation.
Catalina Base | Specifies the base directory for the Tomcat Web Server. You can set this property when you add a Tomcat Web Server to the Server Manager. If you set a base directory, then that is where the Tomcat configuration files reside. One reason for specifying a separate base directory is to allow more than one user to use the same server. If no base directory is specified, then the configuration files reside in the home directory.
Username | Specifies the user name that the IDE uses to log into the server's manager application. The user must be associated with the manager role. The first time the IDE starts the Tomcat Web Server, such as through the Start/Stop menu action or by executing a web component from the IDE, the IDE adds an admin user with a randomly-generated password to the tomcat-base-path`/conf/tomcat-users.xml` file. (Right-click the Tomcat Web Server instance node in the Services window and select Properties. In the Properties dialog box, the Base Directory property points to the `base-dir` directory.) The admin user entry in the `tomcat-users.xml` file looks similar to the following: `<user username="ide" password="woiehh" roles="manager"/>`
Password | Specifies the user's password. See the explanation for the Username property above for details.
Server Port | Specifies the number of the TCP/IP port that the server listens on. The URL for a web application that is deployed on the server is derived from the host's URL and the server port, such as `http://localhost:8086`.
Shutdown Port | Specifies the port number on which the server waits for a shutdown command.
Enable HTTP Monitor | If selected, this checkbox enables the HTTP Monitor for web applications executing on the Tomcat Web Server. When enabling the monitor, you must restart the server in order for the change to take affect. The HTTP Monitor is useful for debugging web applications. If you are using the server for production purposes only, you may want to clear the checkbox to reduce its impact on the server's performance. When you clear the checkbox, the IDE removes the HTTP monitor's declaration from the server. However the monitor's libraries remain deployed to the server. When you disable the HTTP Monitor, you must restart the server for the change to take affect.
Startup | The Startup tab enables you to specify a custom Catalina script for startup and debugger transport options.
Use Custom Catalina Script | When selected the server is started using a custom a Catalina script. Click Browse to specify the location of the custom script. This is deselected by default.
Force Stop | Specifies whether to use the force shutdown (shutdown is followed by the kill command). This is unchecked by default. This function is disabled on Windows.
Debugger Transport | Enables you to select either shared memory or socket based transport for debugging.
Shared Memory Name | When selected, the transport is set to `dt_shmem`. You can type a shared memory name or use the default name. This option is selected by default on Windows.
Socket Port | When selected the Java Platform Debugger Architecture (JPDA) transport is set to `dt_socket` and the JPDA address is set to the specified socket port number when the server is started in debug mode. The Shared Memory transport option is only available on Windows. If you want to use the JPDA socket transport for debugging on Windows, select Socket Port and specify the JPDA port number.
Platform | This Platform tab enables you to specify the Java platform for the server and any VM options.
Java Platform | Specifies the Java Platform the server will use. By default the server will use the same Java Platform as is used by the IDE. Click Manage Platforms to open the Java Platform Manager.
VM Options | Specifies the Java Virtual Machine options.
Use IDE Proxy Settings | When selected, the server uses the proxy settings for the IDE.
Use Security Manager | If selected, this checkbox enables the Tomcat Web Server to be started with the `-security` option. The security policy implemented by the Security Manager are configured in the `catalina.policy` file, which is in the Tomcat home directory's `conf` folder.
Deployment | The Deployment tab enables you to specify the timeout length for deployment. You can also enable automatic JDBC driver deployment to the server if required.
Deployment Timeout(s) | Specifies the length of server timeout(s).
Enable JDBC driver deployment | Specifies whether to enable JDBC driver deployment. This is checked by default.
Classes | The Classes tab lists all classes associated with the server instance.
Sources | The Sources tab lists all sources associated with the server instance. You can use this tab to add and remove JARs and folders.
Javadoc | The Javadoc tab lists all Javadocs associated with the server instance.

You can modify the following settings for registered instances of GlassFish Server 3.x and GlassFish Server 4.x.

Element | Description
--- | ---
Common | The Common tab enables you to enable and disable the following options:
Location | Type of the server instance. This field is read-only
Domains Folder | Enter the host name or IP address for the remote Glassfish 3 server.
Domain Name | Enter the port number used to communicate with the remote server. The default port is 4848.
Target | (Optional) Enter a value that is used to identify a cluster and/or stand-alone instance. This value will be used as the value for the target option when running server administration tasks from the IDE. For example, if you have a cluster identified as cluster1 and enter cluster1 as the Target value, when you deploy an application from the IDE to the server the application will be deployed to every instance in the cluster (asadmin deploy --target cluster1 --name myapp myapp.war). When no Target value is specified (default) all commands will be applied to the domain administration server instance.
Username | Type the username for the server instance.
Password | Type the password for the server instance.
Enable Comet Support | When selected, Comet support is enabled to allow a persistent connection between the server and the client and enable the server to push data when available. This option is disabled by default.
Enable HTTP Monitor | When selected, HTTP server-side monitoring is started when an application is deployed to the server. The HTTP Server-Side Monitor gathers data about HTTP requests that are processed by the servlet engine. For each HTTP request that is processed, the monitor records data about the incoming request and the data states maintained on the server. This option is disabled by default.
Enable JDBC Driver Deployment | When selected, JDBC drivers are deployed to the server if required. This option is disabled by default.
Preserve Sessions Across Redeployment | When selected, the server preserves active HTTP sessions when an application is redeployed. This option is enabled by default.
Start Registered Derby Server | When selected, the Derby database server is started when the application server is started. This option is enabled by default.
Java | The Java tab enables you to specify the following options:
Java Platform | Enables you to specify the Java Platform the server will use. By default the server will use the same Java Platform as is used by the IDE. Click Manage Platforms to open the Java Platform Manager.
Debug Settings | Enables you to select either shared memory or socket based transport for debugging. You can also select Address to specify a transport address or JPDA port according to the specified debugging transport.
Use IDE's proxy settings | When selected, the IDE proxy settings are used for debugging.

Note: When you register an existing domain, the IDE uses the port numbers and other properties specified in the domain configuration.

Note: A username and password are required to work with a remote instance of GlassFish Server 3.1.2 and GlassFish Server 4.x. To accept remote admin requests the secure administration feature on the remote instance must be enabled. The secure administration feature cannot be enabled if any admin accounts on the remote instance have an empty password.

Related Topics

Developing Applications with NetBeans IDE,

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.