INITIAL PREPARATIONOn a fresh Windows Server, the Server-Manager always pops up.
To avoid this, go to the Server Manager Properties (on the first of the right upper side menus) and activate "Do not start Server Manager on login" (or whatever the original English wording is for this)
Download and install Chrome to have a decent browser
(on fresh Windows Servers, you need to deactivate the sharp Internet Explorer Security Settings to do this, don't blame me...)
Download and install Notepad++ as text editor
Download and install Foxit PDF Reader
Install latest Java
(Best would be the SDK, because then you have the option to run the debugger on the server)
INSTALLING POSTGRESInstall the postgres version of your choice from the EDB website, using
https://www.postgresql.org/download/(We install currently the version 9.4.11, as this still has the pgAdmin3, while postgres 9.5 and up uses the completely new pgAdmin4 which has still some bugs. But it is certainly also possible to install the latest postgres and still use pgAdmin3.)
In postgres, create a new user named "DBA", give the user a password you can easily remember and give that user all rights except the superuser right
In postgres, create two new empty databases with owner DBA:
a) servoy_repository
b) databaseNameOfYourOwnServoyApplication
When you use UUIDs and you need the postgres functions to create those, like UUID_generate_v4(), fire this SQL command to enable postgres to do so:
CREATE EXTENSION "uuid-ossp";
INSTALLING SERVOYNow install Servoy Application Server and use the third option "Connect to an existing database" instead of letting Servoy install postgres.
(The advantage is that you have then full control of which version of postgres you want to install)
On the Windows Server, search for the command-line interpreter with "cmd" but do not start it.
Instead, right click on it and start it as an administrator.
(We assume that you have full admin rights on your Windows Server)
Using cmd now, go to the directory {servoyFolder}/application_server and call this bat command to create the needed servoy repository tables in that database:
servoy_server.bat -upgradeRepository
You should get prompts that this was successful.
Check in postgres if there are now 14 tables in the database servoy_repository with the help of the refresh function (right click on the database)
At this point we had once problems, so we checked the file {servoyFolder}/servoy.properties and saw a wrong URL path in the line
server.0.URL=jdbc\:postgresql\://localhost\:5432/servoy_repository
After we corrected it, the bat file worked.
Another problem we ran into was that I forgot to create a password in postgres for the new user DBA.
servoy_server.bat -upgradeRepository then did not tell it had success.
Instead, when looking at ...\application_server\servoy_log.txt I saw that there was a password problem.
After giving the DBA the needed password, that was also written in the servoy.properties, all went well.
INSTALLING SERVOY AS SERVICENow we want to install Servoy as a Windows Service that will start automatically when the Windows Server starts.
To do this, we check first the file {servoyFolder}/application_server/service/wrapper.conf
In that file, all absolute paths of Servoy need to be checked, like this one:
wrapper.java.library.path.1=C:\Servoy\application_server\service
(In case you moved or copied an existing Servoy folder to a new Server and/or another folder, which is possible, those paths would need to be adjusted)
Also, you can adjust the following line to more memory to increase performance (in case you have that memory)
wrapper.java.maxmemory=1280
My own rule of thumb is to give it two third of the available memory, as our Servoy AppServers are always dedicated servers where only postgres runs additionally.
Would be happy to hear other thumb rules.
Now go to
{servoyFolder}/application_server/service
and run install_service.bat
This will install Servoy as a Windows Service
Search for the app "service" on the Windows Server and open the Services List.
(In case it runs already, refresh the list)
Scroll down to "Servoy Application Server", right click on it and start it.
Scroll a bit up to see the other needed service, the postgres Service.
Both should now run and should be configured as start type "automatic", as that will make sure that both will start automatically when the server went down and starts up again.
Next would be to open the Servoy Admin Page in your browser, by typing this into the browser line:
http://localhost:8080/servoy-admin/Press Ctrl+D to add this to the bookmarks bar, and tell Chrome in the settings to show that bar (or use CTRL-SHIFT-B to do so).
Now you can also see if you installed the right Java Version with 64 Bit usually. On the main Servoy Admin Page you should see:
JVM Information
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.version=1.8.0_121
When by mistake the 32-Bit version was installed, there are six steps to correct this:
1.Stop Servoy Server
2.Deinstall wrong Java Version
3.Install right Java Version
4.Make a new fake Servoy Installation in another folder, to get the right 64-bit-wrapper installed in the service subfolder (as Servoy installed the 32-Bit-Version due to the 32-Bit-Java)
5.Copy from that fake Servoy Installation all files from the service subfolder instead of the wrapper.conf file
6.Put those files into your original Servoy Installation into the service folder
Now click "Users" in the menu on the left side and create the new user "admin" with a password.
After that, that user will appear in the user list on that page.
Click on the user "admin" and add the user to the group "Administrators" with the appropriate button
ADDING APPLICATION DATABASENow there is a trick to force Servoy to overwrite the file servoy.properties :
Go to the main menu by clicking on the Servoy Logo (or by refreshing
http://localhost:8080/servoy-admin/)
Scroll down a bit and change the property servoy.smartclient.showMenuBar to false.
Scroll down to the bottom and click on SaveSettings
Now scroll up again and click on "Shutdown Servoy Application Server".
This is needed as we want to edit the servoy.properties manually.
Edit {servoyFolder}/servoy.properties and duplicate all lines that begin with
server.0.
In the duplicated block, change the 0 to 1, and adjust the two lines URL and serverName to the name of yourOwnApplicationDatabaseName
That part should then look like this:
- Code: Select all
server.0.URL=jdbc\:postgresql\://localhost\:5432/servoy_repository
server.0.catalog=<none>
server.0.driver=org.postgresql.Driver
server.0.password=encrypted\:cXM/xxx\=
server.0.schema=<none>
server.0.serverName=repository_server
server.0.userName=DBA
server.1.URL=jdbc\:postgresql\://localhost\:5432/yourOwnApplicationDatabaseName
server.1.catalog=<none>
server.1.driver=org.postgresql.Driver
server.1.password=encrypted\:cXM/xxx\=
server.1.schema=<none>
server.1.serverName=yourOwnApplicationDatabaseName
server.1.userName=DBA
At the very top, change the numberOfServers to 2, resulting in this line:
- Code: Select all
ServerManager.numberOfServers=2
Save servoy.properties and close that file.
Now go to Windows Services and refresh the list (there's a refresh button on top), the ServoyServer should not run.
Restart the server in the Windows Services with right click as we did above (or with the green arrow button).
When you now go to
http://localhost:8080/servoy-admin/in your browser and click on the left on DatabaseServers, you will see two databases connected there.
LICENSINGMake sure you get the proper licenses and install them in the Servoy Admin.
CREATING AN EMPTY APPLICATION DATABASEWith the following SQL command it is possible to see the number of records from all your tables.
It holds a condition to exclude tables that begin with app_, as in those we store all application data that every system needs in the beginning.
When adding " AND reltuples > 0" it will show only the tables that have any records
- Code: Select all
SELECT relname, reltuples::int
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE
nspname NOT IN ('pg_catalog', 'information_schema') AND
relkind='r' AND
LEFT(relname, 4) <> 'app_'
ORDER BY relname
I used that SQL to create a SQL script to get a complete empty database, which I then install at a new customer:
- Code: Select all
SELECT 'TRUNCATE ' || relname || ' ;' AS sql_command
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE
nspname NOT IN ('pg_catalog', 'information_schema') AND
relkind='r' AND
LEFT(relname, 4) <> 'app_'
ORDER BY relname
That gives me an output like this, where I can put in "--" at the beginning when I want to exclude a table from truncating:
- Code: Select all
TRUNCATE accounting_areas ;
TRUNCATE accounts ;
TRUNCATE additional_meal_allowances ;
-- TRUNCATE address_formats ;
TRUNCATE addresses
...
SETUP FOLDERI created a separate folder servoyAppServerSetup on my own pc to store all necessary files that I need to transfer to a new App Server.
It holds:
1. A postgres backup of my application database, with most tables empty as explained above
2. A subfolder called codeSigner with four files:
CodeSigner8.101.jar
startCodeSigner8.bat
CodeSigner.properties
xxx.jks (our Java keyStore file)
The codeSigning tool from Patrick Talbot can be downloaded from
https://www.servoyforge.net/projects/code-signer (Don't forget to use the donate button there when you use this great tool...)
The properties file is automatically created when using the codeSigner the first time.
The bat file was written by Harjo to set more memory, it holds this line:
java -Xms256m -Xmx1g -jar CodeSigner8.101.jar
3. plugins.zip which holds the complete plugins folder from your own Servoy Developer installation, needed when you added or updated any plugins yourself
(Note: There may not be any zip-files inside the plugins folder, as Java will use them too)
4. appNameVersionX.servoy as the Servoy Application export file
FINAL PREPARATIONSCopy over the servoyAppServerSetup to the target server.
Unzip the plugins folder.
Shutdown Servoy App Server.
Delete the folder {servoyFolder}/application_server/plugins with the plugins from the initial Servoy setup.
Copy the content of your own plugins folder there.
Copy the content of the codeSigner folder to {servoyFolder}/application_server to prepare code signing
In case you have report files like from JasperReports, copy them over to their final destination
In our case, we store them in
{servoyFolder}\application_server\server\webapps\ROOT\uploads\reports
CODE SIGNINGCall a CMD command line interpreter with Administrator rights
Goto folder {servoyFolder}/application_server
Call startCodeSigner8.bat
Choose all jars and start signing
RESTORE APP DATABASENow restore the application database.
I had exit code 1 (error) when doing this with the DBA role, as the creation of an extension could not be executed, but with role postgres all went fine then.
(When such a restore goes wrong, I always delete the complete database and create it new.)
IMPORT SOLUTIONTataaa! We are finally able to import our solution.
Start the Servoy App Server again in the windows services.
Import the servoy file.
Then you can put this into the browser to start the jnlp-file-download.
http://localhost:8080/servoy-client/appName.jnlpDoubleclick the file which will automatically install a desktop icon.
(In case there are ever problems with that icon, delete the Java Cache and repeat that process of downloading and starting the jnlp.)
When I started the application then the first time, Java told me it wants to use an older Java version that is not installed.
So I changed this two settings in the main Servoy Admin Page to avoid this in future (was originally Java6/Java7).
Save a the website bottom, Server restart is needed then:
servoy.smartclient.min_java_version: Java8
servoy.smartclient.max_java_version: Java8
When trying to print a Jasper Report, I got the error message "Class not whitelisted for RMI".
This will solve that issue:
viewtopic.php?f=15&t=21588&p=115989#p115989