You are here: Home / Documentation / 2. Installation / 2.3 Server Part Installation / Install the eWay-CRM Server Component

Install the eWay-CRM Server Component

Contents:

      0 - Preparation

      1 - Copy Web Service to Server

      2 - Create Virtual Application in IIS

      3 - Create the Database

      4 - Create User Account for Access to Database

      5 - Set Connection String

      6 - Other Web Service Settings

      7 - eWayTimer and Its Settings

      8 - Add Connection With Licence Server

      9 - Verify Connection

      Installation Requirements

      You have to meet minimum requirements to install the server part of eWay-CRM. You will also need Microsoft SQL Server Management Studio in order to work with the database.

      You will also need these parts of the eWay-CRM system:

        • Web service (eWay folder)
        • Database backup (file eWayDB.bak)

        The procedure for installation described below is for Windows 2003 Server and Windows 2008 Server and higher.

        You need to permit specific roles in IIS (see Check Installed Roles in IIS Before eWay-CRM Server Installation):

        • ASP.NET 3.5
        • ASP.NET 4.5
        • Static Content

        1) Copy Web Service to Server

        Usually the folder for the default web server is located in C:/inetpub/wwwroot. Copy the web service eWay folder into that folder, as is suggested in the next picture. You can change the name of the web service folder as you wish, but you shouldn't forget it in the following steps (for example the settings of the Web.config file).

        Set Permissions for Work With Web Service Folder

        It is necessary to set permissions to work with the web service folder in order to facilitate necessary operations. Firstly you should set permissions of the web services folder, where the account NETWORK_SERVICE should have permissions for reading, as shown in the picture. Sub-folders should inherit the permissions.

        Sub-folders Download, License and Log should have a Write permission for account NETWORK_SERVICE. (see the picture below).

        2) Create Virtual Application in Internet Information Service (IIS)

        Process for Windows 2003 Server

        Start Internet Information Service. For security reasons, we recommend you create your own application pool for eWay-CRM. Right-click Application Pools and, from the menu, select New and Application Pool...

        In the dialog window, which will appear, fill in the name of the application pool (for example eWay) and click OK. Other settings won't change.

        In the next step, go to Default Web Site under Web Sites and find the eWay folder which you created in the first step. If it is not appearing there, the folder into which the eWay folder was copied in Step 1, is probably not the default web server folder.

        Find and right-click the eWay folder and select Properties.

        In the eWay Properties dialog, click the Create button and fill in the Application name, which will be the part of the URL address of the eWay web service (for example eWay). In the Application pool box select the one you created earlier in this step (in our case eWay).

        Finally, check whether the value of the field ASP.NET Version in the ASP.NET tab is set to 4.0.xxxx and press OK.

        Process for Windows 2008 Server and higher

        The principle of creating a virtual application in Windows 2008 Server is same as in the prior version of this operating system. The only difference is that new versions of IIS will be used. The web service folder has already been created, files of the web service are in the place and permissions are set correctly for the NETWORK SERVICE account.

        Now we can run Internet Information Service, where we recommend you create your own Application pool for higher security of applications on the server.

        Right-click the Funds item of applications and select Add New Application Pool. In the window that appears, fill in the fund of applications name (for example eWay). Then check whether the version of the .NET Framework interface is set to the 4.0.xxxx value and click OK.

        Then mark the newly created application pool and in the right section of the window select Advanced settings. In the section Identity, we need to set the NETWORK SERVICE value.

        The next step is the creation of the server application. Go to Sites > Default Web Site, right-click the eWay folder and select the option Convert to Application. Validate your choice by clicking OK.

        Note: How to Secure eWay-CRM Using SSL Certificate offers you basic information about setting SSL certificate for your eWay-CRM that is more secure than classic HTTP.

        3) Create the Database

        In the third step, we need to create a database on the server for the eWay-CRM system. Run Microsoft Management Studio as an administrator. Right-click the item Databases and select New Database.

        In the New Database window, fill in the name of the database (for example eWay) and keep the rest as it is. Verify by clicking OK.

        Now right-click the newly created item in the Databases folder and select: Tasks > Restore > Database. If the new database doesn't come up, right-click the Databases folder and select Refresh.

        In the Restore Database – xxx dialog window check Device and click the button for loading a file. A window will appear in which, after clicking Add, you'll find a file with a backup of the database: eWayDB.bak.

        There will be new row in the list of databases. Mark it and click Files. In older versions of Microsoft SQL Server Management Studio you need to select files where to save the database, because they are different from those created with the eWay database. Usually they are saved in C:\Program Files\Microsoft SQL Server\MSSQL.XYZ\MSSQL\Data. Now, it is necessary to map out files eWay.mdf and eWay_log.ldf.

        Then, go to Options. You need to mark the Overwrite the existing database option and then select files where you weant to save the database.

        Accept your choices by clicking OK. If everything is in right order, the database will be restored. The success of the operation can be verified by clicking the eWay item in the Databases folder and then opening Tables. There you'll see a list of tables for the eWay-CRM system.

        4) Create User Account for Access to Database

        Usually we create eWay-CRM for users who are connected to the server via the SQL connection. First, it is necessary to check whether the mixed type of access to SQL server is allowed. Right-click the name of the server and choose Properties.

        In the Server Properties window, section Security, check whether you have marked option SQL Server and Windows Authentication mode (1). Validate your choice by clicking OK.

        If the mixed connection wasn't allowed before and you've set it, now you will have to restart SQL Server. Right-click the name of the server and click Restart.

        In Microsoft SQL Management Studio, right-click the Logins folder in the Security section and select New Login.

        In the new window for the creation of a new user, fill in the user name (1) (for example eWay_User), then click the SQL Server authentication button (2) and set a password (3). Check whether the option Enforce password policy (4) isn't selected and the language is set to English (5). Then go to the User Mapping section (6).

        In the User mapping section, choose the eWay-CRM system database (in our case item eWay) (7) and in the bottom section select db_owner (8).

        5) Set Connection String

        In the Notepad, or other text editor, open the file Web.config, which is situated in the web service folder (in our case C:\inetpub\wwwroot\eWay). Scroll down to the end of file where you'll find this tag in section appSettings:

        <add key="sqlConnection.ConnectionString" value="Data Source=SOURCE; Initial Catalog=DB_NAME; User ID=USERNAME; Password=PASSWORD" />

        Or you can use following tag that is encrypted alternative to the previous one:

        <add key="sqlConnection.ConnectionStringEncrypted" value="ecPcnoQ8ydeHxgP5GZ85+Za82A6Vth3IQi7U2OotTdOYmrOunH6JwjhBJ8VGCTsCgKHq3vD0R5OOE0uo5Y0VC63ULKiPlk4yPw9yFA22mqZ2A1BaWMS4gw==" /> 

         

        Source

        Name of computer, or instance of SQL Server

        DB_NAME

        Name of a database (in your case eWay)

        USERNAME

        User name for a database (in our case eWay_User)

        PASSWORD

        User password to a database (in our case eWayPWD123(

        The eventual result should look like this:

        <add key="sqlConnection.ConnectionString" value="Data Source=MYSERVER\SQLINSTANCE; Initial Catalog=eWay; User ID=eWay_User; Password=eWayPWD123" /> 

        If you are using sqlConnection.ConnectionStringEncrypted, there is HashPassword application in the bin folder of web service that encrypts your value. The example will look like this: 

        <add key="sqlConnection.ConnectionStringEncrypted" value="ecPcnoQ8ydebP+T9kcRXSqACitvgu0YPRBj6t716M9lJ66YMPoQppNd6OcVPjVUbqh4ip+i1iAVpIMUrHjBwwWibMewSC3ZLuRxauC6Jf24hRFxGcmKRa50Y6sujZDg0" /> 

        If the database of web component is located on different server than web service, or the account under what SQL Server is running is different than default (NT Service), there is need to set access permissions into IIS folder of web service for the SQL service:

        • On the same server: You need to set permission for the SQL Server account to read all files and folders of the web service in IIS (typically C:\inetpub\wwwroot\eWay\).
        • On the different server: You need to share web service folder and set permissions to read for the user under whom the SQL server is running - in the most cases, it is needed to be a domain user.

        In both cases, the read permission is set for current account under what the SQL Server instances are running. You can check this account in the list of Windows Services, where are SQL Server and all its instances named. If it is system account and PC is in domain (Active Directory), it is possible to set the user in this form: "SqlServerName$", where SqlServerName must be replaced by the real name of the server.

        Specification of Path to Supplements

        During setting the connection to the database we shouldn't forget to set the correct path to other modules of the application. The web service will not work correctly without them. This path is the last parameter of the appSettings section. The path is located on the same end of the Web.configs file. It looks like this.

        <add key="pluginsPath" value="DIRECTORY_PATH"/> 

        DIRECTORY_PATH is the full path to the repository of the web service. And in the repository is a folder bin, which contains files with supplements. In our case the path would be like this:

        <add key="pluginsPath" value="C:\inetpub\wwwroot\eWay\bin"/>

        6) Other Web Service Settings

        With the Web.config file you're able to set not only the connection of the web service to the database (last step), but settings has a few other options. The most important and most-used are the following settings:

        Application Log

        The Application log means that the web service records performed actions and requests which were sent to it. In the case of synchronization malfunction, the log can very often help with the solution of the situation. It is very useful to have a correctly set path for the application log.

        Settings is located in the Web.config file, in the log4net section. You just have to set the relevant path to the file in the web service folder. In the example below, the application log has been saved into the eWayWSLog.txt document and saved in the Log folder which is located in the web services folder. If the current folder/path does not exist, the application will not log. 

        <param name="File" value=".\Log\eWayWSLog.txt"/> 

        It is also important to set the correct permissions for writing in the Log folder. More information is given at the top of this article.

        Sending of Email Notifications

        The part of the functionality which eWay offers to its users is the sending of notification emails within workflows (in work procedures for projects, deals, etc.). It's important to configure the system correctly to guarantee accurate sending of emails. To do this, go to the server part of the appSettings section, marked “Email support”.

        The tolerable parameters for adjusting the connection to the SMTP server are listed in the following table. The first three keys are required as a minimum. Others are shown in the case of need (the server need authentication and so on).

        <add key="SendMail" value="" />

        Insert the required parameter, from the choice of teo, between the quotation marks. Insert value:

        0 – if you want to have functionality deactivated
        1 – sending of email notification activated

        The final string could look like this: <add key="SendMail" value="1"/>

        <add key="enableSsl" value="" />

        Insert the required parameter, from the choice of two, between the quotation marks. Insert value:

        0 – if you want the functionality deactivated
        1 – sending of email notification activated

        Final string could look like this: <add key="enableSsl" value="0"/>

        Important: eWay-CRM only supports Explicit SSL. Implicit SSL is not supported (default port is 465).

        <add key="sender" value="SENDER"/>

        Insert the email address from which you want the email to be sent, instead of the SENDER value. You're inserting an alias, so it doesn't have to be a real address, but this alias will be shown in the email. The parameter could look like this:

        <add key="sender" value="[email protected]"/>

        <add key="smtp" value="SMTP_SERVER"/>

        SMTP_SERVER – here insert the network name or the IP address of the smtp server which will process the sending of your mail.

        <add key="smtpUser" value="SMTP_USER"/>

        SMTP_USER – if the SMTP server needs verification, insert the email address of the user to enable him the database login. Usually it will have the same value as SENDER.

        <add key="smtpUser" value="[email protected]"/>

        <add key="smtpPassword" value="PASS"/>

        or

        <add key="smtpPasswordEncrypted" value="PASS"/>

         

        PASS – if the SMTP server needs verification, insert the user’s password here to enable him the database login. The key must look like this:

        <add key="smtpPassword" value="t4ck5Kd7"/>

        You can use encrypted password using the following key:

        <add key="smtpPasswordEncrypted" value="nIUSJhSbadD5WTB8Y/BuKA=="/>

        There is HashPassword application in the bin folder of web service that encrypts your value.

        <add key="port" value="PORT"/>

        PORT – if the SMTP server doesn't run on the standard port 25, it's necessary to define the number of the port. The key should look like this:

        <add key="port" value="26"/>

        When the SMTP configuration is finished, you can test it as described in article: How to Check SMTP Configuration

        Create CLR Procedures

        You need to run eWaySP_CreateClrProcedures skript over the local server to create CLR procedures (eg. a procedure that can send system e-mails). The script should be run under the sa account.

        EXEC [dbo].[eWaySP_CreateClrProcedures] @WebServicePath=N'C:\inetpub\wwwroot\eWay\'

        Domain Logging

        You can specify whether the application will support the domain logging in the appSettings section, under application settings. You can adjust it with these two parameters.

        In the first one you're setting whether the logging by domain name will be activated (1) or deactivated (0).

        <add key="UseDomainLogin" value="" />

        If domain authentication was activated in last the step, specify the name of your domain in next the step.

        <add key="DomainName" value="DNAME"/> 

        For more information about setting, go to Adjust eWay-CRM Web Service for Active Directory Signing.

        7) eWayTimer and Its Settings

        The part of the web service is the mini-application: eWayTimer, which provides periodic running and executing of specific pre-defined operations. These actions are, for example, the periodic sending of tasklists or a function for counting a merged value.

        The application is composed of batch files, located in the Setup folder, which is the part of the folder with the web service. The configuration file for the eWayTimer application (file Timer.config) is situated in the main of the web service folder, as is the configure file for the whole eWay.

        If you want to check whether everything is running correctly and at the pre-defined time, we recommend you activate the log output option.

        This log also helps to diagnose problems. Set the path in which the application should save its log.

        In the main web service folder, open the file Timer.config, for example, in Notepad. You find the following parameter there: 

        <param name="File" value="FILE_PATH"/>

        Here, fill in, instead of FILE_PATH, the path to the file. It should be in the format: “..\Log\eWayTimeLog.txt”. It means that the log file with the name "eWayTimeLog.txt" will be created in the Log folder, which is located in the web services folder.

        Installation and Launch

        First of all you have to install the eWayTimer application. Open the Setup folder and right-click install.bat file and select Run as administrator. Then a window will open displaying a command line, there will be some commands which you will have to accept by pressing any button. Then you can launch the application by running start-timer.bat file as administrator. An initialization will run. You have to accept it by pressing any button.

        From that moment the eWayTimer service is activated - you can check this in Windows Services panel. If you ever want to copy a web service folder or delete it (for example within actualization), you will have to stop the service by launching stop-timer.bat as administrator and uninstall it by running uninstall.bat as administrator.

        8) Add Connection With Licence Server

        Web.config file on the server folder needs to have an information about connection to the licence server. Add a customer code that was assigned to you to the value parameter of the LicenceServerCustomerCode.

        <!-- Licence Server -->
        <add key="LicenceServerAddress" value="https://ls.eway-crm.com/WebService/v1/eWayLicenceService.svc"/>
        <add key="LicenceServerCustomerCode" value=""/>
        <add key="LicenceServerUsername" value=""/>

        Now, you need to add a password for the sa user to the Web.config file:

        <!-- Server Updater should get sa password to be able to refresh CLR procedures, etc. Specify here the crypted password please. -->
        <add key="DatabaseSystemAdminPassword" value="Mt1Nv1LfjUUtu7AtJ7GpYA==" />

        You can use HashPassword application to encrypt the password for sa user. HashPassword application is in the bin folder of the web service.

        If this is set, you can try to download the licence using this command:

        http://localhost/eWay/eWayWS.asmx/DownloadLicenceKeyNow

        If everything is correct, the licence key will be successfully downloaded.

        9) Verify Connection

        If you made changes in the Web.config file after the eWayTimer services was created, you have to restart the service first.

        Open your internet browser (for example Internet Explorer) and enter the address of your web service, for example http://localhost/eWay. If you used another application name in IIS, the address will be different. Then a web page will load with links for checking the status of your web service and links for checking the version. Click Status, check. If everything is all right, you will see an XML document in your web browser, where this is particularly important information:

        <ReturnCode>rcSuccess</ReturnCode>

        This means that everything is correctly adjusted.