CA SAM: Installation Instructions

book

Article ID: 131421

calendar_today

Updated On:

Products

CA IT Asset Manager CA Software Asset Manager (CA SAM) ASSET PORTFOLIO MGMT- SERVER CA Service Management - Asset Portfolio Management

Issue/Introduction

The following document derives instruction from the CA SAM system_administration.pdf file that is supplied in the CA SAM software distribution, under the DOCS directory.  Additional steps and clarifications have been included to further explain the activity.

Environment

CA SAM 4.3.x

Windows Server 2016

PHP 7.1

Resolution

Assumptions: 

  1. We will be installing CA SAM 4.3 with PHP 7.1 on Windows 2016 OS with SQL Server 2016.  
  2. The name of the SAM Web Server is "SAMServer".  
  3. It will be a "prod" based install which is the "tag" that is being utilized for this installation.  
  4. The server is based out of an EST Timezone.  
  5. IIS is the web server being used and no other applications are leveraging the default IIS web site and default port 80.
  6. Unless otherwise specified, all actions are performed on the SAMServer only.

1.  Download the following items in advance to the SAMServer:


2.  Install the JRE 1.8 and Visual C++ Redistributable packages on the web server.


3.  Extract all of the other above materials into their own folders.  One can right-click any such executables and choose "Extract" to unzip the file contents to a new directory.


Note:  For JDBC driver "sqljdbc_6.0.8112.200_enu.exe", create directory "C:\Program Files\Java\JDBC" and extract the contents of this file to this location.


4.  On the SQL Server, create a blank database and user.  The user will be defined in SQL Server.  


In this scenario, I have created a database called "samdb" and SQL user named "samuser".  


The database samdb" can be created with all defaults accepted.

The login "samuser" should be defined in SQL Server.  Specific settings that had worked to configure the user:

  • Should use SQL Server Authentication (Fig 1)
  • Default Database:  master  (Fig 1)
  • Server Roles:  Public  (Fig 2)
  • User Mapping:  Have "samdb" checked for user "samuser", default schema "dbo" and make sure for DB Role Membership on "samdb" that "samuser" has db_owner and public checked on. (Fig 3)

Fig 1:


Fig 2:


Fig 3:

The schema and tables will be created in a later step.


4.  Create a new mail account that will be used with CA SAM.  Collect the settings for:

  • SMTP Mail server/port
  • email accounts associated with SAM functionality.
  • Passwords of the sender for any mails being transmitted on behalf of CA SAM.

5.  On the SAMServer, go into a command prompt, cd to "C:\Program Files (x86)" and run the following commands to create the directory structure.


mkdir .\ca\Sam\app\htdocs\prod\
mkdir .\ca\Sam\app\includes\prod\
mkdir .\ca\Sam\app\uploads\prod\
mkdir .\ca\Sam\app\uploads\prod\jobs\
mkdir .\ca\Sam\tmp\
mkdir .\ca\Sam\tmp\upload\
mkdir .\ca\Sam\tmp\session\
mkdir .\ca\Sam\env\
mkdir .\ca\Sam\doc


6.  Copy from CA SAM ZIP file:

  • Content of htdocs to c:\Program Files (x86)\ca\Sam\app\htdocs\prod\
  • Content of include to c:\Program Files (x86)\ca\Sam\app\includes\prod\
  • Content of docs to c:\Program Files (x86)\ca\Sam\doc\

7.  Edit C:\Program Files (x86)\CA\Sam\app\includes\prod\st\config.ini, adjust all values according to your own system settings.

Note:
 Double quotes are intentionally placed on certain entries and are omitted in others.  Please be mindful of their placement as shown here.

In my install, I made these changes in the above config.ini file:
relative_app_root = "/prod/"
upload_path = "c:\\Program Files (x86)\\ca\\Sam\\app\\uploads\\prod\\"
executable_files_path = "c:\\Program Files (x86)\\ca\\Sam\\app\\uploads\\prod\\jobs\\"


java_executable = "<Path to Java installation>\\bin\\java.exe"
Example:  java_executable = "C:\\Program Files\\Java\\jre1.8.0_201\\bin\\java.exe"

java_jdbc_path = "<Location of sqljdbc42.jar>"
Example:  java_jdbc_path = "C:\\Program Files\\Java\\JDBC\\sqljdbc42.jar"

php_cli_executable = "C:\\Program Files (x86)\\CA\\sam\\env\\php\\php.exe"


Under [database] add the data for your database connection
system = mssql 
host =
<enter the name of your database server>
db = samdb
driver = sqlsrv
user = samuser
password =
<enter the above SQL Server user's password> 
port = 1433

