Configuring Synchronization with a Web Server
The functionality described on this page and in the whole Working with Web Servers: Copying Files chapter is available only in the Ultimate Edition of IntelliJ IDEA.
IntelliJ IDEA distinguishes among in-place, local, and remote servers, however the meaning of these terms in the context of IntelliJ IDEA slightly differs from their common meaning:
- An in-place server is a server whose document root is the parent of the project root, either immediate or not. In other words, the Web server is running on your computer, your project is under its document root, and you do your development directly on 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.
- A remote server is a server on another computer (remote host).
For more information about possible configuration of the production and development environment and working with servers from IntelliJ IDEA, see Deploying your application.
Server access configuration
IntelliJ IDEA controls interaction with Web servers through server access configurations. Anytime you are going to use a server, you need to define a server access configurations, no matter whether your server is on a remote host or on your machine.
A server access configuration defines:
- The server type (in-place, local, or remote).
- The computer (host) where the server is running. For in-place and local servers, IntelliJ IDEA presupposes that it is the current computer where your project is.
- The server access configuration root: the highest folder in the server hierarchy that can be accessed through the server configuration.
- The URL address to access the server configuration root. Both the HTTP and the HTTPS protocols are supported.
To access a server through HTTPS, you need to acquire a certificate file
<certificate_name>.certsigned by a recognized authority and import this certificate in the truststore/keystore of the Oracle JRE (Java Runtime Environment) on which IntelliJ IDEA runs. Note that self-signed certificates are rejected as unsafe.
To import a certificate in Oracle JRE:
- Open the embedded Terminal and type the following command: If you are using the Oracle JRE bundled with IntelliJ IDEA, the default path to the truststore/keystore is
<jre_home>/bin/keytool.exe -importcert -keystore <path to jre truststore/keystore> -file <full_path_to_<cert_name>.cert>
Otherwise it is
- When asked to enter a password for the truststore/keystore, specify the default one
- Open the
IntelliJ IDEA.exe.vmoptionsfile in the
<IntelliJ IDEA_installation_folder>/binand add the following line to it:
-Djavax.net.ssl.keyStore=<path to keystore>
- Restart IntelliJ IDEA.
- Open the embedded Terminal and type the following command:
- The protocol to transfer the data through.
- Correspondence between local (project) folders, destination folders on the server, and URL addresses to access the data on the server. This correspondence is called mapping.
You can define as many configurations as necessary, thus enabling flexible switching between upload/download setups.