Setup ACS-7.x, ASS-2.x, Local Transformation Service using distribution package step by step Part 2

cancel
Showing results for 
Search instead for 
Did you mean: 

Setup ACS-7.x, ASS-2.x, Local Transformation Service using distribution package step by step Part 2

abhinavmishra14
Advanced
4 2 12.9K

In the previous blog post, I outlined the steps to setup Alfresco Content Services 7.0.0 and Alfresco Search Services 2.0.1 from distribution package on CentOS 7 x64 environment.

You can take a look at the steps here:

Setup ACS-7.x, ASS-2.x and Local Transformation Service using distribution package step by step Part...

As many of you have requested ACS7 setup on Windows Platform as well, I am here with Part-2 of step by step ACS installation.
Hyland Alfresco has released ACS7.2 recently, See the release notes here. I will be using the latest version for this post.

What we need before we start doing setup?

  1. ACS-7.2.0 package (alfresco-content-services-community-distribution-7.2.0.1)
  2. ASS-2.0.3 package (alfresco-search-services-2.0.3.5)
  3. Java: Oracle jdk-11.0.13 or later/Open JDK 11.0.13 or later
  4. Tomcat: Tomcat 9.0.62
  5. ActiveMQ: ActiveMQ v5.16.2. Mandatory for transformation services. Check this out for Local Transformation Service
  6. DB: PostgreSQL 13
  7. ImageMagick: ImageMagick v7.1.0
  8. Libreoffice: LibreOffice v7.0.6
  9. Alfresco Transform Core AIO Boot App v2.5.7.

Checkout this documentation for additional details on Supported Platforms


Platform:

  • Windows 10 x64


Type of deployment:

  • ACS, Share, ASS (SOLR6), and Local transformation services on same machine
  • Setup With Shared Secret (Without SSL)


Let’s download all the required packages that we need for the setup.

Download ACS and ASS Distribution Packages:

Visit Alfresco community download page and download latest stable versions of ACS and ASS:

Download ACS-7.2.0 community:

https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfres...


Download ASS-2.0.3:

https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfres...

 

Note: If you are planning to setup ACS-7.2.0 (Enterprise version) and ASS-2.0.3, then download the appropriate distribution packages from Alfresco Support portal. All the steps outlined below will remain same. We are using community version of ACS 7.2 for this post hence we have to use ASS 2.0.3 as stated in the Supported platforms here

Download and Install Oracle JDK 11.0.13:

https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html

https://download.oracle.com/otn/java/jdk/11.0.13+10/bdde8881e2e3437baa70044f884d2d67/jdk-11.0.13_win...

Note: Make sure you set the JAVA_HOME environment variable (on windows). It is the installation path of jdk. E.g. JAVA_HOME=C:\Program Files\Java\jdk-11.0.13

Download Tomcat 9.0.62 binary package:

https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.62/bin/apache-tomcat-9.0.62-windows-x64.zip

Note: Make sure ports 8005, 8080, 8443, AJP port 8009 are open and not in use already. These are default ports used for tomcat. If you have these ports already in use, make sure you change the ports accordingly in <TOMCAT_INSTALLATION>/conf/server.xml.


Download ActiveMQ v5.16.2 binary package (used for transformation service):

https://archive.apache.org/dist/activemq/5.16.2/apache-activemq-5.16.2-bin.zip

Download Alfresco PDF Renderer (v1.1) binary package (used for transformation service):

https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-p...

Download Transform Core AIO (v2.5.7) jar (used for transformation service):

https://artifacts.alfresco.com/nexus/content/groups/public/org/alfresco/alfresco-transform-core-aio-...


Checkout this GitHub repo for more info on transform core all-in-one project


Download ImageMagick v7.1.0-33:

https://imagemagick.org/script/download.php#windows
https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-7.1.0-33-Q16-HDRI-x64-dll...


Download LibreOffice v7.0.6:

https://downloadarchive.documentfoundation.org/libreoffice/old/7.0.6.2/win/x86_64/LibreOffice_7.0.6.... (installer)


Download Exiftool v12.25:

https://artifacts.alfresco.com/nexus/content/groups/public/org/exiftool/image-exiftool/12.25/image-e...


Optional Alfresco module packages (amps)-Useful for admins/developers:

https://repo1.maven.org/maven2/org/orderofthebee/support-tools/support-tools-repo/1.1.0.0/support-to...

https://repo1.maven.org/maven2/org/orderofthebee/support-tools/support-tools-share/1.1.0.0/support-t...

https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-repo-0.7.a...

https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-share-0.7....


Now, we have completed all the prerequisites. Let’s move forward with setup.

Follow the steps given below.


Prepare database

Assuming you have already installed Postgres, launch “pgAdmin4” from your postgres install location <PostgresInstallLocation>\PostgreSQL\13\pgAdmin 4\bin\pgAdmin4.exe

In my case: C:\PostgreSQL\13\pgAdmin 4\bin\pgAdmin4.exe

  • Create a new user named “alfresco” and set a password which will be used by alfresco content service to connect to database. Here we will be using username as “alfresco” and password “alfresco”.
  • Create a new database named : “alfresco”, make sure you select default encoding which is “utf8”.
  • Grant all permissions for user “alfresco” on database “alfresco”.
  • Alternatively, you can open the query tool and execute following SQL queries:
create role alfresco LOGIN password 'alfresco';

create database alfresco encoding 'utf8';

grant all on database alfresco to alfresco;


Prepare acs7.2 setup directory structure:

Create directory structure as shown below on your windows drive (e.g. C:\):

acs72-folder-structure.png

You can create the same structure anywhere else, make sure all the config paths are mapped accordingly. For this post all the setup and configurations will be done in C:\ drive. You can also clone this git repo and copy the pre-existing structure if that helps.


Configure ACS repository

Install Tomcat, get the tomcat binary package (apache-tomcat-9.0.62-windows-x64.zip) downloaded as per the steps given above and extract its contents directly under tomcat directory. For example: C:\alfresco-community72\tomcat directory

image.png
Note: Make sure ports 8005, 8080, 8443, AJP port 8009 are open and not in use already. These are default ports used for tomcat. If you have these ports already in use, make sure you change the ports accordingly in <TOMCAT_INSTALLATION>/conf/server.xml.

Assuming you have already downloaded the distribution packages from download locations provided above. Use the below given steps to setup and configure alfresco-content-services-community-distribution-7.2.0.1


Unzip the package:

  • Set ALF_HOME environment variable, this will be helpful for alfresco scripts such as apply_amps.bat, clean_tomcat.bat etc. to work properly. You always have option to manually change the paths in these files as needed. (Optional step)
    • ALF_HOME=C:\alfresco-community72

Keystore configuration:

Copy contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\keystore” into “C:\alfresco-community72\alf_data\keystore”