Note:  The above DB password is intentionally being written here in plaintext to facilitate installation.  After completing the install process, please follow the steps in the following tech article to encrypt the DB password:

https://knowledge.broadcom.com/external/article?articleId=190885

Under [email] add the settings for mail functionality
method = smtp
host =
<name of your mail server>
smtpauth = true
username =
<userid you are logging in as for mail access, expressed as [email protected]>
password = <password>
error_to = <email address that any error messages should be sent to>
error_from = <email address that any error messages should be sent from>
error_retpath = <email address that any error messages should be replied to>

8.  Set permissions for the IIS_IUSRS user (SAMServer\IIS_IUSRS) to have Modify, Read/Execute, List Folder Contents, Read, and Write across the following folders (applying to subfolders).  To do this, go into Windows Explorer and for each of the following directories, right-click, choose "Properties", go into the "Security" tab and manipulate the permissions as directed. (Fig 4-8)

c:\Program Files (x86)\ca\Sam\app
c:\Program Files (x86)\ca\Sam\tmp


If you are prompted to reorder permissions within these directories, please accept the reorder. 


Fig 4:

Fig 5:


Fig 6:

Fig 7:

Fig 8:



9.  Set permissions for the IIS_IUSRS user (SAMServer\IIS_IUSRS) to have List Folder Contents, read and read/execute on this folder:


c:\Program Files (x86)\ca\Sam\env\

10.  Add the Role: Webserver (IIS) to the server (Administrative Tools > Server-Manager > Roles > Add Roles)

11.  Add the following additional role services:


Under Web Server/Common HTTP Features (Fig 9)
· Role Service: Static Content
· Role Service: Default Document
· Role Service: Directory Browsing
· Role Service: HTTP Errors
· Role Service: HTTP-Redirection

Fig 9:

Under Web Server/Application Development

· Role Service: CGI

· Role Service: ISAPI Extensions

· Role Service: ISAPI Filters


Under Management Tools (Fig 10:)

· Role Service: IIS Management Scripts and Tools


Fig 10:


Also, go into Features and add:


Under .NET Framework 3.5 Features

- .NET Framework 3.5

- HTTP Activation


Under .NET Framework 4.6 (Fig 11:)

- .NET Framework 4.6

- ASP.NET 4.6

- WCF Services / HTTP Activation

- WCF Services / Named Pipe Activation

- WCF Services / TCP Activation

- WCF Services / TCP Port Sharing


Fig 11:


12.  Copy the contents of the PHP 7.1 extract "php-7.1.26-nts-Win32-VC14-x64.zip" into C:\Program Files (x86)\ca\Sam\env\php\


13.  Access C:\Program Files (x86)\CA\Sam\env\php in Explorer.  Copy php.ini-production into php.ini


14.  Create the "OPENSSL_CONF" environment variable by right-clicking on "This PC" in Explorer, choose "Properties".  Go into the "Advanced system settings" link, access "Advanced" tab and click on "Environment Variables"


Under System variables:


Add

Name: OPENSSL_CONF

Value: C:\Program Files (x86)\ca\Sam\env\extras\ssl\openssl.cnf


Note:  Do not encapsulate this line with double-quotes.  Make sure the above directory location for file "openssl.cnf" is accurate as well. 

The openssl.cnf file comes from PHP and may be buried within the PHP directory structure itself, ie:  "C:\Program Files (x86)\CA\Sam\env\php\extras\ssl\openssl.cnf"


15.  From the SourceGuardian Package and the SQL Server Driver Package, locate the "ixed.7.1.win" and "php_sqlsrv_71_nts_x64.dll" files.  Add these two files into "C:\Program Files (x86)\CA\Sam\env\php\ext"


15.  Make the following changes in php.ini (under C:\Program Files (x86)\CA\Sam\env\php):


Any lines that are commented in the original php.ini should be uncommented if they are listed below.  Any lines that are non-existent will need to be added manually.  

The sole exception are the "extension" lines.  These must be entered exactly as seen here, including the "DLL" extensions.

output_buffering = Off
zlib.output_compression = Off
ignore_user_abort = On
max_execution_time = 72000
max_input_time = 3600
memory_limit = -1
log_errors = On
error_log = syslog
post_max_size = 1500M 
extension_dir = "C:/Program Files (x86)/ca/Sam/env/php/ext/"
cgi.force_redirect = 0
cgi.rfc2616_headers = 0
upload_tmp_dir = "C:/Program Files (x86)/ca/Sam/tmp/upload/"
upload_max_filesize = 1500M
extension = php_gd2.dll
extension = php_mbstring.dll
extension = php_openssl.dll
date.timezone = America/New_York
session.save_path = "c:/Program Files (x86)/ca/Sam/tmp/session/"
session.gc_maxlifetime = 86400
session.use_trans_sid = 0


