Monday, May 16, 2022

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


As part of the step by step series, I outlined the steps to install Alfresco Content Services 7.0.0 and Alfresco Search Services 2.0.1 using distribution package on CentOS 7 x64 environment in my previous post.


You can take a look at the steps here

As many of you have requested ACS7 setup on Windows Platform as well, I am here with another part of step by step series on ACS installation.
Hyland Alfresco has released ACS7.2 recently, See the release notes hereI 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 (I will use Oracle jdk-11.0.15 for this post)
  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.


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/alfresco-content-services-community-distribution/7.2.0.1/alfresco-content-services-community-distribution-7.2.0.1.zip


  • Download ASS-2.0.3:
https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-search-services/2.0.3.5/alfresco-search-services-2.0.3.5.zip

 

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


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

https://download.oracle.com/otn/java/jdk/11.0.15+8/c4e1848573124815b77d6f1843afccb5/jdk-11.0.15_windows-x64_bin.exe

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.15


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):







Alternative options (ImageMagick notoriously removes the specific versions and shows only latest versions):


Download Exiftool v12.25:

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


Download and Install PostgreSQL 13.x:

Alternatively you can also download the binary package and extract it. No installation needed. It is useful if you have trouble doing installation on Windows 10.

Download PostgreSQL 13.x binary

Note: Make sure port 5432 is open and not already in use. Port 5432 is default for postgres to get db connection. If you have this port already in use, make sure you select a different port and use the same while configuring alfresco-global.properties.


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-tools-repo-1.1.0.0-amp.amp

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

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

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


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