Following files will be copied:

  • CreateSSLKeystores.txt -> Contains instructions to create an RSA public/private key pair for the repository with a certificate that has been signed by the Alfresco Certificate Authority (CA).
  • readme.txt -> Text file containing information about other files in a directory.
  • generate_keystores.bat -> Windows batch file for generating secure keys for SOLR communication.

Note: Useful to generate secure keys for SOLR and Alfresco communication (we are not setting up SSL here so we are just copying the files but we will not be using it for now).

Visit here for more info.


Copy amps:

Copy contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\amps” into “C:\alfresco-community72\amps”. We will be installing alfresco module packages (amps) at later stage.

  • alfresco-share-services.amp -> Alfresco share service module containing extensions for search, datalist, sample sites patch etc.
    • Note: alfresco-share-services.amp installation is mandatory otherwise several functionalities including share search may not work. And you will also see following warning when you login to share: Alfresco is running without Share Services. See your System Administrator for more details.
  • If you have downloaded the additional amps (optional) given below, then copy them to amps/amps_share directories as appropriate. For this post we will be using these amps:
  • support-tools-repo-1.1.0.0-amp.amp
    Copy 'support-tools-repo' amp to "C:\alfresco-community72\amps" directory
  • support-tools-share-1.1.0.0-amp.amp
    Copy 'support-tools-share' amp to "C:\alfresco-community72\amps_share" directory
  • javascript-console-repo-0.7.amp (Updated with ACS7 Compatibility bugfix)
    Copy 'javascript-console-repo' amp to "C:\alfresco-community72\amps" directory
  • javascript-console-share-0.7.amp (Updated with ACS7 Compatibility bugfix)
    Copy 'javascript-console-share' amp to "C:\alfresco-community72\amps_share" directory


Copy scripts and libraries:

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\bin” into “C:\alfresco-community72\bin” directory

Following files will be copied:

  • alfresco-mmt.jar -> Alfresco Module Management Tool (MMT), A java library which supports alfresco module package installation/uninstallation/listing and preview operations etc.
  • apply_amps.bat -> Utility to install amps kept in “amps” and “amps_share” directory. It will install amps related to alfresco on alfresco.war (keeps the backup of original war file) and amps related to share on share.war (keeps the backup of original war file) For more details visit: https://docs.alfresco.com/content-services/latest/install/zip/amp/
  • clean_tomcat.bat -> Shell script for cleaning out temporary application server files from previous installations.
  • Win32NetBIOS.dll -> DLL handles the connection between the native CIFS server and Alfresco Content Services.
  • Win32NetBIOSx64.dll -> DLL handles the connection between the native CIFS server and Alfresco Content Services.
  • Win32Utils.dll -> DLL handles the connection between the native CIFS server and Alfresco Content Services.
  • Win32Utilsx64.dll -> DLL handles the connection between the native CIFS server and Alfresco Content Services.


Copy licenses:

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\licenses” into “C:\alfresco-community72\licenses” directory. It contains files that have information about license terms used by alfresco including all third party licenses.


Configure tomcat for ACS repository:

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\web-server\conf” into “C:\alfresco-community72\tomcat\conf” folder. 'conf' directory contains Catalina repository and Share xml files.

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\web-server\lib\” into “C:\alfresco-community72\tomcat\lib\” folder. 'lib' directory contains the PostgreSQL JDBC jar file (postgresql-42.3.2.jar).

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\web-server\shared\classes” into “C:\alfresco-community72\tomcat\shared\classes\” folder. 'shared' directory includes the Alfresco Content Services configuration files:

  • \classes\alfresco-global.properties.sample -> Sample alfresco global properties file, which is used for configuration properties.
  • \classes\alfresco -> Contains the directory structure for the configuration override files, including the extension, and web-extension directories.


Encryption keystore config:

Create a new directory named 'keystore' under 'C:\alfresco-community72\tomcat\shared\classes\alfresco\extension' directory. We need to copy the 'metadata-keystore' related configs in this newly created directory.

Copy the 'metadata-keystore' directory from 'C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\keystore\metadata-keystore' to 'C:\alfresco-community72\tomcat\shared\classes\alfresco\extension\keystore' directory.

Note: The alfresco's keystore directory (dir.keystore) config location has changed from previous version. 'dir.keystore' property in alfresco-global.properties will now be something like:

'dir.keystore=C:/alfresco-community72/tomcat/shared/classes/alfresco/extension/keystore'

Refer alfresco-global.properties

Metadata encryption keys needs to be now set using 'JAVA_TOOL_OPTIONS' java environment variable. For example:

 

JAVA_TOOL_OPTIONS="-Dencryption.keystore.type=JCEKS -Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding -Dencryption.keyAlgorithm=DESede -Dencryption.keystore.location=C:\alfresco-community72\tomcat\shared\classes\alfresco\extension\keystore\metadata-keystore\keystore -Dmetadata-keystore.password=mp6yc0UD9e -Dmetadata-keystore.aliases=metadata -Dmetadata-keystore.metadata.password=oKIWzVdEdA -Dmetadata-keystore.metadata.algorithm=DESede"

 


We will take a look at it later in this post. For more info visit: https://docs.alfresco.com/content-services/latest/admin/security/#alfresco-keystore-configuration


Delete all files/folders from “C:\alfresco-community72\tomcat\webapps”.

Copy the contents from “C:\Downloads\alfresco-content-services-community-distribution-7.2.0.1\web-server\webapps” into “C:\alfresco-community72\tomcat\webapps\” folder.

Following files will be copied:

  • alfresco.war -> Alfresco repository web application.
  • share.war -> Share interface web application.
  • ROOT.war -> Application for the server root, also contains additional code/setup for handling alfresco office services module (alfresco-office-services). Alfresco Office Services (AOS) allow you to access Alfresco Content Services directly from all your Microsoft Office applications. We will not be installing this module since SSL is a mandatory enablement for this module.
  • _vti_bin.war -> App to help and support AOS module.

Delete all files/folders from “C:\alfresco-community72\tomcat\work\Catalina\localhost” if there are any.

Open and edit server.xml file which can be found under: “C:\alfresco-community72\tomcat\conf” directory [Full path: C:\alfresco-community72\tomcat\conf\server.xml]:

Find Connector with port "8080”.
Add the URIEncoding and maxHttpHeaderSize attributes.

 

<Connector port="8080" protocol="HTTP/1.1"
URIEncoding="UTF-8" connectionTimeout="20000"
maxHttpHeaderSize="32768"
redirectPort="8443" />

 

Tomcat uses ISO-8859-1 character encoding when decoding URLs that are received from a browser. This can cause problems when creating, uploading, and renaming files with international characters. By default, Tomcat uses an 8 KB header buffer size, which might not be large enough for the Kerberos authentication protocol. We need to increase this buffer size.

Update AJP Connector config you are planning to use it. By default it is commented in tomcat server.xml, make sure you add URIEncoding attribute to the config if you are planning to use it. This port is used when configuring external authentication.

See here for more details:

