Silo - Tips CPR Broker Installation and Setup Copyright 2013
Silo - Tips CPR Broker Installation and Setup Copyright 2013
Silo - Tips CPR Broker Installation and Setup Copyright 2013
© Copyright 2013
Requirements.........................................................................................................................5
System requirements..........................................................................................................5
Data requirements..............................................................................................................5
Needed information...............................................................................................................9
Windows.............................................................................................................................9
Web.....................................................................................................................................9
Database.............................................................................................................................9
Data providers....................................................................................................................9
Configuring security...........................................................................................................34
Restricting access to the website.....................................................................................34
Add necessary software and Configure IIS.................................................................34
Edit the site's configuration file....................................................................................35
Backend service...............................................................................................................36
Run the backend service as a local user.....................................................................36
Using SSL.........................................................................................................................38
CPR Broker 2
Note..............................................................................................................................38
Creating a certificate....................................................................................................38
Configuring HTTPS bindings.......................................................................................39
Person Master..................................................................................................................39
Scenarios.....................................................................................................................39
Limiting access to the service......................................................................................41
Setting up logging...............................................................................................................43
CPR Broker 3
Introduction
INTRODUCTION
This document will describe how to install CPR Broker.
CPR Broker includes two parts, the CPR Broker and the Event Broker. The installation
package installs both.
Before you begin, please make sure you have the requirement listed in the chapter
Requirements and also the information in chapter Needed information
Next, you can see the chapter Installing CPR Brokerfor details.
After the installation finishes, some configuration steps are necessary. See the chapter
Configuring CPR Broker for details.
CPR Broker 4
Requirements
1REQUIREMENTS
1.1System requirements
– Windows 2003 or Windows 2008 with IIS installed. Windows XP/Vista/7 with IIS
installed will work for demonstration purposes but not for production due to the 10
concurrent connections limit these operating system impose.
For Windows 2008 you need to make sure that you have the IIS 6 Management
Compatibility Role Service for Web Server (IIS) Role installed, as well as - of course
- the Web Server (IIS) Role itself. You should also install the .NET 3.5.1 Feature via
Server Manager.
Any computer capable of running the above software will also be capable of running CPR
Broker.
If your system meets all these requirements you don't need to read chapter 2. On the other
hand if your system is lacking something it might be a good idea to have a look at that
chapter.
1.2Data requirements
As of version 2.2 the CPR Broker sports historical data features - ie. performing periodical
lookups (lookup over a historical timespan). In order to take advantage of these historical
data features a subscription to historical data extracts from the CPR office is a
prerequisite.
CPR Broker 5
Preparing the system
2.1Installing IIS
As the CPR Broker is a web service it relies on a web server. On Microsoft platforms
Internet Information Server is the most common web server and therefore this has been the
choice.
Then go into 'Roles', select 'Add Roles' and choose 'Server Role':
CPR Broker 6
Preparing the system
In this dialog select the 'Web Server (IIS)' option and new options will appear on the left:
CPR Broker 7
Preparing the system
As mentioned in the requirements in the previous chapter, you should check the 'IIS 6
Management Compatibility' option – make sure to check all sub-items.
If you do not see the '.NET 3.5.1 Features' in the list, please check if it is actually already
installed. Sometimes it is installed, but does not appear in the list. Check the path:
C:\Windows\Microsoft.NET\Framework64\ and see if the folder '3.5' exists. If it does, you
already have the framework installed.
If you do not see the framework in either place, then you should download it from the
Microsoft website and install it. Just do the default installation.
2.3Installing .NET 4
The same steps counts for this part as for 3.5.1.
You will need to (purchase and) download it from the Microsoft website. Follow the default
instructions and you should be good.
CPR Broker 8
Needed information
3NEEDED INFORMATION
You will need to have some information before you install CPR Broker. You will also need to
make a few decisions for the names of database and web server entries.
3.1Windows
You will need a windows account that have administrative rights on the machine you are
installing on.
3.2Web
CPR Broker can be installed as a root site (on Windows 2003 and 2008 only) or as a virtual
directory to an existing root site. You need to decide on names for CPR Broker and Event
Broker web sites (or virtual directories).
If you want to install CPR Broker as a root site (which is what is recommended) you must
prepare a DNS record to point to the web server before beginning the installation. The
installation program does not create this DNS record for you. You can do that locally by
editing the hosts file, usually located at c:\WINDOWS\system32\drivers\etc\hosts
3.3Database
You need to know the machine name and server instance of the SQL Server instance that
you plan to use for the broker. You need to have access to instance. The account you use
must be a member of the sysadmin role (used only during the installation to create the
database).
You need to decide the database names that you plan to use. The suggestion is CprBroker
and EventBroker, but you can use whatever names you want.
You should also determine the login information that you want the broker to use in order to
access the database. The installer can create it for you.
3.4Data providers
To configure CPR Broker after installation, you need information about how to connect to its
data providers. Please refer to the section Data Providers for more details.
CPR Broker 9
Installing CPR Broker
You can install CPR Broker using a wizard, or -if you know what you are doing- by a silent
installation via the command line.
Please note: On a computer with User Account Control (Vista/2008/ 7), the program will ask
you to use elevated privileges. If you are comfortable with it, allow it to elevate.
The next screen will show the license terms. Accept and click Next.
CPR Broker 10
Installing CPR Broker
Choose where to install the files for CPR Broker. The default selection will most likely be a
perfect fit. Click Next.
The installer now needs information on the CPR Broker web site should be installed
CPR Broker 11
Installing CPR Broker
If your IIS can have multiple sites (on e.g. Windows 2003 and 2008), type the name of the
website to be created. The default name is fine.
You can also choose to install as a virtual directory in an existing website. Choose the
website from the list and type the name for the virtual directory. Default name is fine.
If you are installing on e.g. Windows XP you only have the option of installing as a virtual
directory to the Default Web Site. The CprBroker application name will be okay for most
purposes.
Click Next.
The installer now needs information necessary to create the database in which it stores
copies of CPR -information.
The Server name is the name or IP-address of the computer on which the SQL Server
resides. It could be localhost if the SQL Server resides on the same computer as the web
site. If the server has multiple instances, type [ServerName]\[InstanceName]. Example is
localhost\SQLEXPRESS
CPR Broker 12
Installing CPR Broker
Database name is the name of the database. CprBroker would be a well chosen default
name. If the database already exists, you will be given a warning message. If you accept it,
the database will be used as it is. Please note that you will have to re configure the data
providers because of encryption issues. Refer to the section “Data Providers” for details on
how to do that.
Admin login is used for logging into the SQL Server and creating the database with the
necessary tables etc. Whether you should use Windows authentication or SQL Server
authentication depends very much on your setup. If the SQL Server is on the same
computer as the web site you should most likely use Windows authentication.
Application login is used by the web site and services to connect with the database. The
credentials needed for this purpose do not need to have as many privileges as the Admin
login. Type the User Id and Password that you want the broker to use. If the user exists as a
login, the password has to be the correct user's password. If not, the installer will create a
new SQL login for you. In all cases, the user will be added to the db_owner role in the
database.
When you are satisfied with your settings, click Next. The installer will test the information
you have provided. You will see an error message if the information is invalid. Please check
the information and click Next again in this case.
Now we have configured the web and database for the CPR Broker feature of the CPR
Broker product. From this point, we will start entering the information for the Event Broker
feature. The next screen will give you a warning.
CPR Broker 13
Installing CPR Broker
Click Next.
Now you will be prompted to enter the information for the web site and database of Event
Broker. Please fill them as you did previously. Please make sure the web/database names
you enter here are different from what you entered previously (for the CPR Broker feature).
CPR Broker 14
Installing CPR Broker
Wait until the process is finished. Then you will see this screen
Done!!
CPR Broker 15
Installing CPR Broker
4.2Silent installation
If you are the type of people who prefer to use command line interfaces, then you can also
do a (semi) silent installation of CPR Broker.
If you are installing on an operating system that has user account control, please make sure
you run the command as Administrator.
CPR Broker 16
Installing CPR Broker
DB_APPSAMEASADMIN_CPR Whether to use the same admin info for application login. False
Always set to False
CPR Broker 17
Installing CPR Broker
DB_APPSAMEASADMIN_EVENT Whether to use the same admin info for application login. False
Always set to False
For example, this command will install CPR Broker to CprBroker and EventBroker websites,
create CprBroker and EventBroker databases on SQL server SqlServer, using integrated
windows authentication, and the installed sites will use CprBroker and EventBroker users to
connect to the databases.
CPR Broker 18
Installing Person Master
The installation procedure for Person Master is similar to CPR Broker. However, it is more
simple. The differences are
5.1Needed information
As you did we CPR Broker, we need to prepare similar stuff. The difference is that the DNS
record and database name are now for Person Master
– A strong encryption key (just make one up) to be used by Person Master. It should
be at least 8 characters long, contain lower and upper case characters, contain at
least one digit and at least one non alphanumeric character.
– A domain name to be used in the database. Any string like “pm” (without quotes)
would work.
If the installer complains: 'This application requires IIS version 7. Please install IIS 7 and
then run the installer again' it is due to [explain what causes this and how to fix it].
On a computer with User Account Control (Vista/2008/ 7), the program will ask you to use
elevated privileges. If you are comfortable with it, allow it to elevate.
CPR Broker 19
Installing Person Master
Click Next.
Select the destination folder –the default value is OK- and then click Next.
CPR Broker 20
Installing Person Master
Type the name you want for the created website and click Next.
Type how you want to create the database. You can also use an existing database (in case
you have previously installed PersonMaster manually). The installer will only guarantee
access to the database, but will not create any database objects.
CPR Broker 21
Installing Person Master
Click Next.
Now you have finished input of the needed information. Click Install to start the installation
process. You will see the following window.
Wait until the installation is complete, and then you will see this:
CPR Broker 22
Installing Person Master
Done!!
5.3Silent installation
Just like CPR Broker, Person Master can be installed from the command line.
Again, if you are installing on a system with user account control, run the command prompt
as Administrator.
– The property suffix is _PM (not _CPR or _EVENT). Since we have only one
database and one website, we can skip the _PM suffix and just something like
DB_SERVERNAME=SqlServer
CPR Broker 23
Installing Person Master
For example, this command will install Person Master to PersonMaster website, create
PersonMaster database on SQL server SqlServer, using integrated windows authentication,
and the installed site will use PersonMaster user to connect to the databases.
As usual, on a computer with user account control (2008/7/Vista), please run the from an
CPR Broker 24
Installing Person Master
You do not need to pass database and web information to the command. If the new version
contains database upgrades, you will be asked to input a database admin connection.
CPR Broker 25
Installing Person Master
Done !!
The following table shows the product codes of Person Master so far.
Up to 1.2.0 {DDB79617-A985-4841-9626-22779DED8D13}
1.2.1 {1F607476-879D-4931-B75E-048925C1272C}
You will be asked if you want to drop the database. If yes, you may need to provide a user
account that is a member of sysadmin role in order to delete the database.
Click Next.
CPR Broker 26
Installing Person Master
Now wait for the wizard to end, and Person Master is removed from your system.
CPR Broker 27
Configuring CPR Broker
6.1Applications
Now click Applications:
For a client application to be able to use the broker, it needs to use an application token that
uniquely identifies the application. This is modelled by the concept of Application in the
broker.
An application has a unique name and a unique token. The name is a user friendly string
CPR Broker 28
Configuring CPR Broker
that can be seen in the log entries identifying relevant log entries. The token is a unique key
sent with all web service requests to tell the broker which application is making the call. The
token is an auto generated GUID (Globally Unique Identifier) by default, but it can be
changed to be any string that uniquely identifies the application. The application needs to be
approved before it can be used.
Applications can be created through the Applications page and also through web services.
Name and token can be changed through the user interface (only), but they still have to be
unique.
The system comes with three pre approved applications. The Admin application is a built-in
name for an application that is allowed to work with the administrative parts of the CPR
Broker. The other two applications are the event broker and the demo application. Please
leave these two applications untouched.
To approve an application, simply click Edit for the application in question and check the
Approved check box. Then click Update (only shown after Edit).
To create an application, simply give it a Name and whether it should be initially approved (it
probably should). Then click Insert. The application is now listed under Applications.
6.2Data Providers
Now click Data Providers:
A Data Provider is a connector that provides the broker with information. CPR Broker itself
does not produce data, but rather queries other systems for data.
To setup any of these connections you need an account and connection information from
the provider. Then choose the appropriate provider type, enter the information and click
Insert. You now have a Data Provider.
CPR Broker 29
Configuring CPR Broker
In order for the broker to be usable, it must be told where to get people's data from. There
are two groups of data providers:
Used to assign UUID’s to CPR Numbers. It gets UUIDs from the specified person master
service.
Spn name is a parameter used by the service that you should get from the administrator, or
by checking the WSDL file of the actual service instance. You can find the WSDL file by
following the link in Person masters default page (<Person master URL>/Default.htm).
6.2.2.1DPR
Address and Port are TCP address and port of the DPR forwarding (DPR Viderestilling)
service.
CPR Broker 30
Configuring CPR Broker
Keep Subscription tells the instance whether to set a subscription when requesting data
from DPR forwarding in case data is not already in DPR. It can be either True or False.
Disable Diversion disables the usage of DPR forwarding altogether (in case you want to
save money).
The rest of the parameters are used to build an SQL Server connection string that points to
the DPR database. Let the database properties point to the DPR database. 'Data Source' is
the sever name, 'Initial Catalog' is the name of the database. [Integrated security is...?]
6.2.2.2P-Data (KMD)
Address is the web service base address (http://their.domain/kmd/pData). The broker will
add the parameter zservice=AN08002 (or whatever service) when actually calling the web
services.
CPR Broker 31
Configuring CPR Broker
6.2.2.3E&M
The configuration properties are used to connect to the E&M database. It is preferable not
to use integrated windows authentication.
6.2.2.4CPR Direct
There are two types of data providers for CPR Direct
This data provider looks for change extract files at a configurable location on the
server/network. It is very important that the user 'Network service' has full access to the
path, otherwise it will not work. The field 'Extracts folder' should contain the path to the
folder in which the extracts go.
It is also possible to get the files from an FTP location. It takes parameters for the folder
CPR Broker 32
Configuring CPR Broker
location for files and also how to access the FTP site (if needed).
This data provider calls a TCP/IP interface provided by CPR Direct Client service. The
service should be installed on the local network. This provider gets parameters for address,
port, and whether a subscription to be put on the person.
CPR Broker 33
Configuring security
7CONFIGURING SECURITY
7.1Restricting access to the website
CPR Broker is installed with default to allow access to everybody as long as they can
access the server on which it is installed via HTTP.
In real life, this is not exactly how you want things to be. This section describes how to limit
access to CPR Broker admin pages. The following sub sections will describe two examples
of the configuration on Windows Server 2008 R2 and Windows 7.
Please note that PersonMaster is built using a different technology stack and hence
requires some different steps. It has been modified, though, so that it can be configured
very similarly to the other two components.
7.1.1.1Production environment
This section assumes that the server is a member of a domain and that the DNS entries for
the website have been correctly put into the DNS. The exact steps are for Windows Server
2008 R2
Start → Server Manager → Roles → Web Server (IIS) → Role Services → Add
Role Services → Web Server → Security → Windows Authentication
Make sure it is checked and press OK.
– Start → Internet Information Services (IIS) Manager → Sites → <your CPR broker
site> → Authentication
Anonymous Authentication → Disable
Windows Authentication → Enable
7.1.1.2Test/Development environment
This section assumes that the machine is not a member of a domain and that the host
name for the site has been manually added to the hosts file
(C:\Windows\System32\drivers\etc\hosts). The exact steps are for Windows 7 SP1
– Start → Internet Information Services (IIS) Manager → Sites → <your CPR broker
site> → Authentication
Anonymous Authentication → Disable
Windows Authentication → Enable
– First, look for node <authentication> under <system.web>. Make sure it looks like:
<authentication mode="Windows" />
Please replace the text text marked with <> with actual values from your
environment. For example:
<domain>\<user name> → mydomain.dk\myuser
7.1.2.1Services
If you want to apply this also to web services, do the same, but then put a different path
<location path="Services">
..
</location>
CPR Broker 35
Configuring security
In general, you can do the same for any virtual path within the website
Note
In case you restrict access to something under path 'Services', then any client applications
using CPR broker will have to run as a user that is matched in the <allow> elements.
7.2Backend service
The backend service is, on install time, set to run as 'NT Authority\Network Service'. As this
could create a posible security hole if the broker is exposed to the outside of the domain, it
is advisable to create a new user by whom the service can be run.
In the MMC select File->Add/remove Snap-in. Then select 'local users and groups' and click
the 'Add' button. Finish by clicking 'OK'.
Now right click in the central area and choose 'New user'. Type in the credentials for the
new user. Remember that the password must be CaMeL case and must containt both
CPR Broker 36
Configuring security
Firstly select 'Stop' and secondly select 'Properties' and choose the tab 'Log On'. Now, click
the 'Browse' button and type in the name of the newly created user and click 'OK'. Then fill
in the password, click 'Apply' and finally 'OK'.
Right click the service again and select 'Start'. Now it should all be done and the service
should be run as the new user.
CPR Broker 37
Configuring security
7.3Using SSL
As extra security measures for your website, you can also enable usage of SSL in the
website. In order to do this, you need to create a certificate and link it to the website. The
steps are described in the following sub sections.
7.3.1Note
Please not that if you apply SSL to EventBroker then you will also have to change the URL
setting EventsServiceUrl section in the configuration file
'CprBroker.EventBroker.Backend.exe.config' (usually stored in 'C:\Program Files
(x86)\ITST\Cpr Broker\EventBroker\Website\bin'):
<CprBroker.Config.Properties.Settings>
<value><YOUR_HTTP_URL_TO_EVENTBROKER></value>
</setting>
</CprBroker.Config.Properties.Settings>
Here you will content of the value field to the HTTPS URL.
7.3.2Creating a certificate
There are several ways to do this, depending on the actual need for SSL.
7.3.2.1Domain certificates
This is usually the most common way to use. If you have a domain controller, you can
create a domain certificate. This certificate will usually be trusted by default within your
Intranet.
Start → Internet Information Services (IIS) Manager → Server Certificates → Create Self-
Signed Certificate → (Enter name) → OK
Note
If you follow this way, usually the client applications need to be changed so that they accept
the certificate. This way is only recommended for development and testing environments.
Start → Internet Information Services (IIS) Manager → Sites → <your CPR broker site> →
Edit Bindings → (select the one with https) → Edit → SSL certificate → (select your
certificate) → OK → Yes
Note
If needed, you can delete the HTTP binding to force SSL communication to the website.
7.4Person Master
While CPR Broker and Event Broker are build as ASP.NET web pages and services, Person
Master is built as a Windows Communication Foundation (WCF) service. This means that it
requires different procedures for securing the service.
– Adjust the site settings in IIS Manager as you did for CPR Broker and/or Event
broker
7.4.1Scenarios
There are tons of options to configure WCF services. We have chosen a few simple
scenarios, taking into consideration compatibility with CPR broker.
CPR Broker 39
Configuring security
The settings in IIS need to be paired with settings in the configuration file. We have come
up with three possible scenarios that you can choose from based on your requirement for
security and compatibility with CPR Broker.
If you use one of these modes, CPR broker will decide which one to use based on whether
the address URI scheme (http/https).
Description This is the “implicit” default for Supports transport level Allows secure communication
Person Master. Compatible security for communication while keeping backwards
with all versions of CPR with CPR broker. compatibility with older
broker. versions of CPR broker
below:
– Set the “End point configuration name” attribute for the person master data provider
to the name of the end point that you have created.
Note
This option is available in CPR broker version 2.1.1 and above
CPR Broker 41
Configuring security
CPR Broker 42
Setting up logging
8SETTING UP LOGGING
CPR Broker can log to file, Windows Event Log, to the Database and to email.
There place to setup logging: In the loggingConfiguration.config file for CPR Broker web
service. The default position for this is C:\Program Files\ITST\CPR Broker(Event
Broker)\Web\Config
The procedure is the same for both files. Locate the < loggingConfiguration> tag in the
specific config file. Under the <listeners> tag you will find four <add tags. The
"CprDatabase" as well as the "EventLog" should be left untouched in all cases.
In "FlatFile" you should look for the fileName attribute. This should be set to the full
path and name of the where to put the log file. By default, the path
is“[InstallDir]CprBroker\Website\CPR Broker.log”. The installer will create the file and give
CPR Broker the necessary permissions to write to it.
In name="Email" there are more settings. The ones most likely to be adjusted are:
toAddress, fromAddress, smtpServer and perhaps smtpPort.
Please note: If you change FlatFile, you need to make sure that the ‘NT
AUTHORITY\NETWORK SERVICE’ account has sufficient access rights to the destination.
You have now adjusted the settings for each type of logging, but you have yet to set what
types of logging are active. You now look for the <specialSources>/ <allEvents> tag.
In this you will another <listeners> tag. Per default "CprDatabase" is active, which can
be seen from the fact that it is not commented out like e.g. <!--add
name="EventLog" /--> is.
To enable a specific listener simply remove the <!-- and --> characters from the line. And
to disable a listener simply put them back in.
CPR Broker 43
Upgrading CPR Broker
As usual, on a computer with user account control (2008/7/Vista), please run the from an
administrator command prompt.
You do not need to pass database and web information to the command. If the new version
contains database upgrades, you will be asked to input a database admin connection.
There are no database upgrades so far, so you will not be asked for it at the moment.
CPR Broker 44
Upgrading CPR Broker
Done!!
CPR Broker 45
Uninstalling CPR Broker
The following table shows the product codes of CPR Broker so far. The code of interest is
the version of the latest version that you have installed.
Up to 1.1.1 {30875D64-A423-4CCD-A929-5DD556A90EDD}
1.1.2 {509416EA-BD78-42ED-BD9C-C2557E2D5872}
1.2.0 {0570C9B9-0BED-4F6E-BE96-999A7C904DCC}
1.3.0 {929977A9-19B9-4F37-BFDD-46FD5E86FAC0}
1.3.1 {8EDC4FA8-83CD-4997-9E76-F0EA2D08038D}
1.3.2 {83D6E13C-3BD6-4DC2-B375-4272390C1F4C}
1.4.0 {49822D46-27B2-4340-9BCC-AEB9C4470E6F}
2.1.0 {DEBB9B03-91B6-490B-B21A-55B1DF5BBA01}
2.1.1 {8FD4F5C5-C8C0-4077-BE4D-4180E0627078}
You will be asked twice if you want to drop the database. First time is about CPR Broker
database and second is about Event Broker database.
If you choose to drop the database(s), you may need to provide a user account that is a
member of sysadmin role in order to delete the database(s).
CPR Broker 46
Uninstalling CPR Broker
Click Next.
Now wait for the wizard to finish, and then CPR Broker is removed from your system.
CPR Broker 47
Installing a test server
– Server should have SQL server management studio installed. You should also have
'sysadmin' access to an instance of SQL server
– Get the files for BatchClient, DPR test database ('DPR_TEST20110616.bak'), and
CPR Direct sample extract (U12170-P opgavenr 110901 ADRNVN FE)
– Create a new data provider of type Person Master, let it point to the test instance of
Person Master (please refer to the 'Person Master' section for details).
Note: Please make sure not to configure a test instance of CPR broker to use a
production instance of Person Master.
11.2CPR Direct
– Create a folder somewhere on the server, something like C:\CPRDirectExtracts
– Set the security of the folder so that everyone has full access to it.
– Put the file 'U12170-P opgavenr 110901 ADRNVN FE' in the folder.
– Add a CPR Direct Extract data provider (please refer to the 'CPR Direct' section for
details), with 'Extracts Folder' pointing to your folder, and 'Has FTP Source'=False.
– If the installation is OK, the file should be automatically imported and moved to
'\Processed' folder under the folder you have created.
CPR Broker 48
Installing a test server
11.3DPR
– Create an empty database called DPR (or whatever) in SQL server.
– Create an SQL login / user with membership in 'db_owner' role in the DPR database
– In the applications page, create a new application called 'Batch Client'. Set
approved = true.
– In CPR Broker's DataProviders.aspx page, create a new provider of type DPR (refer
to the 'Data providers' section). Set DisableDiversion=True. Let the database
properties point to the DPR database you previously created and 'Integrated
Security' should be set to 'false'.
Please replace values for /source, /partUrl, and /appToken with the actual values for
file with the CPR numbers from DPR, URL of Part service in CPR broker, and the
application token created for BatchClient application.
– Let the process run for a few minutes and make sure that successful conversion is
the most common case. It should look something like this:
CPR Broker 49
Installing a test server
adresse
Studiestræde 14, 1.
1455 København K
email
[email protected]
telefon
(+45) 33 36 96 96
CPR Broker 50