Follow the steps given below:

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:\):




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:


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

  • 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 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:
              • javascript-console-share-0.7.amp (Updated with ACS7 Compatibility bugfix)
                • Copy 'javascript-console-share' amp to "C:\alfresco-community72\amps_share" directory

            • 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.

            • 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 application specific context files for alfresco and share.
            • 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'
            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]:
            <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: 

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

            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 . Add the variable after JAVA_OPTS in catalina.bat file. If you add this variable at the end of the file, it is not getting recognized for some reason. So make sure you add the variavle before JAVA_OPTS as mentioned above. See the example screenshot below for reference or check here.
            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] ##############

            Example: 




            • 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
            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



              To setup Local transformation service, 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 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.

               

              • 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).

              • 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. 

              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.


              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 named 'exiftool' 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



                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 app jar file, 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>/convert"
                -DIMAGEMAGICK_CODERS="<imagemagick_installation_dir>/modules/coders"
                -DIMAGEMAGICK_CONFIG="<imagemagick_installation_dir>"
                -DACTIVEMQ_URL=tcp://server:61616
                -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\lib" -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 -jar C:\alfresco-community72\bin\alfresco-transform-core-aio-boot-2.5.7.jar

                Check the output to ensure that it starts successfully. The all-in-one core T-Engine combines the five T-Engines (i.e. LibreOffice, ImageMagick, Alfresco PDF Renderer, Tika, and Misc) into one single engine. All functionality that’s available in the five T-Engines is available in the all-in-one core T-Engine. The command-line options provide the paths to the installation locations and the URL of the messaging broker. 

                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.




                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. 

                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:
                How to use local transformation service  
                Local vs Legacy Transformation Service 

                Metadata Extractors and Embedders Extension Point

                 

                You can also create a custom t-engine as well, learn about the detailed steps here: 

                • Creating-a-t-engine: https://github.com/Alfresco/acs-packaging/blob/master/docs/creating-a-t-engine.md 
                • Developing-a-new-t-engine: https://docs.alfresco.com/content-services/latest/develop/repo-ext-points/content-transformers-renditions/#developing-a-new-t-engine

                 

                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.

                      • 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.

                      For more details visit: 
                                        For more details visit (This is forked repo containing acs7 fixes):
                      https://github.com/abhinavmishra14/js-console

                        • 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 . . .



                      • 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: 

                        • 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):
                        • 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.xmlAdd 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/

                      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 [End] ##############
                      • 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
                        {
                          "authentication" : {
                            "class": "org.alfresco.solr.security.SecretSharedAuthPlugin"
                          }
                        }
                        • 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:



                        ###############################
                        ## 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=jdbc:postgresql://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 [End] ##############
                        


                        solrcore.properties (Highlighting important properties only):

                        alfresco.host=localhost
                        alfresco.port=8080
                        alfresco.port.ssl=8443
                        alfresco.baseUrl=/alfresco

                        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=failover:(tcp://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
                        


                        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:







                            23 comments:

                            1. Thanks for the great article. Thanks to it I was able to set up in Windows. My question is, how do I change the maximum size of the Excel and Word previews?

                              ReplyDelete
                              Replies
                              1. Thanks and i am glad to hear that you are able to setup. See the response to your other question below.

                                Delete
                            2. Thanks for the great article. Thanks to it I was able to set up in Windows. My question is, how do I change the maximum size of the Excel and Word previews?

                              ReplyDelete
                              Replies
                              1. So before local/transformation service when alfresco used to have legacy transformation service, these sizes used to be controlled via alfresco-global.properties. Here is a reference from legacy service : https://github.com/AlfrescoArchive/alfresco-repository/blob/master/src/main/resources/alfresco/subsystems/Transformers/default/transformers.properties#L185

                                Now since 6.x onwards legacy transformation service was deprecated and then from ACS7.x onwards it has been completely removed. So the above properties no longer works.
                                Everything related to transformation and metadata extraction is now part of this repo: https://github.com/Alfresco/alfresco-transform-core

                                Now, to solve you problem you may try updating this libreoffice_engine_config.json's 'maxSourceSizeBytes' object value where needed: https://github.com/Alfresco/alfresco-transform-core/blob/master/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json libreoffice_engine_config

                                To do this you need to do following:

                                1- Clone the git repo locally : https://github.com/Alfresco/alfresco-transform-core.git

                                2- Update the https://github.com/Alfresco/alfresco-transform-core/blob/master/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json

                                3- Build the artifacts using the parent pom : https://github.com/Alfresco/alfresco-transform-core/blob/master/pom.xml , Use the "mvn clean install" or "mvn clean package" command to get the artifacts.

                                4- In https://github.com/Alfresco/alfresco-transform-core/tree/master/alfresco-transform-core-aio/alfresco-transform-core-aio-boot project's target directory, you will find the new "alfresco-transform-core-aio-boot-2.6.1-SNAPSHOT.jar" file.

                                5- Replace this newly built Jar in "'C:\alfresco-community72\bin\" - as outlined here: https://javaworld-abhinav.blogspot.com/2022/05/setup-acs-7-ass-2-and-local-windows.html#local-trserv-core-aio-launch

                                6- Stop all services and restart them all again and test to see if your previews works.

                                Hope this works.

                                Delete
                              2. Thanks for answering my question.
                                I get an error in step 3, build artifact.

                                [WARNING] The POM for org.codehaus.mojo:license-maven-plugin:jar:2.0.1.alfresco-2 is missing, no dependency information available
                                [INFO] ------------------------------------------------------------------------
                                [INFO] Reactor Summary for alfresco-transform-core 2.6.1-SNAPSHOT:
                                [INFO]
                                [INFO] alfresco-transform-core ............................ SUCCESS [ 0.858 s]
                                [INFO] Alfresco Transform Model ........................... FAILURE [ 0.016 s]
                                [INFO] alfresco-transformer-base .......................... SKIPPED
                                [INFO] Alfresco ImageMagick Transformer ................... SKIPPED
                                [INFO] Alfresco ImageMagick Transformer Spring Boot ....... SKIPPED
                                [INFO] Alfresco LibreOffice Transformer ................... SKIPPED
                                [INFO] Alfresco LibreOffice Transformer Spring Boot ....... SKIPPED
                                [INFO] Alfresco Miscellaneous Transformer ................. SKIPPED
                                [INFO] Alfresco Miscellaneous Transformer Spring Boot ..... SKIPPED
                                [INFO] Alfresco Pdf Renderer Transformer .................. SKIPPED
                                [INFO] Alfresco Pdf Renderer Spring Boot .................. SKIPPED
                                [INFO] Alfresco Tika Transformer .......................... SKIPPED
                                [INFO] Alfresco Tika Transformer Spring Boot .............. SKIPPED
                                [INFO] Alfresco Core All-In-One Transformer ............... SKIPPED
                                [INFO] Alfresco Core All-In-One Transformer Spring Boot ... SKIPPED
                                [INFO] ------------------------------------------------------------------------
                                [INFO] BUILD FAILURE
                                [INFO] ------------------------------------------------------------------------
                                [INFO] Total time: 1.201 s
                                [INFO] Finished at: 2022-05-24T16:46:46+09:00
                                [INFO] ------------------------------------------------------------------------
                                [ERROR] Plugin org.codehaus.mojo:license-maven-plugin:2.0.1.alfresco-2 or one of
                                its dependencies could not be resolved: Failure to find org.codehaus.mojo:licen
                                se-maven-plugin:jar:2.0.1.alfresco-2 in https://repo.maven.apache.org/maven2 was
                                cached in the local repository, resolution will not be reattempted until the up
                                date interval of central has elapsed or updates are forced -> [Help 1]
                                org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:lice
                                nse-maven-plugin:2.0.1.alfresco-2 or one of its dependencies could not be resolv
                                ed: Failure to find org.codehaus.mojo:license-maven-plugin:jar:2.0.1.alfresco-2
                                in https://repo.maven.apache.org/maven2 was cached in the local repository, reso
                                lution will not be reattempted until the update interval of central has elapsed
                                or updates are forced

                                https://repo.maven.apache.org/maven2/org/codehaus/mojo/license-maven-plugin/2.0.1.alfresco-2/license-maven-plugin-2.0.1.alfresco-2.pom

                                I understand that the reason is that this page does not exist, but I do not know what to do. How can I work around the error?

                                Delete
                              3. Hmm, i will have to take a look at the repository and try to build. I will reply back if i find something.

                                Delete
                              4. I am able to build the project successfully. You may not have correct maven settings. Please follow these steps and retry:

                                1- Update maven settings.xml as per the sample given below (open the link and copy the xml content):


                                https://hub.alfresco.com/t5/forums/forumtopicprintpage/board-id/forum-ECM-software/message-id/17984/print-single-message/true/page/1

                                2- Run the maven command as (skip tests): mvn clean install -DskipTests

                                Delete
                              5. I was able to assemble it successfully. Thank you very much. Thank you very much.

                                https://github.com/Alfresco/alfresco-transform-core/blob/master/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json

                                I changed "maxSourceSizeBytes" in libreoffice_engine_config.json above as follows, but I can preview a file size larger than the setting value.
                                Is there something wrong with the setting?

                                {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "maxSourceSizeBytes": 1024, "targetMediaType ": "application/pdf" },

                                Delete
                              6. It should usually pick up the config updates. Try enabling the log here: https://github.com/Alfresco/alfresco-transform-core/blob/master/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/application.properties

                                Add following log configs, build the artifacts and try to see if you can spot the size related info :


                                logging.level.org.alfresco.transformer.LibreOfficeController=debug
                                logging.level.org.alfresco.transformer=debug

                                Delete
                              7. Thank you. Where will this log be output to?

                                Delete
                              8. See the properties file where it is referring to? Oboviously the transformation service logs

                                Delete
                              9. The maximum size could be changed. Thank you very much.

                                Delete
                              10. Glad to hear that you are able to achieve your requirement. HTH

                                Delete
                            3. Hello Dear
                              thanks for your attention to my request
                              I followed alfresco tutorial for version 7.2 of alfresco on windows correctly, but the issue is that I get the following error message: 04240002 Keystores are invalid

                              ReplyDelete
                              Replies
                              1. This error indicates config issue with keystore. Setup steps are described here: https://javaworld-abhinav.blogspot.com/2022/05/setup-acs-7-ass-2-and-local-windows.html#encryption-keystore-cfg

                                After you copy the keystore files to C:/alfresco-community72/tomcat/shared/classes/alfresco/extension/keystore, update the alfresco-global.properties to set this: 'dir.keystore=C:/alfresco-community72/tomcat/shared/classes/alfresco/extension/keystore'

                                And at last update the catalina.bat with following entry:

                                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"

                                If you are still seeing the error, please share alfresco.log, catalina.out, alfresco-global.properties, catalina.bat, solr.in.cmd and solrcore.properties. Unfortunately there is no way to attach the file so you can upload to a google drive and share the links.

                                Delete
                              2. Hello Dear
                                Thank you very much for your help.

                                Delete
                            4. Hello Dear Abhinav
                              I have another issue with sending emails.
                              I have three users: admin, user1 and user2
                              when admin invites user1 or user2 to join a site, they receive notifications.
                              but when user1 invites admin or user2, I get this error:
                              2022-05-28 13:38:13,313 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] [mailAsyncAction6] Failed to send email to [user2] : org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.252 SendAsDenied; admin@domain.com not allowed to send as user1@domain.com; STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message [BeginDiagnosticData]Cannot submit message. 0.35250:AF320000, 1.36674:01000000, 1.61250:00000000, 1.45378:02000000, 1.44866:00000000, 1.36674:7A000000, 1.61250:00000000, 1.45378:05000000, 1.44866:00140000, 1.36674:0A000000, 1.61250:00000000, 1.45378:16000000, 1.44866:0B3E0000, 1.36674:0E000000, 1.61250:00000000, 1.45378:243E0000, 1.44866:44020000, 16.55847:15190000,
                              my conf:
                              mail.host=smtp.office365.com
                              mail.port=25
                              mail.username=admin@domain.com
                              mail.password=Password
                              mail.encoding=UTF-8
                              mail.from.default=admin@domain.com
                              mail.smtp.starttls.enable=true
                              mail.smtp.auth=true
                              mail.from.enabled=true

                              i searched on alfresco and google nothing

                              ReplyDelete
                              Replies
                              1. Well the documentation has clear instructions. Look at this error, it indicates that smtp is not allowing to impersonate another user.

                                "org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.252 SendAsDenied; admin@domain.com not allowed to send as user1@domain.com;"


                                Try disabling mail.from.enabled=false.

                                Please review these docs:

                                https://docs.alfresco.com/content-services/latest/config/email/#manage-outbound-emails

                                https://docs.alfresco.com/content-services/latest/config/email/#outbound-smtp-configuration-properties

                                Delete
                            5. thanks for your help. it works
                              mail.from.enabled=false.

                              ReplyDelete
                              Replies
                              1. I am glad you are able to resolve the error. Thanks for informing.

                                Delete
                            6. thanks for your help. it works
                              mail.from.enabled=false.

                              ReplyDelete
                              Replies
                              1. I am glad you are able to resolve the error. Happy to help. Thanks for informing.

                                Delete

                            Thanks for your comments/Suggestions.