CKFinder Installation

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

This article describes how to install CKFinder for Java.

Installation Procedure

To install CKFinder, download the CKFinder for Java distribution package (a .war file) from the official download site. You will need to deploy this file to your Java server and run as an application. For detailed instructions on how to run CKFinder on one of the most popular Java servers refer to an appropriate section below.

Running the Sample Application

A test application is available in the _samples folder of the distribution package. After the deployment open the _samples/index.html page in your Web browser to see a few usage scenarios for CKFinder.

Basic Configuration

When your application works correctly in the browser, it is time to review its configuration. Go to the config.xml file where you can customize your application. See the Configuration section for more information about the CKFinder configuration.

Please note that due to security reasons by default CKFinder is disabled. When you reviewed the settings and are ready to go, open the configuration file and enable the program.

<enabled>true</enabled>

Deployment on a Server

The CKFinder Java connector supports the following servers:

  • Tomcat 5.5-8,
  • Jetty 7-9,
  • JBoss 6-7,
  • GlassFish 3.0-4.0,
  • Weblogic 11g-12c.

For detailed instructions on how to deploy CKFinder for Java to one of the supported servers, please refer to an appropriate section below.

Tomcat

Place the CKFinder Java .war file in the Tomcat webapps folder. Go to Tomcat bin folder and run the startup script file for your operating system — startup.bat for Windows or startup.sh for Linux. When you are running Tomcat as a service, restart the server.

By default Tomcat has the autoDeploy="true" option enabled (check the Host element in the server.xml file). If this option was not changed, running the application should also be possible after you copy it to the webapps folder without stopping the server.

By deafult, the application should be available under the following URL in your browser: http://localhost:8080/CKFinderJava/

Please note that the HTTP 8080 port of the sample URL is the default Tomcat port. If you changed this value while configuring your Tomcat installation, you will need to use a modified port value to run the sample application.

Go to the Tomcat FAQ and Tomcat 5.5 or Tomcat 6, or Tomcat 7, or Tomcat 8 documentation for more information about using this server.

Jetty

Place the CKFinder Java .war file in the Jetty webapps folder. In the command line go to the root of the Jetty server and start it with a java -jar start.jar command.

By deafult, the application should be available under the following URL in your browser: http://localhost:8080/CKFinderJava/

Please note that the HTTP 8080 port of the sample URL is the default Jetty port. If you changed this value while configuring your Jetty installation, you will need to use a modified port value to run the sample application.

By default Jetty unpacks war files to folders like C:\Users\admin\AppData\Local\Temp\jetty-0.0.0.0-8080-CKFinderJava.war-_CKFinderJava-any-\webapp\. Information about this folder is displayed in the output console, when the server is started.
If you wish to change this folder, you can either put the unpacked CKFinderJava.war file in the webapps folder (Jetty will use the unpacked application folder) or go to jetty7(8)\etc\jetty-webapps.xml or jetty9\etc\jetty-deploy.xml and set the below parameter to the folder path of your choice:

<Set name="tempDir"><New class="java.io.File"><Arg>C:\tmp</Arg></New></Set>

Go to the Jetty 7, Jetty 8, or Jetty 9 Quick Start guide for more information about using this server.

JBoss 6

The server can be started from the command line. Go to the JBoss bin folder and run the following command:

  • Windows: run.bat
  • Linux: run.sh

JBoss Application Server ships with five different server configurations: all, default, standard, minimal and jbossweb-standalone. This is because one may want to start server with selected services only.
The Above command will start the server in its default mode. However, if you want to use a different configuration, e.g. start the server with all services available, you would have to pass the –c parameter with an appropriate configuration. In this case use the all value:

  • Windows: run.bat -c all
  • Linux: run.sh -c all

NOTE: In this example we are going to work with a single standalone server.

After the server was started, log into administration console, go to the Web Application (WAR)s menu and click the Add new resource button. In the Add New Web Application (WAR) window specify the path to CKFinder Java .war file, and optionally check one of the following options:

  • Deploy Exploded – for most usage scenarios,
  • Deploy Farm – when the server works in a cluster.

If you don't select any of the options above, JBoss will be instructed to deploy CKFinder for Java as a packed war file. The application will be deployed after you click the Continue button.

Please bear in mind that JBoss has auto-deploy mode turned on by default so it is enough to drop the CKFinderJava.war file or CKFinderJava unpacked folder into an appropriate directory. If you started your server with standard configuration (run –c standard), please drop CKFinderJava.war or CKFinderJava folder to the JBOSS_HOME/server/standard/deploy directory and the server will do the rest.
Dropping packed archive is advised for production while dropping exploded folder is advised for development since you can do partial redeployments of the application with the exploded directory.

By deafult, the application should be available under the following URL in your browser: http://localhost:8080/CKFinderJava/. The HTTP 8080 port of the sample URL is the default JBoss port. If you changed this value while configuring your JBoss installation, you will need to use a modified port value to run the sample application.

Go to the JBoss AS6 Documentation site for more information about using this server.

JBoss 7

The server can be started from the command line. Go to the JBoss bin folder and run the following command:

  • Windows: standalone.bat or domain.bat
  • Linux: standalone.sh or domain.sh

JBoss Application Server 7 can run in two modes: standalone and domain. First one allows running a single standalone Server, while the latter is used to manage multiple physical (or virtual) machines from a single control point.
NOTE: In this example we are going to work with a standalone server.

The above two commands start servers with their default configurations. If one wishes to start the server with one of alternative configurations, one should pass the --server-config argument with the server configuration file to be used. The example below shows how to run the full profile configuration with high availability:

  • Windows: standalone.bat --server-config=standalone-ha.xml
  • Linux: standalone.sh --server-config=standalone-ha.xml