https://docs.alfresco.com/content-services/latest/admin/auth-sync/

 

<Connector port="8009" address="::1" URIEncoding="UTF-8" protocol="AJP/1.3" redirectPort="8443" />

 


Open and edit the C:\alfresco-community72\tomcat\conf\catalina.properties file:

Update the value of the shared.loader= property to the following:

 

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

 


Note: If you have used alternative names for the directories, you must specify these names in the shared.loader property.

We need to add JAVA_TOOL_OPTIONS java environment variable for metadata encryption, we had copied the keystore under 'C:\alfresco-community72\tomcat\shared\classes\alfresco\extension\keystore\metadata-keystore' directory already. Check the steps above. Open and edit C:\alfresco-community72\tomcat\bin\catalina.bat

 

rem ACS72 Custom changes [Start] ##############

set "JAVA_TOOL_OPTIONS=-Dencryption.keystore.type=JCEKS -Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding -Dencryption.keyAlgorithm=DESede -Dencryption.keystore.location=C:\alfresco-community72\tomcat\shared\classes\alfresco\extension\keystore\metadata-keystore\keystore -Dmetadata-keystore.password=mp6yc0UD9e -Dmetadata-keystore.aliases=metadata -Dmetadata-keystore.metadata.password=oKIWzVdEdA -Dmetadata-keystore.metadata.algorithm=DESede"
rem ACS72 Custom changes [End] ##############


Rename “C:\alfresco-community72\tomcat\shared\classes\alfresco-global.properties.sample” to “alfresco-global.properties”

Open and edit “C:\alfresco-community72\tomcat\shared\classes\alfresco-global.properties” and add the following configuration properties:

Add the “dir.root” property as path to alf_data folder and add 'dir.keystore' property to the above copied encryption keystore path (see here)

 

dir.root=C:/alfresco-community72/alf_data
dir.keystore=C:/alfresco-community72/tomcat/shared/classes/alfresco/extension/keystore

Add alfresco and share host, port, context and protocol specific properties. For more details see: https://docs.alfresco.com/content-services/latest/config/#using-alfresco-globalproperties

 

alfresco.context=alfresco
alfresco.host=${localname}
alfresco.port=8080
alfresco.protocol=http
share.context=share
share.host=${localname}
share.port=8080
share.protocol=http

 

Add the database connection properties which alfresco will use to create a JDBC connection with db. Use the db name and credentials when we prepared the database.

 

db.driver=org.postgresql.Driver
db.username=alfresco
db.password=alfresco
db.name=alfresco
db.url=jdbc:postgresql://localhost:5432/${db.name}
db.pool.max=275
db.pool.validate.query=SELECT 1

 

Add the server mode property, leave it default to ‘UNKNOWN’.

 

system.serverMode=UNKNOWN

 

Add the alfresco rmi services port and host properties.

 

alfresco.rmi.services.port=50500
alfresco.rmi.services.host=0.0.0.0


Local Transformation Service Setup


To setup Local transformation service setup, we need to install Imagemagick, Libreoffice and AlfrescoPDFRenderer locally and executables will be used by transformation service spring boot application.

Install imagemagick in the directory setup as per the structure given above. E.g. install ImageMagick-7.1.0-33 in C:\alfresco-community72\imagemagick directory (use custom installation option to select the install directory). Alternatively you can download the binary package and extract the image magic binaries in the folder given above as per your choice.

image.png

Install libreoffice in the directory setup as per the structure given above. E.g. install LibreOffice_7.0.6.2 in C:\alfresco-community72\libreoffice directory (use custom installation option to select the install directory).

image.png
Install ActiveMQ, get the activemq binary package (apache-activemq-5.16.2-bin.zip) downloaded as per the steps given above and extract its contents directly under activemq directory. For example: C:\alfresco-community72\activemq directory.

image.png
Note: Make sure ports 61616, 5672, 61613, 1883, 61614 and 8161 are open and not in use already. These are default ports used for activemq. If you have these ports already in use, make sure you change the ports accordingly in <AMQ_INSTALLATION>/conf/activemq.xml and jetty.xml as needed.

Alfresco PDF Renderer Setup:

Assuming you have already downloaded the alfresco-pdf-renderer package from download locations provided above. Use the below given steps to install alfresco-pdf-renderer.

Extract “C:\Downloads\alfresco-pdf-renderer-1.1-win64.tgz", then again extract from "alfresco-pdf-renderer-1.1-win64.tar" and the copy the executables to "C:\alfresco-community72\alfresco-pdf-renderer"


Exiftool Setup:

Seems like TIKA part of Local transformation service app is looking for exiftool to be available locally. It is used by TIKA for extracting image metadata if TIKAAuto metadata extraction is enabled. I noticed an error when 'exiftool-parser' was invoked by TIKA. So we will download and copy the exiftool under alfresco installation and export its path in environment PATH variable. Assuming you have already downloaded the exiftool package from download locations provided above. Use the below given steps to install exiftool

Create a new directory under "C:\alfresco-community72\"
Extract “C:\Downloads\image-exiftool-12.25.tgz", then again extract from "Image-ExifTool-12.25.tar" and the copy the executables to "C:\alfresco-community72\exiftool"

Set the exiftool directory to Windows PATH Environment Variable:

 

%ALF_HOME%\exiftool

 

 

Update alfresco-global.properties to enable transformation service:

Open and edit “C:\alfresco-community72\tomcat\shared\classes\alfresco-global.properties

Enable local transformation service (its enabled by default but just FYI here):

 

localTransform.core-aio.url=http://localhost:8090/

# This property is default true, here it it for information purpose.
local.transform.service.enabled=true

Add the activemq url property and enabled messaging subsystem. It will be used when you setup transformation service.

 

messaging.broker.url=tcp://localhost:61616

# This property is default true, here it it for information purpose.
messaging.subsystem.autoStart=true

# If you have setup username and password for AMQ, then set the below properties. In my case I have kept default admin/admin
messaging.broker.username=admin
messaging.broker.password=admin

 

Set transformation core aio launcher and steps to launch:

Assuming you have downloaded the transform-core-aio-boot jar file already as per instruction given above.

Copy the downloaded jar file to ''C:\alfresco-community72\bin\" directory.


Post setup of activemq, imagemagick, libreoffice, alfresco-pdf-renderer and transform core all in one boot project jar file and you can start transform-core-aio boot app with following java command with given params:

 