Notes:  

  • These two lines need to be added manually to php.ini alongside the other extension lines.

extension = ixed.7.1.win
extension = php_sqlsrv_71_nts_x64.dll


16.  Go to Administrative Tools > Internet Information Services Manager > SAMServer:
In Handler-Mappings > Add Module Mapping set the following:
· request path: *.php
· Module: FastCgiModule
· executable: "c:\Program Files (x86)\ca\Sam\env\php\php-cgi.exe" (The double quotes are necessary.)
· Name: PHP

Open Request Restrictions, set "Invoke handler only if request is mapped to" and choose
File or folder.
Click OK twice. Confirm any security queries.

Go back to SAMServer, access "Default Document" > Add and enter index.php:

Go back to SAMServer, access Edit FastCGI Settings:
· Double click on your handler mapping
· Set Activity Timeout, Idle Timeout and Request Timeout each to 36000

Go back to SAMServer, and access the Configuration Editor
· Choose the section "system.webServer/handlers"
· Open the "(Collection)" settings
· Choose the module mapping PHP
· Set "responseBufferLimit" to 0
· Close the "Collection Editor - system.webServer/handlers/" window.
· Click "Apply" under "Actions"
· Click Yes when you are asked to apply the changes.

Go back to SAMServer, drill down to "Sites", "Default Web Site".  On the right hand side, choose "Basic Settings".

Set document root (Physical Path) in IIS Manager to c:\Program Files (x86)\ca\Sam\app\htdocs

Reboot the entire server.  This is necessary given the changes made to the environment variables, Server Role, and IIS.

17.  Configure your web browser to accept popups.  Check the installation:
http://SAMServer/prod/admin/check_installation.php

Execute the "Run Checks" button on each page.  Each check run will take about 2-5 minutes.

Review each tab ("Environment", "Application" and "Miscellaneous") for any concerns.

Notes:  

  • App Database will fail as it has not yet been established.  Everything past App Database should read as "could not run".
  • At the minimum, DB Environment, PHP Environment, and PHP configuration should either be "OK" or "Notice".
  • App environment should not come back as FAIL.
  • A second run of the Install check will be performed after the database schema is populated.

18.  Set up the database structure:
http://SAMServer/prod/index.php

Depending on requirements, you may opt to "Create demo system" or "Create Production System".  We will choose "Create demo system".

DB Install process will take some time, depending on database functionality, network latency and option to populate for demo data.  A run time of 30+ min is a possibility.

Once the DB creation completes, click on the "login" link on the DB creation page.  

The default login is 
Userid:  admin
Password:  admin

You will be prompted to change the password.

19.  Check the installation (post DB install)
http://SAMServer/prod/admin/check_installation.php

20.  Create Cron Jobs:

Go to Control Panel > System and Security > Administrative Tools \ Schedule Tasks >
Create Task and set the following:
General
Name CA SAM Prod cronmaster
Security options · Go to Change User or Group... and choose IIS_IUSRS user (SAMServer\IIS_IUSRS).
· Run whether user is logged on or not (Ignore this step if the option is grayed out.)

Triggers > New
Begin the task On a schedule
Settings Daily
Repeat task every 5 minutes
for a duration of indefinitely

Actions > New
Action Start a program

Program/script "c:\Program Files (x86)\ca\Sam\env\php\php.exe"
Add arguments "c:\Program Files (x86)\ca\Sam\app\includes\prod\cron\cron_master.php"

Note:  Make sure to include the double quotes in the above.

Configure the integration between CA SAM and APM - https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/business-management/ca-service-management/17-1/integrating/integrate-ca-sam-with-ca-apm/configure-ca-sam-and-ca-apm-integration-parameters.html

 

Additional Information

SQL Server PHP Drivers:


Depending on your specific OS/PHP Combination, these are the latest known SQL Server Driver files to download and the corresponding DLL to use in the above:

 
Windows Server ReleasePHP VersionSQL Server Driver File DownloadDLL Of Interest
Windows Server 2008 SP2 / R2 SP17.0SQLSRV40.EXEphp_sqlsrv_7_nts_x64.dll
Windows Server 20127.0SQLSRV53.EXEphp_sqlsrv_7_nts_x64.dll
Windows Server 20127.1SQLSRV56.EXEphp_sqlsrv_71_nts_x64.dll
Windows Server 20167.0SQLSRV53.EXEphp_sqlsrv_7_nts_x64.dll
Windows Server 20167.1SQLSRV56.EXEphp_sqlsrv_71_nts_x64.dll

NOTE: There is no version of the above SQL Server PHP Driver available for PHP 7.1 and Windows 2008.

Attachments