You can read more about available JBoss 7 configurations here.

After the server was started, log into administration console, go to the Runtime Tab, select Managed Deployments menu, click the Add contents button and select CKFinderJava.war file. Once CKFinderJava.war upload is finished, press the Enable button. The Application is now ready to use. Another way of deploying the CKFinderJava application is using JBOSS Command Line Interface (CLI):

  • In standalone mode: [standalone@localhost:9999 /] deploy ~/Desktop/CKFinderJava.war
  • In domain mode: [domain@localhost:9999 /] deploy ~/Desktop/ CKFinderJava.war --all-server-groups

NOTE: Either --all-server-groups or --server-groups must be specified.

To learn more about CLI please see this link.

If your Server is running in the standalone mode, then aside from using the administration console and CLI, JBOSS 7 can also work in manual and auto deployment mode (this depends on your settings).
In the Auto-Deploy mode the scanner directly monitors the deployment content, available in JBOSS_HOME/standalone/deployments directory, automatically deploying new content and redeploying content whose timestamp has changed. It means that you can simply drop CKFinderJava.war into deployments folder and the application will be deployed.
To undeploy CKFinderJava in auto mode simply remove war file from deploy directory.
In the Manual deploy mode the scanner does not directly monitor the deployment content. Instead, the scanner relies on a system of marker files, which the user can add to or remove from deployment directory. These files serve as a sort of command telling the scanner to deploy, undeploy, or redeploy the content. You can learn more about marker files in the "Marker Files" section available under this link.

To deploy CKFinderJava.war in manual mode, copy this file into the deployments directory and create the CKFinderJava.war.dodeploy file. CKFinder will be deployed and the CKFinderJava.war.deployed marker file will be created. To undeploy CKFinderJava simply remove CKFinderJava.war.deployed file.

Please note that by default JBOSS7 allows auto-deployment of zipped content and prevents auto-deployment of exploded content. This is because exploded content is vulnerable to the scanner trying to auto-deploy partially copied content. However, if you wish to change this behavior, you can go to the JBOSS_HOME/standalone/configuration/standalone.xml file, look for the 'deployment-scanner tag and change the deployment options as you like:

<deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" 
auto-deploy-zipped="true" auto-deploy-exploded="false"/>

By default, the application should be available under the following URL in your browser: http://localhost:8080/CKFinderJava/ Please note that the HTTP 8080 port of the sample URL is the default JBoss port. If you changed this value while configuring your JBoss installation, you will need to use a modified port value to run the sample application.

If you want to use international files names with CKFinder please see URI Encoding section which explains how to set UTF-8 on JBOSS.

Go to the JBoss AS7 Documentation site for more information about using this server.

GlassFish

The GlassFish server can be started from the command line. Go to the server bin folder and run the asadmin script. Next you need to start the domain which is a pre-requisite to upload the application or use the administrator's console. In this example we are going to use the test domain that is deployed with the servr. Run the start-domain command to start it.

The application can be uploaded to the server by using the command line or the administrator's console.

When using the command line, run the following:

  • deploy relativePath/CKFinderJava.war

Please note that the path to the CKFinder Java .war file is relative to the asadmin script that is located in the bin folder of GlassFish.

When using the administrator's console, log in and go to the Applications tab. Specify the location of the CKFinder Java .war file and set the application type to Web Application.

By deafult, the application should be available under the following URL in your browser: http://localhost:8080/CKFinderJava/

Please note that the HTTP 8080 port of the sample URL is the default GlassFish port. If you changed this value while configuring your GlassFish installation, you will need to use a modified port value to run the sample application.

By default, Glassfish has ISO parameter-encoding set, which may cause problems if your users want to use filenames with non-ISO characters. If CKFinder in your application is to be used worldwide, it is recommended to set UTF-8 for Glassfish. Please refer to the URI Encoding section for more details.

Go to the Oracle GlassFish 3.0 or, GlassFish 3.1 or GlassFish 4.0 Server Quick Start Guide for more information about using this server.

Weblogic

The Weblogic Server (WLS) can be started from the command line. Go to the weblogic_main_folder/user_projects/domains/your_domain/bin folder and run the following script:

  • Windows: startWeblogic.cmd or startManagedWebLogic.cmd
  • Linux: startWeblogic.sh or startWeblogicManagedServer.sh

If Weblogic is in production mode then please remember that you need to specify the user name and password in order to run it.

As you probably know, Weblogic Server uses domains which are logically related groups of server resources. A domain can consist of an Administration Server and one or more Managed Servers, or of a single standalone server that acts as an Administration Server and runs deployed applications. In this example we are going to use a single standalone Administration Server.

After starting Weblogic, log into the Administration Console and click Deployments in the Domain Structure upper left menu. If WLS is in production mode, you need to click Lock&Edit first. In main panel click the Install button, specify the path to CKFinderJava.war, and click the Next button. Select the "Install this deployment as an application" option and press the Next button. In the last panel you can change the name of your deployment, the security model and the source accessibility. Once you are done, click the Finish button and CKFinderJava will be deployed. If WLS works in production mode, you will need to confirm all changes by clicking the Activate Changes button and start the application manually by selecting it and pressing the Start button.

By deafult, the application should be available under the following URL in your browser: http://localhost:7001/CKFinderJava/

The HTTP 7001 port of the sample URL is the default Weblogic Administration Server port. If you changed this value while configuring your Weblogic domain(s), you will need to use a modified port value to run the sample application.

Go to the Weblogic 11g or Weblogic 12c Documentation site for more information about using this server.