java -DPDFRENDERER_EXE="<alfresco-pdf-renderer_installation_dir>/alfresco-pdf-renderer"
-DLIBREOFFICE_HOME="<libreoffice_installation_dir>"
-DIMAGEMAGICK_ROOT="<imagemagick_installation_dir>"
-DIMAGEMAGICK_DYN="<imagemagick_installation_dir>/lib"
-DIMAGEMAGICK_EXE="<imagemagick_installation_dir>/bin/convert"
-DIMAGEMAGICK_CODERS="<imagemagick_installation_dir>/modules-Q16HDRI/coders"
-DIMAGEMAGICK_CONFIG="<imagemagick_installation_dir>/config-Q16HDRI"
-DACTIVEMQ_URL=failover:(tcp://server:61616)?timeout=3000
-jar <path_to_tranform-core-aio-jar>/alfresco-transform-core-aio-boot-x.y.z.jar

Example (see here as well):

 

java -DPDFRENDERER_EXE="C:\alfresco-community72\alfresco-pdf-renderer\alfresco-pdf-renderer.exe" 
-DLIBREOFFICE_HOME="C:\alfresco-community72\libreoffice"
-DIMAGEMAGICK_ROOT="C:\alfresco-community72\imagemagick"
-DIMAGEMAGICK_DYN="C:\alfresco-community72\imagemagick"
-DIMAGEMAGICK_CODERS="C:\alfresco-community72\imagemagick\modules\coders"
-DIMAGEMAGICK_CONFIG="C:\alfresco-community72\imagemagick"
-DIMAGEMAGICK_EXE="C:\alfresco-community72\imagemagick\convert.exe"
-DACTIVEMQ_URL=tcp://localhost:61616?timeout=3000 -jar
C:\alfresco-community72\bin\alfresco-transform-core-aio-boot-2.5.7.jar


If local transformation service is correctly setup as per above instructions and starts up successfully, then you can also access the local transformation service at http://localhost:8090 and play around with samples.

localtransform-windows.JPG

Important Notes:

The jar file we are using above is with OOTB functionalities. As many of you know that most transformation service related classes are moved to alfresco-transform-core project.

Check here what's in repo and what is moved: https://docs.alfresco.com/content-services/latest/develop/repo-ext-points/metadata-extractors/#ootbe...

Take an example of metadata extractors, earlier when you had to override metadata extractor configuration such as for PdfBoxMetadataExtracter, TikaAutoMetadataExtractor, PoiMetadataExtracter etc., you can define spring beans and override them by providing custom <metadata Extractor>.properties file on the repository side itself as legacy transformation service was still within repository. See example here up to ACS6.x.

Now, there is no more legacy transformation service available, you have to build custom docker image with your customization (if you are using containers) or build jar file with your custom changes to launch Local transformation service (if setup is using distribution package or ansible).

Documentation here indicates that, you can directly update the properties here and build customized jar/docker images and use it. I haven't tried myself yet, but do checkout the pointers given above.

Some useful posts pertaining to transformation service for you to refer:

Alfresco Transform Core Project

Alfresco Transform Core AIO Boot App

Alfresco Transform Core AIO Boot App Jar Download

Installing Transformation Service

How to use local transformation service

Local vs Legacy Transformation Service

Metadata Extractors and Embedders Extension Point

 

Update alfresco-global.properties to add other misc. properties:

Add property for email notification on invite, it is by default disabled.

 

notification.email.siteinvite=false

 

Add the license location property.

 

### License location ###
dir.license.external=C:/alfresco-community72

Add following properties related to security, smart folder and JMX. All values are default out-of-the-box

 

security.anyDenyDenies=false
smart.folders.enabled=false
alfresco.jmx.connector.enabled=false

 

Enable logging so that you can configure any custom loggers or change/update log levels (Optional)

  • Go to C:\alfresco-community72\tomcat\shared\classes\alfresco\extension\ folder and rename “custom-log4j.properties.sample” to “custom-log4j.properties
  • You can change the log levels as per your need.


Apply amps to alfresco.war and share.war:

Mandatory Amps:

  • “alfresco-share-services.amp” amp is mandatory for alfresco.war
  • Note: This amp installation is mandatory otherwise several functionalities including share search may not work. And you will also see following warning when you login to share: Alfresco is running without Share Services. See your System Administrator for more details

Optional Amps:

As part of this installation, we will be installing some optional amps which will be useful for admins/developers that can help in debugging and administration. In a previous step above we downloaded the amps and copied to appropriate directories.


Execute 'apply_amps.bat' script to apply amps, it will install amps copied under C:\alfresco-community72\amps and C:\alfresco-community72\amps_share directories to alfresco.war and share.war.

  • Open windows command prompt
  • Go to C:\alfresco-community72\bin path
  • Execute the 'apply_amps.bat'
  • After amps are install, you can choose to remove the backup files created by apply_amps.bat tool.

You would see following output as result of executing 'apply_amps.bat':

This script will apply all the AMPs in C:\alfresco-community72\amps to the alfresco.war and share.war files in C:\alfresco-community72\tomcat\webapps
Press control-c to stop this script . . .
Press any key to continue . . .
Module 'ootbee-support-tools-repo' installed in 'C:\alfresco-community72\tomcat\webapps\alfresco.war'
- Title: OOTBee Support Tools - Repository Module
- Version: 1.1.0.0.9999999999
- Install Date: Sun May 15 00:07:59 EDT 2022
- Description: Addon to enhance the Repository and Share Admin Console/Tools with new tools and make tools previously exclusive to the Enterprise Edition addon Alfresco Support Tools available in Community Edition
Module 'de.fme.alfresco.JavascriptConsole-repo' installed in 'C:\alfresco-community72\tomcat\webapps\alfresco.war'
- Title: fme Javascript Console Repository Extension
- Version: 0.7.2106071737
- Install Date: Sun May 15 00:07:58 EDT 2022
- Description: Administration console module to execute arbitrary javascript code.
Module 'alfresco-share-services' installed in 'C:\alfresco-community72\tomcat\webapps\alfresco.war'
- Title: Alfresco Share Services AMP
- Version: 14.147
- Install Date: Sun May 15 00:07:58 EDT 2022
- Description: Module to be applied to alfresco.war, containing APIs for Alfresco Share
Module 'support-tools-share' installed in 'C:\alfresco-community72\tomcat\webapps\share.war'
- Title: OOTBee Support Tools - Share Module
- Version: 1.1.0.0.9999999999
- Install Date: Sun May 15 00:08:07 EDT 2022
- Description: Addon to enhance the Repository and Share Admin Console/Tools with new tools and make tools previously exclusive to the Enterprise Edition addon Alfresco Support Tools available in Community Edition
Module 'de.fme.alfresco.JavascriptConsole-share' installed in 'C:\alfresco-community72\tomcat\webapps\share.war'
- Title: fme Javascript Console Share Extension
- Version: 0.7.2106071738
- Install Date: Sun May 15 00:08:05 EDT 2022
- Description: Adminstration console module to execute arbitrary javascript code.
.
About to clean out tomcat/webapps/alfresco directory and temporary files...
Press any key to continue . . .

 

Share Config Custom Changes

Make sure you update the "repository-url" to point to the alfresco host and port, in case you are setting up alfresco and share on different servers. Default values are "localhost" and "8080". We are setting up both ACS and Share on same host so we will leave it default.

 

<!--
If set, will present a WebDAV link for the current item on the Document and Folder details pages.
Also used to generate the "View in Alfresco Explorer" action for folders.
-->
<repository-url>http://localhost:8080/alfresco</repository-url>


Make sure you update the share "Remote" configuration to point to the alfresco host and port, in case you are setting up alfresco and share on different servers. Default values are "localhost" and "8080". We are setting up both ACS and Share on same host so we will leave it default.

 

<config evaluator="string-compare" condition="Remote">
<remote>
<endpoint>
<id>alfresco-noauth</id>
<name>Alfresco - unauthenticated access</name>
<description>Access to Alfresco Repository WebScripts that do not require authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>

<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that require user authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
<identity>user</identity>
</endpoint>

<endpoint>
<id>alfresco-feed</id>
<name>Alfresco Feed</name>
<description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
<connector-id>http</connector-id>
<endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
<basic-auth>true</basic-auth>
<identity>user</identity>
</endpoint>

<endpoint>
<id>alfresco-api</id>
<parent-id>alfresco</parent-id>
<name>Alfresco Public API - user access</name>
<description>Access to Alfresco Repository Public API that require user authentication.
This makes use of the authentication that is provided by parent 'alfresco' endpoint.</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8080/alfresco/api</endpoint-url>
<identity>user</identity>
</endpoint>
</remote>
</config>

 


For more details see:
https://docs.alfresco.com/content-services/latest/develop/share-ext-points/share-config/#setting-def...

There is a known issue with share where user search doesn't work. For more info see these issues (The issue still persist in Share 7):

https://github.com/Alfresco/acs-community-packaging/issues/367

https://github.com/Alfresco/acs-community-deployment/issues/85

Find the <show-authorization-status>true</show-authorization-status> tag and change the value to 'false', in the config having condition as "users".

If the config not present and you can't find the '<show-authorization-status>' element then add the following config and keep the value for '<show-authorization-status>' as 'false'. Update C:\alfresco-community72\tomcat\shared\classes\alfresco\web-extension\share-config-custom.xml, Add below given config where <show-authorization-status> value should be false.


Update C:\alfresco-community72\tomcat\shared\classes\alfresco\web-extension\share-config-custom.xml

<config evaluator="string-compare" condition="Users" replace="true">
<users>
<!-- minimum length for username and password -->
<username-min-length>2</username-min-length>
<password-min-length>3</password-min-length>
<!-- Default value is 'true', setting it to 'false' to fix the user search issue. -->
<show-authorization-status>false</show-authorization-status>
</users>
<!-- This enables/disables the Add External Users Panel on the Add Users page. -->
<enable-external-users-panel>false</enable-external-users-panel>
</config>

 

Setup and Configure ASS (Alfresco Search Services):

Assuming you have already downloaded the distribution packages from download locations provided above. Use the below given steps to setup and configure alfresco-search-services-2.0.3.5.

Unzip the “alfresco-search-services-2.0.3.5.zip” package which we downloaded initially.
Copy the extracted folder “alfresco-search-services” to e.g. C:\ drive. Full path will be “C:\alfresco-search-services”
Open “C:\alfresco-community72\tomcat\shared\classes\alfresco-global.properties” and add the following configuration properties:

solr.host=localhost
solr.port=8983
solr.secureComms=secret #Possible values are: secret, https

solr.sharedSecret=secret
solr.base.url=/solr
index.subsystem.name=solr6


Note: We are setting up solr6 without SSL and with shared secret, hence using non SSL port and setting secureComms property as secret.

We are enabling the multi language search support, Its optional if you wish to enable it. By default it is disabled. Open “C:\alfresco-search-services\solrhome\conf\shared.properties” and update following:

alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text
alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content
alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext

We are enabling search suggestions for some properties, it is disabled by default. This feature is optional if you wish to enable it. You can also add additional properties down the line. Open “C:\alfresco-search-services\solrhome\conf\shared.properties” and update following:

alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name

alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title
alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description
alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content

More details on shared.properties can be found here: https://docs.alfresco.com/search-services/latest/install/options/

If you would setup search services on a different or remote machine, you would need to set the SOLR_SOLR_HOST, SOLR_SOLR_PORT, SOLR_SOLR_BASEURL, SOLR_ALFRESCO_HOST, SOLR_ALFRESCO_PORT and SOLR_ALFRESCO_BASEURL environment variables. This is optional but we will keep the mapping for future reference.
We are setting up without SSL, so set this variable SOLR_ALFRESCO_SECURECOMMS to secret. It is mandatory as default value is https. And Set the 'JAVA_TOOL_OPTIONS' variable to pass the JVM arguments for Solr and Alfresco shared secret communication mechanism. Open “C:\alfresco-search-services\solr.in.cmd” file and add following at the end of the file:

set SOLR_SOLR_HOST=localhost

set SOLR_SOLR_PORT=8983
set SOLR_SOLR_BASEURL=/solr
set SOLR_ALFRESCO_HOST=localhost
set SOLR_ALFRESCO_PORT=8080
set SOLR_ALFRESCO_BASEURL=/alfresco

:: Since we are setting up with no SSL and shared secret, this property need to be set to secret. Default is https
set SOLR_ALFRESCO_SECURECOMMS=secret


rem ACS72 shared secret changes [Start] ##############
set JAVA_TOOL_OPTIONS=-Dalfresco.secureComms.secret=secret
rem ACS72 shared secret changes [Start] ##############

You can also set SOLR_HOME variable in solr.in.cmd (if you see error like ERROR: Solr home directory C:\alfresco-search-services must contain solr.xml, then this setting is must)

set SOLR_HOME=C:\alfresco-search-services\solrhome

Alternatively you can set the properties in “C:\alfresco-search-services\solrhome\templates\rerank\conf\solrcore.properties” file as well before cores are created. If you have both alfresco and archive cores already created use the environment variable based approach. Example:

alfresco.host=localhost
alfresco.port=8080
alfresco.port.ssl=8443
alfresco.baseUrl=/alfresco
# secret, https
alfresco.secureComms=secret

For all the externalized search service configurations (environment variables), visit: https://docs.alfresco.com/search-services/latest/config/#search-services-externalized-configuration

Starting and stopping solr6 (aka alfresco search service) instructions.

Starting Solr6:

.\solr\bin\solr.cmd start -a "-Dcreate.alfresco.defaults=alfresco,archive"

The command line param, -a passes additional JVM parameters, e.g., system properties using -D.

Note that, -Dcreate.alfresco.defaults=alfresco,archive command automatically creates the alfresco and archive cores. So you need to pass this param only on first/initial startup of solr in order to allow cores being created and configured.

Once Search Services is up and running, you should see a message similar to the following:

Startup message:

Waiting up to 180 seconds to see Solr running on port 8983 [\]
Started Solr server on port 8983 (pid=443218). Happy searching!

Stopping Solr6:

.\solr\bin\solr.cmd stop -p 8983

Or

.\solr\bin\solr.cmd stop -all

Configure solr log, The logs are stored in the C:\alfresco-search-services\logs\solr.log file, by default. This can be configured in solr.in.cmd using SOLR_LOGS_DIR. This is optional setup. We are keeping default settings

set SOLR_LOGS_DIR=..\..\logs
set LOG4J_CONFIG=file:!SOLR_LOGS_DIR!\log4j.properties

Verify the SOLR Admin UI. Use the URL below to launch SOLR Admin UI and validate the status and cores, Solr shared secret mode doesn't include authentication by default, but it will require to add the shared secret word ("secret" we have used above) in HTTP Header requests using by default X-Alfresco-Search-Secret property. Accessing SOLR Web Console requires using a Browser plugin to add this header to the HTTP Request.

http://localhost:8983/solr (Pass X-Alfresco-Search-Secret http header with shared secret value)

http://localhost:8983/solr/#/alfresco --> To check alfresco core status

You will see following warning when you try to access the solr admin console without the shared secret header.

You can use the modheader browser extension to pass the header info, for example:

 

 

Now we are done with all the setup and config changes. Here are full “alfresco-global.properties”, “custom-log4j.properties”, “shared.properties” , “solr.in.cmd”, "solrcore.properties" files for reference:

alfresco-global.properties:

###############################
## Common Alfresco Properties #
###############################


dir.root=C:/alfresco-community72/alf_data
dir.contentstore=${dir.root}/contentstore
dir.contentstore.deleted=${dir.root}/contentstore.deleted


#
# Encryption properties
#
# default keystores location is now this, it was changed from previous versions
# for more details see: https://docs.alfresco.com/content-services/latest/admin/security/#alfresco-keystore-configuration
dir.keystore=C:/alfresco-community72/tomcat/shared/classes/alfresco/extension/keystore

#
# URL Generation Parameters (The ${localname} token is replaced by the local server name)
#-------------
alfresco.context=alfresco
alfresco.host=${localname}
alfresco.port=8080
alfresco.protocol=http
share.context=share
share.host=${localname}
share.port=8080
share.protocol=http

### database connection properties ###
db.driver=org.postgresql.Driver
db.username=alfresco
db.password=alfresco
db.name=alfresco
db.url=jdbcSmiley Tongueostgresql://localhost:5432/${db.name}
# Note: your database must also be able to accept at least this many connections. Please see your database documentation for instructions on how to configure this.
db.pool.max=275
db.pool.validate.query=SELECT 1

# The server mode. Set value here
# UNKNOWN | TEST | BACKUP | PRODUCTION
system.serverMode=UNKNOWN

### RMI registry port for JMX ###
alfresco.rmi.services.port=50500

# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.
# This allows connections to JMX both remotely and locally.
alfresco.rmi.services.host=0.0.0.0

#
#
# Assign individual ports for each service for best performance
# or run several services on the same port. You can even run everything on 50500 if needed.
# Select 0 to use a random unused port.
#monitor.rmi.service.port=50508


### E-mail site invitation setting ###
notification.email.siteinvite=false

### License location ###
dir.license.external=C:/alfresco-community72

### Allow extended ResultSet processing
security.anyDenyDenies=false

### Smart Folders Config Properties ###
smart.folders.enabled=false

### Remote JMX (Default: disabled) ###
alfresco.jmx.connector.enabled=false

## AMQ And Transformation services
localTransform.core-aio.url=http://localhost:8090/
local.transform.service.enabled=true
messaging.broker.url=tcp://localhost:61616
messaging.subsystem.autoStart=true
#If you have setup username and password for AMQ, then set the below properties. In my case I have kept default admin/admin
messaging.broker.username=admin
messaging.broker.password=admin

################ Solr Search service configurations ###############

#
# Index Recovery Mode
#-------------
#index.recovery.mode=AUTO

# Set this property unless you have explicitly chosen to expose some repository APIs without authentication
solr.host=localhost
solr.port=8983
#secret, https
solr.secureComms=secret
solr.sharedSecret=secret
solr.base.url=/solr
index.subsystem.name=solr6


custom-log4j.properties:

#Tranformer specific logs
log4j.logger.org.alfresco.repo.content.transform.TransformerDebug=info
log4j.logger.org.alfresco.util.exec.RuntimeExecBootstrapBean=info
log4j.logger.org.alfresco.util.exec.RuntimeExec=info

#ScriptLogger
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

#Log for email executer
log4j.logger.org.alfresco.repo.action.executer.MailActionExecuter=info

#Transaction specific logs
log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=info

#Solr specific logs
log4j.logger.org.alfresco.solr.query.AbstractQParser=debug
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug

#Metadata extractor
log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=info
log4j.logger.org.alfresco.repo.content.metadata.MetadataExtracterRegistry=info

#Thumbnail logs
log4j.logger.org.alfresco.repo.thumbnail=info

# FTP server debugging
log4j.logger.org.alfresco.ftp.protocol=info
log4j.logger.org.alfresco.ftp.server=info


shared.properties:


# Shared Properties file

#Host details an external client would use to connect to Solr
solr.host=localhost
#If not set then solr.port will be the jetty.port
#solr.port=8983
solr.baseurl=/solr

# Properties treated as identifiers when indexed

alfresco.identifier.property.0={http://www.alfresco.org/model/content/1.0}creator
alfresco.identifier.property.1={http://www.alfresco.org/model/content/1.0}modifier
alfresco.identifier.property.2={http://www.alfresco.org/model/content/1.0}userName
alfresco.identifier.property.3={http://www.alfresco.org/model/content/1.0}authorityName
alfresco.identifier.property.4={http://www.alfresco.org/model/content/1.0}lockOwner

# Suggestable Properties
alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name
alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title
alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description
alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content

# Data types that support cross locale/word splitting/token patterns if tokenised
alfresco.cross.locale.property.0={http://www.alfresco.org/model/content/1.0}name
alfresco.cross.locale.property.1={http://www.alfresco.org/model/content/1.0}lockOwner

# Data types that support cross locale/word splitting/token patterns if tokenised
alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text
alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content
alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext

alfresco.model.tracker.cron=0/10 * * * * ? *

# Whether path queries are enabled.
alfresco.cascade.tracker.enabled=true


solr.in.cmd:

@echo off

REM Increase Java Min/Max Heap as needed to support your indexing / query needs
set SOLR_JAVA_MEM=-Xms2g -Xmx2g

REM Alfresco configuration. This file is automatically included by solr. You can define your custom settings here
set SOLR_OPTS=%SOLR_OPTS% -Dsolr.jetty.request.header.size=1000000 -Dsolr.jetty.threads.stop.timeout=300000 -Ddisable.configEdit=true

REM Location where Solr should write logs to. Absolute or relative to solr start dir
set SOLR_LOGS_DIR=..\..\logs
set LOG4J_CONFIG=file:!SOLR_LOGS_DIR!\log4j.properties


set SOLR_SOLR_HOST=localhost
set SOLR_SOLR_PORT=8983
set SOLR_SOLR_BASEURL=/solr
set SOLR_ALFRESCO_HOST=localhost
set SOLR_ALFRESCO_PORT=8080
set SOLR_ALFRESCO_BASEURL=/alfresco

:: Since we are setting up with no SSL, this property need to be set to secret. Default is https
set SOLR_ALFRESCO_SECURECOMMS=secret

rem ACS72 shared secret changes [Start] ##############
set JAVA_TOOL_OPTIONS=-Dalfresco.secureComms.secret=secret
rem ACS72 shared secret changes [Start] ##############

 

solrcore.properties (Highlighting important properties only):

alfresco.host=localhost

alfresco.port=8080

alfresco.port.ssl=8443

alfresco.baseUrl=/alfresco


# secret, https
alfresco.secureComms=secret

Start and test:


There are three services that we need to start one by one in order:

Start ActiveMQ
To start ActiveMQ, you can execute the following:
Open command prompt and execute this command: C:\alfresco-community72\activemq\bin\win64\activemq.bat start

Start localTransformationService
To start Local transformation service, you can execute the following:
Open command prompt and execute this command: java -DPDFRENDERER_EXE="C:\alfresco-community72\alfresco-pdf-renderer\alfresco-pdf-renderer.exe" -DLIBREOFFICE_HOME="C:\alfresco-community72\libreoffice" -DIMAGEMAGICK_ROOT="C:\alfresco-community72\imagemagick" -DIMAGEMAGICK_DYN="C:\alfresco-community72\imagemagick" -DIMAGEMAGICK_CODERS="C:\alfresco-community72\imagemagick\modules\coders" -DIMAGEMAGICK_CONFIG="C:\alfresco-community72\imagemagick" -DIMAGEMAGICK_EXE="C:\alfresco-community72\imagemagick\convert.exe" -DACTIVEMQ_URL=tcp://localhost:61616?timeout=3000 -jar C:\alfresco-community72\bin\alfresco-transform-core-aio-boot-2.5.7.jar

Start DB
To start DB, you can do either of the following:
Use windows services, and start “postgresql-x64-13” service.
Or Open command prompt and execute this command: C:\PostgreSQL\13\bin\pg_ctl.exe start -D “C:\PostgreSQL\13\data"

Start Alfresco
To start Alfresco, you can do either of the following:
Open command prompt and navigate to “C:\alfresco-community72\tomcat\bin” and execute following command: catalina.bat start
Or navigate to “C:\alfresco-community72\tomcat\bin” folder and execute “startup.bat”

Start Solr6
To start SOLR6, use the following command by navigating to “C:\alfresco-search-services\solr\bin” folder via command prompt:
Initial start only: C:\alfresco-search-services\solr\bin\solr.cmd start -a "-Dcreate.alfresco.defaults=alfresco,archive"
Consecutive start command: C:\alfresco-search-services\solr\bin\solr.cmd start

Note: See the search service configuration section for more details.

 

I have created this bat file “start.bat”, you can use this to start all services instead of doing one by one.

start.bat:


@echo off

ECHO ################ Starting ACS, DB, Local Transformation Service and Solr Services ##############
ECHO.


SET ALF_INSTALL_PATH=%1
SET SOLR_INSTALL_PATH=%2
SET POSTGRES_INSTALL_PATH=%3

:init
IF "%~1" == "" (
SET ALF_INSTALL_PATH=C:\\alfresco-community72
)

IF "%~2" == "" (
SET SOLR_INSTALL_PATH=C:\\alfresco-search-services
)

IF "%~3" == "" (
SET POSTGRES_INSTALL_PATH=C:\\PostgreSQL\\13
)

goto startAMQLocal

:startAMQLocal
echo.
echo Starting Active MQ service ...
start "ActiveMQ" /MIN cmd /c %ALF_INSTALL_PATH%\activemq\bin\win64\activemq.bat start
timeout 10
if errorlevel 1 (goto end) else (goto startTrServLocal)


:startTrServLocal
echo.
echo Starting Local transformation service..
start "localTransformationService" java -DPDFRENDERER_EXE="%ALF_INSTALL_PATH%\\alfresco-pdf-renderer\\alfresco-pdf-renderer.exe"^
-DLIBREOFFICE_HOME="%ALF_INSTALL_PATH%\\libreoffice"^
-DIMAGEMAGICK_ROOT="%ALF_INSTALL_PATH%\\imagemagick"^
-DIMAGEMAGICK_DYN="%ALF_INSTALL_PATH%\\imagemagick"^
-DIMAGEMAGICK_CODERS="%ALF_INSTALL_PATH%\\imagemagick\\modules\\coders"^
-DIMAGEMAGICK_CONFIG="%ALF_INSTALL_PATH%\\imagemagick"^
-DIMAGEMAGICK_EXE="%ALF_INSTALL_PATH%\\imagemagick\\convert.exe"^
-DACTIVEMQ_URL=failoverSmiley Sadtcp://localhost:61616)?timeout=3000^
-jar %ALF_INSTALL_PATH%\\bin\\alfresco-transform-core-aio-boot-2.5.7.jar

timeout 10

if errorlevel 1 (goto end) else (goto startDB)

:startDB
echo Starting DB...
:: Using the windows service to start the db.
:: net start postgresql-x64-13
REM You can also use this command, if there is any issue with permission elevation on windows
%POSTGRES_INSTALL_PATH%\bin\pg_ctl.exe restart -D "%POSTGRES_INSTALL_PATH%\data"
if errorlevel 1 (goto end) else (goto startACS)

:startACS
echo.
echo Starting ACS...
SET CATALINA_HOME=%ALF_INSTALL_PATH%\tomcat
start "Tomcat" /MIN /WAIT cmd /c %ALF_INSTALL_PATH%\tomcat\bin\catalina.bat start
if errorlevel 1 (goto end) else (goto startSolr)

:startSolr
echo.
set "initial=false"

:: check if cores exists
echo.
set "initial=false"
CD %SOLR_INSTALL_PATH%\solrhome
:: check if cores exists

set Exts=alfresco archive
for %%A in (%Exts%) do (
echo Checking core: %%A
if not exist %%A\NUL (
echo %%A doesn't exist
set "initial=true"
) else (
echo %%A already exist
set "initial=false"
)
)

CD %ALF_INSTALL_PATH%
if "%initial%" == "true" (
GOTO startSolrInitial
) else (
GOTO startSolrConsecutive
)

:startSolrInitial
echo.
echo Starting SOLR for the first time, alfresco and archive cores will be created...
start "SOLR6" /MIN /WAIT cmd /c %SOLR_INSTALL_PATH%\solr\bin\solr.cmd start -a "-Dcreate.alfresco.defaults=alfresco,archive"
if errorlevel 1 (goto end)

:startSolrConsecutive
echo.
echo Starting SOLR...
start "SOLR6" /MIN /WAIT cmd /c %SOLR_INSTALL_PATH%\solr\bin\solr.cmd start
if errorlevel 1 (goto end)

:end
echo.
echo Exiting..
timeout 10

 

http://localhost:8080/alfresco

http://localhost:8080/share

 

 

Note: If you see any warning in logs such as "org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/alfresco/templates/org/alfresco/dashboard.ftl] to the cache for web application [/share] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache" or "org.apache.catalina.webresources.Cache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [/share] - consider increasing the maximum size of the cache. After eviction approximately [9,411] KB of data remained in the cache." then you can increase the resource case of disable resource caching. Follow the below given steps if you see these warnings:

By default value for resource caching is 10240 kbytes, even when not added to [ALF_HOME]\tomcat\conf\context.xml. so either increase it until you stop seeing the warning or disable it completely.
Make sure you clean the tomcat 'work' (C:\alfresco-community72\tomcat\work\Catalina) directory before restarting the server.

<Resources cacheMaxSize="100000" cachingAllowed="true"/>

Or disable the caching

<Resources cachingAllowed="false" />

The above configuration is default for tomcat but since for 'alfresco' and 'share' webapps we have cross contexts under '[ALF_HOME]\tomcat\conf\Catalina\localhost\ ' directory.

Make the above given configuration changes in "alfresco.xml" and "share.xml" and clean the tomcat 'work' (C:\alfresco-community72\tomcat\work\Catalina) directory before restarting the server

<Context crossContext="true">
<Resources cachingAllowed="true" cacheMaxSize="100000">
<PostResources base="${catalina.base}/../modules/platform"
className="org.apache.catalina.webresources.DirResourceSet"
webAppMount="/WEB-INF/lib"/>
</Resources>
</Context>

<Context crossContext="true">
<Resources cachingAllowed="true" cacheMaxSize="100000">
<PostResources base="${catalina.base}/../modules/share"
className="org.apache.catalina.webresources.DirResourceSet"
webAppMount="/WEB-INF/lib"/>
</Resources>
</Context>


Stopping:


There are three services that we need to stop one by one in order:

Stop localTransformationService
Kill the process running the service on windows command processor.

Stop Alfresco
To stop Alfresco, you can do either of the following:
Open command prompt and navigate to “C:\alfresco-community72\tomcat\bin” and execute following command: catalina.bat stop
Or navigate to “C:\alfresco-community72\tomcat\bin” folder and execute “shutdown.bat”

Stop DB
To stop DB, you can do either of the following:
Use windows services, and stop “postgresql-x64-11” service.
Or Open command prompt and execute this command: C:\PostgreSQL\13\bin\pg_ctl.exe stop -D “C:\PostgreSQL\13\data"

Stop Solr6
To stop SOLR6, use the following command by navigating to “C:\alfresco-search-services\solr\bin” folder via command prompt:
C:\alfresco-search-services\solr\bin\solr.cmd stop -all
Or C:\alfresco-search-services\solr\bin\solr.cmd stop -p 8983

Note: See the search service configuration section for more details.

Stop ActiveMQ
To start ActiveMQ, you can execute the following:
Open command prompt and execute this command: C:\alfresco-community72\activemq\bin\win64\activemq.bat stop
or Kill the process running the service on windows command processor.


I have created this bat file “stop.bat”, you can use this to stop all services instead of doing one by one.

stop.bat:


@echo off

ECHO ################ Stopping ACS, DB, Local Transformation Service and Solr Services ##############
ECHO.

SET ALF_INSTALL_PATH=%1
SET SOLR_INSTALL_PATH=%2
SET POSTGRES_INSTALL_PATH=%3

:init
IF "%~1" == "" (
SET ALF_INSTALL_PATH=C:\\alfresco-community72
)

IF "%~2" == "" (
SET SOLR_INSTALL_PATH=C:\\alfresco-search-services
)

IF "%~3" == "" (
SET POSTGRES_INSTALL_PATH=C:\\PostgreSQL\\13
)

goto stopTrServLocal

:stopTrServLocal
echo.
echo Stopping Local transformation service ...
taskkill /fi "WINDOWTITLE eq localTransformationService"
if errorlevel 1 (goto end) else (goto stopACS)

:stopACS
echo.
echo Stopping ACS from %ALF_INSTALL_PATH% ...
SET CATALINA_HOME=%ALF_INSTALL_PATH%\tomcat
start /MIN /WAIT cmd /c %ALF_INSTALL_PATH%\tomcat\bin\catalina.bat stop
taskkill /fi "WINDOWTITLE eq Tomcat"
taskkill /F /IM soffice.bin
if errorlevel 1 (goto end) else (goto stopDB)

:stopDB
echo.
echo Stopping DB from %POSTGRES_INSTALL_PATH% ...
:: Using the windows service to stop the db.
:: net stop postgresql-x64-13
REM You can also use this command, if there is any issue with permission elevation on windows
%POSTGRES_INSTALL_PATH%\bin\pg_ctl.exe stop -D "%POSTGRES_INSTALL_PATH%\data"
if errorlevel 1 (goto end) else (goto stopSolr)

:stopSolr
echo.
echo Stopping SOLR from %SOLR_INSTALL_PATH% ...
start /MIN /WAIT cmd /c %SOLR_INSTALL_PATH%\solr\bin\solr.cmd stop -all
taskkill /fi "WINDOWTITLE eq SOLR6"
if errorlevel 1 (goto end) else (goto stopAMQLocal)

:stopAMQLocal
echo.
echo Stopping Active MQ service ...
taskkill /F /IM wrapper.exe
taskkill /fi "WINDOWTITLE eq ActiveMQ"
if errorlevel 1 (goto end)

:end
echo.
echo Exiting..
timeout 10


All the structure and updated files are available here for reference:

https://github.com/abhinavmishra14/alfresco7-solr-localtransform-dist-setup


For Linux platform visit this post:

Setup ACS-7.x, ASS-2.x and Local Transformation Service using distribution package step by step Part 1

Note: If you are planning to setup ACS-7.1.x/ACS-7.2.x (Enterprise version) and ASS-2.0.2/ACS-2.0.3, then download the appropriate distribution packages from Alfresco Support portal. All the steps outlined above will remain pretty much the same.

References:

https://docs.alfresco.com/content-services/latest/

https://docs.alfresco.com/search-services/latest/

https://docs.alfresco.com/transform-service/latest/

About the Author
A tech freak, Architect and Consultant (Alfresco Content Services Certified Engineer, Java/J2EE, Webservices, Microservices, AWS CSA, 2x Azure, Docker, MarkLogic). Writes about Alfresco and Java stuffs at Blog (https://javaworld-abhinav.blogspot.com). Visit My Linkedin Profile (https://www.linkedin.com/in/abhinav-kumar-m-2402621b) for more details.
2 Comments