GoLand 2020.3 Help

Create a local server configuration

In the local server configuration, you do your development, then copy the sources to the server.

A local server is a server that is running in a local or a mounted folder and whose document root is NOT the parent of the project root.

To configure access to the server in this set-up, you need to specify the following:

  1. The server configuration root folder and the URL address to access it.

  2. Correspondence between the project root folder, the folder on the server to copy the data from the project root folder to, and the URL address to access the copied data on the server. This correspondence is called mapping.

Local or mounted server configuration

Specify the name, type, and visibility of a server configuration

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, select Deployment under Build, Execution, Deployment.

    • Choose Tools | Deployment | Configuration from the main menu.

  2. In the left-hand pane that lists all the existing server configurations, click Add Add item and select Local or mounted folder in the popup menu.

  3. In the Create new server dialog that opens, type the name of the server to create and click OK. The Create new server dialog closes and you return to the Connection tab of the Deployment node.

  4. Click the Use as Default the Use as default button to have GoLand silently apply the current configuration in the following cases:

  5. Use the Visible only for this project checkbox to configure the visibility of the server access configuration.

    • Select the checkbox to restrict the use of the configuration to the current project. Such configuration cannot be reused outside the current project. It does not appear in the list of available configurations in other projects.

      The server records are stored in the .idea directory together with the project, which allows sharing them between team members through a VCS.

      In the server access configurations list in the left-hand pane, the configurations visible only in the current project are marked with the Visible only in current project icon icon.

    • When the checkbox is cleared, the configuration is visible in all GoLand projects. Its settings can be reused across several projects.

Specify the server configuration root and the URL address to access it

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, select Deployment under Build, Execution, Deployment.

    • Choose Tools | Deployment | Configuration from the main menu.

  2. Click the Connection tab.

  3. In the Folder field, specify the server configuration root.

    The server configuration root is the highest folder in the file tree on the server that can be accessed through the server configuration. The easiest way is to use the document root of your Web server as defined in the Web server configuration file. However you can appoint any other existing folder under the document root.

  4. In the Web server URL field, specify the URL address of the server configuration root. This URL address will be the starting point for building the URL address of your application. Depending on your choice of the server configuration root, do one of the following:

    • Type the URL address associated with the document root of your Web server as defined in the Web server configuration file.

    • Type the URL address in the following format:

      <Server document root URL>/<path to the folder relative to the server document root>

    Both the HTTP and the HTTPS protocols are supported.

Local or mounted server configuration

Map project folders to folders on the server and the URL addresses to access them

Configure mappings, that is, set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. The easiest way is to map the entire project root folder to a folder on the server. The project folder structure in this case will be repeated on the server, provided that you have selected the Create Empty directories checkbox in the Options dialog.

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, select Deployment under Build, Execution, Deployment.

    • Choose Tools | Deployment | Configuration from the main menu.

  2. Click the Mappings tab.

  3. In the Local Path field, specify the full path to the desired local folder. In the simplest case it is the project root.

  4. In the Deployment Path field, specify the folder on the server where GoLand will upload the data from the folder specified in the Local Path field. Type the path to the folder relative to the server configuration root.

    If the folder with the specified name does not exist yet, GoLand will create it, provided that you have selected the Create Empty directories checkbox in the Options dialog.

  5. In the Web Path field, type the path to the folder on the server relative to the server configuration root. Actually, type the relative path you typed in the Deployment Path field.

Local or mounted server mappings
Last modified: 03 September 2020