Showing posts with label alfresco-search-services. Show all posts
Showing posts with label alfresco-search-services. Show all posts

Wednesday, September 13, 2023

Alfresco repository performance tuning checklist

 

As an Alfresco developer/admin we often get into situations to optimize the alfresco repository for optimal performance and stability. I often get messages in this regards and, so I decided to put a checklist that you should consider whenever you are dealing with alfresco repository performance.

Part of this is also referred as to how the system was sized in first place. Not every system is sized with pre-defined no. of named users, content size, no. of concurrent users etc. In some cases, we might have to revisit the sizing and tune the repository in order to match with increasing users and content size requirements. This is an incremental process in most cases.

Performance tuning and improvement is not one time job, it is done based on evaluation, trials and updates in an incremental manner. 

"Performance tuning is always an open ended process."

Having said that, here are some pointers (to give you ideas to start with) at a very high level that you should consider as a starting point:

  • Analyze Thread dump, GC Log and Heap dump.
    • Analyze the thread dump and hot threads, this may help troubleshoot performance problems, CPU usage and deadlocks. You can use support tools for enterprise version and OOTBee support tools for community version. You can also use FastThread to analyze thread dump and get detailed info.
      • To export thread dump, follow these steps:
        • Find the java process id (pid). Use this command: 
          • pgrep java
        • Export the thread dump, use this command with processId (e.g. 1): 
          • jstack [pid] > filepathtosave
            • jstack 1 > /usr/local/alfresco-community70/tomcat/threaddump.txt
      • To enable GC Logging use following JVM parameter (java 9 or later):
        • -Xlog:gc*:file=/usr/local/alfresco-community70/tomcat/repo_gc.log
      • Capture heap dumps automatically on OOM Errors by using following JVM parameter:
        • java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/alfresco-community70/tomcat/repoheapdump.bin
      • To export heap dump, follow these steps:
        • Find the java process id (pid). Use this command:
          • pgrep java
        • Export the heap dump, use this command with processId (e.g. 1):
          • jmap -dump:[live],format=b,file=<filepathtosave> <pid>
            • jmap -dump:[live],format=b,file=/usr/local/alfresco-community70/tomcat/repoheapdump.bin 1
      • It is sometimes also helpful to review the java system properties, vm flags and vm arguments. You can use below given command see and review:
        • jinfo <pid>
          • If you are trying the understand the java memory allocations and usage while app is running then this command will be helpful:
            • jcmd <pid> GC.heap_info
          • If you want to know metaspace usage while app is running, then this command will be helpful:
            • jcmd <pid> VM.metaspace
          • If you want to know all the VM flags set for your app, then this command will be helpful:
              • jcmd <pid> VM.flags
          • You can try jcmd <pid> help to get all other available options pertaining to JVM on your running application.
      • Learn more on these terminologies here.
    • Analyze the required no. of users you want to support concurrently. Some of these inputs can be obtained by doing a load test in your target environment:
      • How much concurrent users is currently being handled by your system?
        • How much is the targeted no. of concurrent users down the lane?
        • You can consider creating a client program (using REST or CMIS API) to verify the system and analyze if your system can support the estimated number of users with the expected load before moving to PROD.
      • How much is supported total no. of DB connections? (this no. relates to the total number of concurrent users as well, so to support concurrent users allowed DB connections must be optimized and configured to an appropriate value). Default max_connections limit is 275.
        • An example of how to increase thread pool and max connections to support your requirement. In this example need to support max 400 connections, DB instance type in AWS is db.t4g.medium.
    RUN sed -i "s/port=\"8080\"\ protocol=\"HTTP\/1.1\"/port=\"8080\"\ protocol=\"HTTP\/1.1\"\ maxHttpHeaderSize=\"32768\"\ maxThreads=\"325\"/g" $TOMCAT_DIR/conf/server.xml ;
    
    OR (server.xml)

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

    ######### (325 maxThreads +75) in JAVA_OPTS or alfresco-global.properties ###########
    -Ddb.pool.max=400

    • Analyze the sources of content and current load:
      • What is the current size of repository?
      • What will be the target size based on estimates? If applicable, collect information about document types to be managed including their size, number of versions, daily volumes, number of properties, distribution ratios, etc. This will yield information for the database and storage requirements that may be required to be upgraded to support the target state.
        • Consider creating a plan to increase resources with the time. When the repository grows, apart from disk storage, resources like RAM and CPU should also be assessed and increased.
    • Revisit the JVM settings based on above assessment. You can also refer these docs for an overview:
      • Configure your java heap memory such that there is enough room for OS and non-heap processes in your application to avoid system crashes.
      • Some useful resources around JVM:
    • Re-validate if there is any latency between repository and DB.
      • Is your DB undergoing regular maintenance and tuning? (Think DB Vacuuming)
        • Regular maintenance and tuning of the database is necessary. Specifically, all of the database servers that supports require at the very least that some form of index statistics maintenance be performed at frequent, regular intervals to maintain optimal performance. Index maintenance can have a severe impact on performance while in progress, hence it needs to be discussed with your project team and scheduled appropriately.
      • Round trip time should be less than 1ms (recommended)
      • Round trip times greater than 1ms indicate unoptimized network that will adversely impact performance. Highly variable round trip time is also of concern, as that may increase the variability of Alfresco Content Services performance.
    • Revisit the repository cache settings if you have modified it (Check your alfresco-global.properties or JMX Settings to confirm).
      • Have you modified the default cache limits? (Modifying the limits without understanding it could lead to out of memory issues as it consumes heap memory)
        • Checkout these posts/docs to deep dive into repo cache:
        • There is critical connection between repository instances in cluster. There is a cache layer that sits just above the object relational mapping layer that sits above the database tier within repository. This cache is synced across all members of a repository cluster, and that syncing mechanism is sensitive to latency.
        • If you have a DR environment (active-active setup) and cloud regions are farther from each other and clustering is enabled you will see slower performance as both environments will try to connect each other. So consider this implication and proper remedy before setting up "alfresco.cluster.enabled=true" for DR environment.
          • If DR environment is not set up as active, it should be ok to have clustering enabled as you will bring DR environment when primary region is down.
      • As a general rule:
        • Do not keep more than 1000 nodes (files/folders) in same parent node (folder) if  Share UI is your primary interface for users.
        • Overall do not keep more than 3000 nodes (files/folders) in same parent node in repository.
      • However it depends on the resources of the server. I’ve seen systems with 10k nodes per folder working fine. A nice addition would be an organization scheme to avoid uploading “all” the files in the same folder, like using year/month/day.
    • A folder with linked nodes loads slow in Share UI, usually takes longer time than usual to display due to the metadata of all the linked nodes being retrieved as well in the response. If the linked nodes have large custom properties, the JSON response would be huge and can have a considerable impact on the time taken to display the folder in Share. You can set a configuration to lazily load these properties instead by adding the following in JAVA_OPTS.
    -Dstrip.linked-node.properties=true
    • Slower login response? -> We often hear about slow login response and quickly end-up concluding the issue with Alfresco. But this is not always the case which causes the slower login responses. 
      • There may be issue with Alfresco in-terms of network delays between repository and database that may sometimes cause slower login response time. As indicated above that the round trip time should be less than 1ms (recommended). 
      • Consider reviewing the authentication chain configured for your repository. We miss this critical part of the flow where problem lies with slow connectivity/network delays with for example ldap, external authentication systems etc. configured in authentication chain.  Learn more on authentication subsystem here.

      • Asses and analyze your custom code as well. Many of the times problem lies within custom code which we often doesn't consider reviewing.
        • Do you have excessive logging in your code? 
          • Never run your production environment with debug enabled. Set the appropriate log level (e.g.: error) for production. You can use support tools for enterprise version and OOTBee support tools for community version to enable/disable debug logs on need basis.
        • Are there unclosed Streams/IO/ResultSet/HttpClient/HttpResponse? 
          • Must consider closing Result Set (org.alfresco.service.cmr.search.ResultSet) after extracting the search results.
          • Must consider proper exception handling and closing resources via finally block. Thumb rule for exception handling: "Services should throw and Caller of services should catch. Handled exception must depict WWW (what, where and why)"
        • Do you have an implementation of behaviors wide open? (Hint: Bind behaviors to specific CLASS/ASSOCIATION/PROPERTIES/SERVICE that you need)
          • Class - Most commonly used, fired for a particular TYPE/ASPECT
          • Association - Fired for a particular association or association of a particular type.
          • Properties - Fired for properties of a particular type or with a particular name.
          • Service - Fired every time the service generates an event.
        • Node property/metadata updates via NodeService API:
          • Ask yourself these questions and analyze your source code:
            • Adding new properties to the node via NodeService but using nodeService.setProperties instead of using nodeService.addProperties?
              • Be careful and understand what you are doing, When using nodeService.setProperties before creating versions programmatically. This leads to replacing the property values set from previous versions. You will loose any property values set on workspace node (current version). So make sure you understand what you are doing. Use nodeService.addProperties otherwise.
            • Updating one property of a node but creating new map of properties and applying it via nodeService.setProperties instead of using  nodeService.setProperty
            • Updating multiple properties on a node but nodeService.setProperty is being used to set these properties in multiple steps instead of using nodeService.addProperties?
          • Consider analyzing these methods and your use cases before choosing the methods to use.
        • Deleting the huge amount of content/folder?
          • Consider using batch processing and apply "sys:temporary" aspect before deleting them after analyzing your organization's content retention policy.
        • If you manage some sort of Job IDs (content less nodes) within repository to track the jobs via metadata/properties, make sure you also set the cm:isContentIndexed property on the nodes so that it is an indication that Solr should not try to index the content for these nodes. Specially if you have full text content indexing enabled.
        • When using SearchService Java foundation API, if you just needs the list of nodeRefs from result and not metadata then make sure you DO NOT setIncludeMetadata to true. This is considered to be a best practice.
          • When using SearchService Java foundation API, fetch the results via pagination (using ResultSetSPI) instead of fetching all results at once. For example:- Fetch 1000 results in one batch and keep fetching by iterating the result set until result set hasMore results.
          • Avoid deep pagination:
            • Some common examples, these type of search parameters should be avoided:
              • skipCount=0&maxItems=1000000
              • skipCount=999000&maxItems=1000
        • Are you using any action that performs transactional operations such as "creating folders" (think an organization scheme such as timestamped folder structure where a file is moved as soon as it gets created) which is triggered multiple times on an event from a folder rule? It can be background operation or foreground operation ? Are you facing challenges to handle concurrency and may be getting "exceptions (e.g. FileExistsException or ConcurrencyFailureException )" ? 
          • If your answer is yes and you jumped to a quick solution to create/update method(s) with "synchronized" keyword? -> We always tempt to use "synchronized" as a quick solution to these problems, but remember that it is considered to be an Anti-pattern in most cases if used without understanding its consequence (think twice before jumping to this solution). It can be slow and lead to contention between threads.
              - org.springframework.dao.ConcurrencyFailureException
              - org.springframework.dao.DeadlockLoserDataAccessException
              - org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
              - org.springframework.jdbc.UncategorizedSQLException
              - java.sql.SQLException
              - java.sql.BatchUpdateException
              - org.springframework.dao.DataIntegrityViolationException
              - org.alfresco.service.license.LicenseIntegrityException
              - org.apache.ibatis.exceptions.TooManyResultsException
              - org.alfresco.util.LockHelper.LockTryException

            • ConcurrencyFailureException will be automatically re-tried.
            • FileExistsException will not be by default covered via this semantic implementation. This exception will not trigger the transaction to retry unless it is manually caught and rethrown by wrapping in an one of the exceptions (as listed above) which will be retried. 
      • There is a property that can be configured via spring bean to include additional exceptions (also called extraExceptions , an example can be found here). But do not try to include FileExistsException in the list of retry exceptions and it is also considered to be an Anti-pattern (Think if this exception is being thrown from a poorly written code that does not check if a node exist before trying to create it).  
      • I would rather use a try-catch block to catch the  FileExistsException and re-throw the exception as a relevant exception from already configured list (shown above) such as the most relevant seems in this case is "DataIntegrityViolationException". This type of exception is handled automatically by retrying transaction considering the implementation is using RetryingTransactionHelper" and "RetryingTransactionCallback". On the next retry, the operation should then find/see the concurrently created node/folder in the existence check (nodeService.exists(nodeRef)) and skip creating it again and goes to next step.  

       

      • Asses the archive store content requirements. Based on your organization's retention policy, try to clean trashcan or setup trash-can-cleaner scheduled job so you keep appropriate amount of deleted content in archive store. Also cleanup contentstore.deleted folder often.
      • If you are using ACS 5.2 or ACS 6.0/6.1 which uses legacy transformation services, then configure async LibreOffice subsystem. This part is not applicable to ACS 6.2 and later.
        • Checkout the documentation here:
      • Asses the services/subsystems/features being used and un-used. Some examples which you can considering to disable if not in use:

      cifs.enabled=false
      audit.enabled=false
      audit.alfresco-access.enabled=false
      audit.tagging.enabled=false
      imap.server.enabled=false
      imap.server.attachments.extraction.enabled=false
      googledocs.enabled=false
      system.webdav.servlet.enabled=false
      
      ftp.enabled=false
      
      system.usages.enabled=false
      

      activities.feed.notifier.enabled=false activities.feed.notifier.cronExpression=* * * * * ? 2099 activities.feed.cleaner.enabled=false activities.feed.cleaner.cronExpression=* * * * * ? 2099 activities.feed.generator.enabled=false activities.feed.generator.cronExpression=* * * * * ? 2099 activities.post.cleaner.cronExpression=* * * * * ? 2099 activities.post.cleaner.enabled=false activities.post.lookup.cronExpression=* * * * * ? 2099 activities.post.lookup.enabled=false

        • If you are not using out of process extensions, you can also disable event2. Enable it when you plan to use it. Check more details here:

      repo.event2.enabled=false

        • If you have enabled replication but not really using it, then disable it. It is disabled by default unless you enable it.


      Additional Ideas (some of them do not apply in 7.x):





      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 when using enterprise version (async transform service) and/or Out of process extensions. Check this out for Local Transformation Service (community version option).
      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.


      Friday, June 18, 2021

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


      As part of the step by step series, we tried installing Alfresco content services 6.2.0-ga + Solr6 (Alfresco search services 1.4.0) using distribution package and we used legacy transformation service to keep it simple (legacy transformation service was marked as deprecated in ACS6.x version) but we did setup prerequisites to use local transformation service.


      You can take a look at the steps here

      From ACS 7.x on-wards legacy transformation service is no longer available. We have to use the local transformation service if we have requirements for transformations/previews etc. Many folks in alfresco community are confused on setting up legacy Vs local transformation service. The purpose of this post is to document all the steps at one place when setting up ACS-7.0.0 manually using distribution package if docker / ansible is still not an option for you.


      In this post we will try to install ACS-7.0.0 + ASS-2.0.1 (latest stable version available at the time of this post) using distribution package with local transformation service. You can also see the release notes here.

      What we need before we start doing setup?

      1. ACS-7.0.0 community package (alfresco-content-services-community-distribution-7.0.0.zip)
      2. ASS-2.0.1 package (alfresco-search-services-2.0.1.zip)
      3. Java: Oracle jdk-11.0.7 or later/Open JDK 11.0.7 or later (java 11.0.11 is used for this post)
      4. Tomcat: Tomcat 9
      5. ActiveMQ: ActiveMQ v5.16
      6. DB: PostgreSQL 13.1
      7. ImageMagick: ImageMagick v7.0.10
      8. Libreoffice: LibreOffice v6.3.5.2
      9. Alfresco Transform Core AIO Boot App. 

      Checkout the documentation for additional details on Supported Platforms

      Platform:

      Type of deployment:

      • ACS, Share, ASS (SOLR6), and Local transformation services on same machine
      • No SSL/Secret mode setup 
      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.0.0 community:
      https://download.alfresco.com/cloudfront/release/community/7.0.0-build-2355/alfresco-content-services-community-distribution-7.0.0.zip


      • Download ASS-2.0.1:

       

      Note: If you are planning to setup ACS-7.x (Enterprise version) and ASS-2.x, 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.x  for this post hence we have to use ASS 2.x as stated in the Supported platforms here


      Download Tomcat 9.0.48 binary package:

      https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.48/bin/apache-tomcat-9.0.48.tar.gz

      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.tar.gz


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

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

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

      Download ImageMagick v7.0.10:

      Imagemagick dist.

      https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.10-11/imagemagick-distribution-7.0.10-11-linux.rpm

      Imagemagick lib dist.:

      https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.10-11/imagemagick-distribution-7.0.10-11-libs-linux.rpm

      Dependencies for Imagemagick:

      https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


      Alternatively, distributions can download from here:

      https://imagemagick.org/script/download.php#unix


      Download LibreOffice v6.3.5.2:

      https://downloadarchive.documentfoundation.org/libreoffice/old/6.3.5.2/rpm/x86_64/LibreOffice_6.3.5.2_Linux_x86-64_rpm.tar.gz

      Alternatively, distributions can download from here:

      https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/6.3.5/libreoffice-dist-6.3.5-linux.gz


      Download Exiftool v12.25:

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


      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.3/javascript-console-platform-0.7.3.amp

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


      *** Updated this post to provide prerequisites to install ACS 7.3.x and other related components. All the below given steps should be pretty much the same. You can find more details here ***


      Now, we have downloaded the packages and unlike Windows environment there are several additional pre-requisites that needs to be done before we can start setting up ACS (alfresco content services) and ASS (alfresco search services). So follow the steps as outlined below.


      Create users and groups

      We would be needing a user and a group for running alfresco content services and alfresco search services in the Linux platform.

      User and Group for Alfresco Content Services (ACS):

      • Create a group named 'Alfresco'
      $ sudo groupadd Alfresco
      • Create a system user named 'alfresco'
      $ sudo adduser alfresco --system
        • Add the user 'alfresco' to the group 'Alfresco'
        $ sudo usermod -a -G Alfresco alfresco
          • Verify group membership
          $ sudo groups alfresco
           Output--> alfresco : alfresco Alfresco


            User and Group for Alfresco Search Services (ASS):

            • Create a group named 'Solr'
            $ sudo groupadd Solr
            • Create a system user named 'solr'
            $ sudo adduser solr --system
              • Add the user 'solr' to the group 'Solr'
              $ sudo usermod -a -G Solr solr
                • Verify group membership
                $ sudo groups solr
                  Output--> solr : solr Solr

                We will be using these users/groups at later stages to setup appropriate permission levels for ACS and ASS (solr6).

                 

                Create directory structure for ACS-7.0.0 community

                • Create a directory named 'alfresco-community70' under '/usr/local/' directory. We will setup everything for ACS in this directory. You can choose to setup structure in a different directory as well depending on requirement or OS. For this post we would be using '/usr/local'.

                    $ sudo mkdir /usr/local/alfresco-community70

                    • Create sub-directories under '/usr/local/alfresco-community70' as below:
                    You can also clone this git repo and copy the pre-existing structure if that helps.

                     

                    • Set initial permissions to structure created above:

                    $ sudo chgrp -R Alfresco /usr/local/alfresco-community70
                    $ sudo chmod 775 /usr/local/alfresco-community70
                    $ sudo chmod -R 775 /usr/local/alfresco-community70/alf_data

                               Note: We will be setting up some more permissions when we setup tomcat.

                      • Add ALF_HOME to permanent environment variable, Edit '.bash_profile' file:

                      $ sudo vim .bash_profile
                      # .bash_profile
                      
                      # Get the aliases and functions
                      if [ -f ~/.bashrc ]; then
                      	. ~/.bashrc
                      fi
                      
                      # User specific environment and startup programs
                      
                      export ALF_HOME=/usr/local/alfresco-community70
                      
                      PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ALF_HOME
                      
                      export PATH
                      

                      Note that environment variable gets reset after you re-start the server. So to keep the variable permanent we are editing ".bash_profile". This '.bash_profile' file's absolute path is '/home/centos/.bash_profile' since logged in user is 'centos', it can be different in your case based on logged in user.


                      • Create a directory named 'alfresco-search-services' under '/usr/local/' directory. We will setup everything here. You can choose to setup structure in a different directory as well depending on requirement or OS. For this post we would be using '/usr/local'.

                          $ sudo mkdir /usr/local/alfresco-search-services
                          • Set initial permissions to structure created folder (We will be setting up some more permissions when we setup alfresco search services at a later stage):
                          $ sudo chgrp -R Solr /usr/local/alfresco-search-services
                          $ sudo chmod 775 /usr/local/alfresco-search-services 
                          • Add SOLR_HOME to permanent environment variable, Edit '.bash_profile' file:
                          $ sudo vim .bash_profile
                          # .bash_profile
                          
                          # Get the aliases and functions
                          if [ -f ~/.bashrc ]; then
                          	. ~/.bashrc
                          fi
                          
                          # User specific environment and startup programs
                          
                          export ALF_HOME=/usr/local/alfresco-community70
                          export SOLR_HOME=/usr/local/alfresco-search-services
                          PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ALF_HOME:$SOLR_HOME
                          
                          export PATH

                          Note that environment variable gets reset after you re-start the server. So to keep the variable permanent we are editing ".bash_profile". This '.bash_profile' file's absolute path is '/home/centos/.bash_profile' since logged in user is 'centos', it can be different in your case based on logged in user.



                          • Update packages, it is a best practice to start with an updated operating system before installing a package. If you have not done so, use the following command to update CentOS and reboot:

                          $ sudo yum update -y
                          $ sudo reboot

                          • Install latest stable version of Java-11
                          $ sudo yum install java-11-openjdk-devel

                            • This will install java11 in following directory: /usr/lib/jvm/java-11

                            • Run following command to check what is the default java version

                            $ sudo java -version

                              • If you see java version other than java-11, then you can switch and set the default version as java-11. Run the following command: 

                            $ sudo alternatives --config java

                              This will prompt you to select the version you want to set as default. Select a number from the list, e.g. if java-11 is at number 3, then type '3' and press enter. Revalidate the java version again.

                                • set JAVA_HOME environment variable, Edit '.bash_profile' file:

                                $ sudo vim .bash_profile
                                # .bash_profile
                                
                                # Get the aliases and functions
                                if [ -f ~/.bashrc ]; then
                                	. ~/.bashrc
                                fi
                                
                                # User specific environment and startup programs
                                export JAVA_HOME=/usr/lib/jvm/java-11
                                
                                export ALF_HOME=/usr/local/alfresco-community70
                                export SOLR_HOME=/usr/local/alfresco-search-services
                                PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ALF_HOME:$SOLR_HOME
                                
                                export PATH
                              Note that environment variable gets reset after you re-start the server. So to keep the variable permanent we are editing ".bash_profile". This '.bash_profile' file's absolute path is '/home/centos/.bash_profile' since logged in user is 'centos', it can be different in your case based on logged in user.

                               

                              Refer the steps here (steps would be pretty much same)



                              • Prepare 'alfresco' database, user and assign privileges
                                • 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".
                              • Execute following SQL queries to complete the above given tasks:

                                  $ sudo su - postgres
                                  # Type 'psql' to launch postgresql terminal
                                  -bash-4.2$ psql
                                  
                                  # Create user named 'alfresco' and db named 'alfresco' and make 'alfresco' the owner of 'alfresco' db.
                                  postgres=# create role alfresco LOGIN password 'alfresco';
                                  postgres=# create database alfresco encoding 'utf8';
                                  postgres=# grant all on database alfresco to alfresco;
                                      
                                  # Type exit to terminate the terminal
                                  exit
                                  
                                  # Type exit to leave the bash terminal 
                                  exit


                                  Install ActiveMQ 5.16 (Mandatory to use Transformation service):

                                  Assuming you have already downloaded the distribution packages from download locations provided above. Use the below given steps to install ActiveMQ.

                                  • Extract the package '/home/centos/Downloads/apache-activemq-5.16.2-bin.tar.gz' and copy the contents of 'apache-activemq-5.16.2-bin' into '/usr/local/alfresco-community70/activemq' directory
                                  $ sudo tar -xvf /home/centos/Downloads/apache-activemq-5.16.2-bin.tar.gz
                                  $ sudo cp -R /home/centos/Downloads/apache-activemq-5.16.2/* /usr/local/alfresco-community70/activemq/

                                   

                                  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.
                                  If you do setup ActiveMQ as a future plan and not using ActiveMQ, then disable the service and ports. Enable them back when you are ready to use transformation services.

                                  • We will create a system service for activemq
                                  $ sudo vim /etc/systemd/system/activemq.service
                                  # Put the below instructions in activemq.service and save 
                                  
                                  [Unit]
                                  Description=ActiveMQ service
                                  After=network.target
                                  
                                  [Service]
                                  Type=forking
                                  ExecStart=/usr/local/alfresco-community70/activemq/bin/activemq start
                                  ExecStop=/usr/local/alfresco-community70/activemq/bin/activemq stop
                                  User=alfresco
                                  Group=Alfresco
                                  WorkingDirectory=~/usr/local/alfresco-community70/activemq/data
                                  Restart=always
                                  RestartSec=9
                                  StandardOutput=syslog
                                  StandardError=syslog
                                  SyslogIdentifier=activemq
                                  
                                  [Install]
                                  WantedBy=multi-user.target
                                  • Reload demons
                                  $ sudo systemctl daemon-reload
                                  • Change the permission for the activemq/data directory to alfresco:Alfresco (user:group)
                                  $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/activemq
                                  $ sudo chown -R alfresco:Alfresco /usr/local/alfresco-community70/activemq/data
                                  • Start and enable ActiveMQ to automatically start at boot time
                                  $ sudo systemctl start activemq
                                  $ sudo systemctl enable activemq
                                    • To check status whether activemq service is running or not, use below given command:
                                  $ sudo systemctl status activemq
                                  • We will open following ports:
                                  - 8161 --> for Web Console
                                  - 5672 --> for AMQP
                                  - 61616 --> for OpenWire
                                  - 61613 --> for STOMP
                                  $ sudo firewall-cmd --zone=public --permanent --add-port=8161/tcp
                                  $ sudo firewall-cmd --zone=public --permanent --add-port=5672/tcp
                                  $ sudo firewall-cmd --zone=public --permanent --add-port=61616/tcp
                                  $ sudo firewall-cmd --zone=public --permanent --add-port=61613/tcp
                                  $ sudo firewall-cmd --reload
                                    • If you see '503' http status code and page doesn't show up then this could due to SELinux or Permission issues. Run following command to allow SELinux pass the request on 8161 port and fix permissions:
                                  $ sudo semanage port -a -t http_port_t -p tcp 8161
                                      • One of the directory named 'tmp' is created by activemq at run time may be causing permission issues since service is started as 'alfresco' user and not the 'root' user, so we will create 'tmp' directory before hand and put appropriate permissions for the safe side:
                                    $ sudo mkdir /usr/local/alfresco-community70/activemq/tmp
                                    $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/activemq/tmp
                                    $ sudo chmod -R 775 /usr/local/alfresco-community70/activemq/tmp
                                              • Try the web console again, this should work this time hopefully
                                              • Default user name and password is : admin/admin

                                            Install Tomcat 9.0.48:

                                            Assuming you have already downloaded the distribution packages from download locations provided above. Use the below given steps to install Tomcat.
                                            • Extract the package '/home/centos/Downloads/apache-tomcat-9.0.48.tar.gz' and copy the contents of 'apache-tomcat-9.0.48' into '/usr/local/alfresco-community70/tomcat' directory
                                            $ sudo tar -xvf /home/centos/Downloads/apache-tomcat-9.0.48.tar.gz
                                            $ sudo cp -R /home/centos/Downloads/apache-tomcat-9.0.48/* /usr/local/alfresco-community70/tomcat/
                                            • Update directory permissions:
                                            $ sudo chgrp -R Alfresco /usr/local/alfresco-community70
                                                 
                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/tomcat/bin
                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/tomcat/conf
                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/tomcat/shared
                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/tomcat/lib
                                            $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/temp
                                            $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/logs
                                            $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/work
                                            $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/webapps

                                            •  We will create a system service for tomcat

                                            $ sudo vim /etc/systemd/system/tomcat.service
                                            # Put the below instructions in tomcat.service and save 
                                            #Systemd unit file for tomcat
                                            [Unit]
                                            Description=Apache Tomcat Web Application Container
                                            After=syslog.target network.target
                                            
                                            [Service]
                                            Type=forking
                                            Restart=always
                                            
                                            Environment=JAVA_HOME=/usr/lib/jvm/jre
                                            Environment=CATALINA_PID=/usr/local/alfresco-community70/tomcat/temp/tomcat.pid
                                            Environment=CATALINA_HOME=/usr/local/alfresco-community70/tomcat
                                            Environment=CATALINA_BASE=/usr/local/alfresco-community70/tomcat
                                            Environment='CATALINA_OPTS=-Xms3G -Xmx4G -Xss1024k -server -XX:+UseParallelGC' Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom' ExecStart=/usr/local/alfresco-community70/tomcat/bin/startup.sh
                                            ExecStop=/bin/kill -15 $MAINPID WorkingDirectory=/usr/local/alfresco-community70/tomcat
                                            User=alfresco Group=Alfresco [Install] WantedBy=multi-user.target
                                            • Reload demons
                                            $ sudo systemctl daemon-reload
                                            • Start and enable Tomcat to automatically start at boot time
                                            $ sudo systemctl start tomcat
                                            $ sudo systemctl enable tomcat
                                            • To check status whether tomcat service is running or not, use below given command:
                                            $ sudo systemctl status tomcat
                                            • We will open following ports for alfresco and share access:
                                            - 8080
                                            - 8443
                                            $ sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
                                            $ sudo firewall-cmd --zone=public --permanent --add-port=8443/tcp
                                            $ sudo firewall-cmd --reload


                                            Configure ACS repository:


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


                                            Unzip the package:

                                            $ sudo unzip /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0.zip -d /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0

                                            Keystore configuration:
                                            • Copy contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore” into “/usr/local/alfresco-community70/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.sh -> Shell script file for generating secure keys for SOLR communication.
                                            $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore/CreateSSLKeystores.txt /usr/local/alfresco-community70/alf_data/keystore/
                                            $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore/generate_keystores.sh /usr/local/alfresco-community70/alf_data/keystore/
                                            $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore/readme.txt /usr/local/alfresco-community70/alf_data/keystore/

                                            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.
                                              • Update the file permissions for '/usr/local/alfresco-community70/alf_data/keystore' directory:
                                            $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/alf_data/keystore
                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/alf_data/keystore

                                                        • Copy contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/amps” into “/usr/local/alfresco-community70/amps”. We will be installing alfresco module packages (amps) at later stage.
                                                            $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/amps/alfresco-share-services.amp /usr/local/alfresco-community70/amps/
                                                                      • 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-repo-0.7.amp (Updated with ACS7 Compatibility bugfix)
                                                                        • Copy 'javascript-console-repo' amp to "/usr/local/alfresco-community70/amps/" directory
                                                                        • javascript-console-share-0.7.amp (Updated with ACS7 Compatibility bugfix)
                                                                          • Copy 'javascript-console-share' amp to "/usr/local/alfresco-community70/amps_share/" directory
                                                                      • Update the file permissions for '/usr/local/alfresco-community70/amps' and '/usr/local/alfresco-community70/amps_share'  directory:
                                                                        $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/amps 
                                                                        $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/amps_share
                                                                        $ sudo chmod -R 755 /usr/local/alfresco-community70/amps 
                                                                        $ sudo chmod -R 755 /usr/local/alfresco-community70/amps_share

                                                                                                • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/bin” into “/usr/local/alfresco-community70/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.sh -> 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/community/tasks/amp-install.html
                                                                                                    • clean_tomcat.sh -> Shell script for cleaning out temporary application server files from previous installations.
                                                                                                $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/bin/alfresco-mmt.jar /usr/local/alfresco-community70/bin/
                                                                                                          $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/bin/apply_amps.sh /usr/local/alfresco-community70/bin/
                                                                                                                    $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/bin/clean_tomcat.sh /usr/local/alfresco-community70/bin/
                                                                                                                                • Update the file permissions for '/usr/local/alfresco-community70/bin' directory:
                                                                                                                              $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/bin
                                                                                                                              $ sudo chmod -R 755 /usr/local/alfresco-community70/bin

                                                                                                                                          Copy licenses:
                                                                                                                                          • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/licenses” into “/usr/local/alfresco-community70/licenses” directory. It contains files that have information about license terms used by alfresco including all third party licenses.
                                                                                                                                          $ sudo cp -R /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/licenses/* /usr/local/alfresco-community70/licenses/
                                                                                                                                                        • Update the file permissions for '/usr/local/alfresco-community70/licenses' directory:
                                                                                                                                                      $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/licenses


                                                                                                                                                      Configure tomcat for ACS repository:

                                                                                                                                                      • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/conf” into “/usr/local/alfresco-community70/tomcat/conf” folder. 'conf' directory contains Catalina repository and Share xml files.
                                                                                                                                                      $ sudo cp -R /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/conf/* /usr/local/alfresco-community70/tomcat/conf/
                                                                                                                                                                    • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/lib/” into “/usr/local/alfresco-community70/tomcat/lib/” folder. 'lib' directory contains the PostgreSQL JDBC jar file (postgresql-42.2.19.jar).
                                                                                                                                                                      $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/lib/* /usr/local/alfresco-community70/tomcat/lib/
                                                                                                                                                                                      • Update the permissions for '/usr/local/alfresco-community70/tomcat/lib/' directory:
                                                                                                                                                                                    $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/tomcat/lib
                                                                                                                                                                                    $ sudo chmod 755 /usr/local/alfresco-community70/tomcat/lib/*.jar
                                                                                                                                                                                    • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/shared/classes” into “/usr/local/alfresco-community70/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.
                                                                                                                                                                                    $ sudo cp -R /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/shared/classes /usr/local/alfresco-community70/tomcat/shared/classes/

                                                                                                                                                                                                     

                                                                                                                                                                                                    Encryption keystore config: 

                                                                                                                                                                                                      • Create a new directory named 'keystore' under '/usr/local/alfresco-community70/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 '/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore/metadata-keystore' to '/usr/local/alfresco-community70/tomcat/shared/classes/alfresco/extension/keystore' directory.
                                                                                                                                                                                                    $ sudo mkdir /usr/local/alfresco-community70/tomcat/shared/classes/alfresco/extension/keystore
                                                                                                                                                                                                    $ sudo cp -R /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/keystore/metadata-keystore /usr/local/alfresco-community70/tomcat/shared/classes/alfresco/extension/keystore

                                                                                                                                                                                                    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=/usr/local/alfresco-community70/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=/usr/local/alfresco-community70/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 

                                                                                                                                                                                                      • Update the permissions for '/usr/local/alfresco-community70/tomcat/shared/classes/directory since we added/updates files/folders:

                                                                                                                                                                                                    $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/tomcat/shared
                                                                                                                                                                                                    $ sudo chmod -R 755 /usr/local/alfresco-community70/tomcat/shared
                                                                                                                                                                                                    • Delete all files/folders from “/usr/local/alfresco-community70/tomcat/webapps
                                                                                                                                                                                                    $ sudo rm -rf /usr/local/alfresco-community70/tomcat/webapps/*
                                                                                                                                                                                                    • Copy the contents from “/home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/webapps” into “/usr/local/alfresco-community70/tomcat/webapps/” folder.
                                                                                                                                                                                                    $ sudo cp /home/centos/Downloads/alfresco-content-services-community-distribution-7.0.0/web-server/webapps/*.war /usr/local/alfresco-community70/tomcat/webapps/
                                                                                                                                                                                                        • 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.
                                                                                                                                                                                                      • Update the permissions for '/usr/local/alfresco-community70/tomcat/webapps/' directory:
                                                                                                                                                                                                      $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/tomcat/webapps/
                                                                                                                                                                                                      $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/webapps/*.war
                                                                                                                                                                                                      • Delete all files/folders from “/usr/local/alfresco-community70/tomcat/work/Catalina/localhost” if there are any
                                                                                                                                                                                                      $ sudo rm -rf /usr/local/alfresco-community70/tomcat/work/Catalina/localhost/*
                                                                                                                                                                                                          • Update the permissions for '/usr/local/alfresco-community70/tomcat/work/Catalina/localhost' directory:
                                                                                                                                                                                                          $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/tomcat/work/Catalina/localhost
                                                                                                                                                                                                          $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/work/Catalina/localhost
                                                                                                                                                                                                          • Open and edit server.xml file which can be found under: “/usr/local/alfresco-community70/tomcat/conf/” directory [Full path: /usr/local/alfresco-community70/tomcat/conf/server.xml] :
                                                                                                                                                                                                          $ sudo vim /usr/local/alfresco-community70/tomcat/conf/server.xml
                                                                                                                                                                                                            • Find Connector with port "8080”.
                                                                                                                                                                                                            • Add the URIEncoding and maxHttpHeaderSize attributes.
                                                                                                                                                                                                            • Add the enableLookups, xpoweredBy and server attributes. (Optional Attributes for Tomcat 8.x and later)
                                                                                                                                                                                                              • Set xpoweredBy attribute to true to cause Tomcat to advertise support for the Servlet specification using the header recommended in the specification. The default value is false.
                                                                                                                                                                                                              • Set enableLookups to true if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to false to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are disabled.
                                                                                                                                                                                                              • Setting server to true, overrides the server header for the http response. If set, the value for this attribute overrides any Server header set by a web application. If not set, any value specified by the application is used. If the application does not specify a value then no Server header is set.
                                                                                                                                                                                                          <Connector port="8080" protocol="HTTP/1.1"
                                                                                                                                                                                                           URIEncoding="UTF-8" connectionTimeout="20000"
                                                                                                                                                                                                           maxHttpHeaderSize="32768"
                                                                                                                                                                                                           redirectPort="8443" enableLookups="false" xpoweredBy="false" server="AlfrescoECM"/>

                                                                                                                                                                                                          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" xpoweredBy="false"/>

                                                                                                                                                                                                            $ sudo vim /usr/local/alfresco-community70/tomcat/conf/catalina.properties
                                                                                                                                                                                                            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 '/usr/local/alfresco-community70/tomcat/shared/classes/alfresco/extension/keystore/metadata-keystore' directory already. Check the steps above. Open and edit /usr/local/alfresco-community70/tomcat/bin/catalina.shAdd the variable after JAVA_OPTS in catalina.sh 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.
                                                                                                                                                                                                            $ sudo vim /usr/local/alfresco-community70/tomcat/bin/catalina.sh 
                                                                                                                                                                                                            #ACS7 Custom changes [Start] ##############
                                                                                                                                                                                                            export JAVA_TOOL_OPTIONS="-Dencryption.keystore.type=JCEKS -Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding -Dencryption.keyAlgorithm=DESede -Dencryption.keystore.location=/usr/local/alfresco-community70/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"
                                                                                                                                                                                                            #ACS7 Custom changes [End] ##############


                                                                                                                                                                                                            Example:


                                                                                                                                                                                                            • Rename “/usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties.sample” to “alfresco-global.properties
                                                                                                                                                                                                            $ sudo mv /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties.sample /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties
                                                                                                                                                                                                                  • Update the file permissions for '/usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties' file:
                                                                                                                                                                                                                $ sudo chgrp Alfresco /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties
                                                                                                                                                                                                                $ sudo chmod 775 /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties

                                                                                                                                                                                                                • Open and edit “/usr/local/alfresco-community70/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=/usr/local/alfresco-community70/alf_data
                                                                                                                                                                                                                dir.keystore=/usr/local/alfresco-community70/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 setup, we need to install Imagemagick, Libreoffice and Alfresco-PDF-Renderer locally and executables will be used by transformation service spring boot application. 



                                                                                                                                                                                                                  Assuming you have already downloaded the imagemagick packages from download locations provided above. Use the below given steps to install imagemagick-7.0.10

                                                                                                                                                                                                                  • Update packages, it is a best practice to start with an updated operating system before installing a package. If you have not done so, use the following command to update CentOS and reboot:

                                                                                                                                                                                                                  $ sudo yum update -y
                                                                                                                                                                                                                  $ sudo reboot

                                                                                                                                                                                                                  Note: If you had followed the steps to install Java11 as outlined above, you have had already updated the package, so you can skip the above given step.
                                                                                                                                                                                                                  • Use rpm file's path as per your current download location. In my case files are downloaded the packages in '/home/centos/Downloads/Imagemagick7/' folder. Execute the command give below:
                                                                                                                                                                                                                  $ sudo yum localinstall /home/centos/Downloads/Imagemagick7/*.rpm -y
                                                                                                                                                                                                                      • Imagemagick and its dependencies will be installed and can be found in these locations
                                                                                                                                                                                                                        • Executables locations:
                                                                                                                                                                                                                      /usr/bin/convert
                                                                                                                                                                                                                      /usr/bin/indentify
                                                                                                                                                                                                                      /usr/bin/magick
                                                                                                                                                                                                                      /usr/bin/magick-script
                                                                                                                                                                                                                      • Lib location:
                                                                                                                                                                                                                      /usr/lib64/ImageMagick-7.0.10
                                                                                                                                                                                                                      • Now that we have installed the imagemagick, let's do a round of test to make sure executables are working as expected. Use below command:
                                                                                                                                                                                                                      $ /usr/bin/convert /home/centos/Downloads/test.png /home/centos/Downloads/test.jpg
                                                                                                                                                                                                                      • For our convenience we will be creating 'links' to executable and libraries to keep everything in one place. We have a imagemagick folder within '/usr/local/alfresco-community70/' directory when we created the initial structure for setup. You can choose to keep executables and library at default location (as shown above) and use them in transformation service spring boot app launcher configuration. It is up to you. 
                                                                                                                                                                                                                      • Create link for Imagemagick
                                                                                                                                                                                                                      - /usr/bin/convert
                                                                                                                                                                                                                      - /usr/lib64/ImageMagick-7.0.10
                                                                                                                                                                                                                      $ sudo ln -s /usr/bin/convert /usr/local/alfresco-community70/imagemagick
                                                                                                                                                                                                                      $ sudo ln -s /usr/lib64/ImageMagick-7.0.10/config-Q16HDRI /usr/local/alfresco-community70/imagemagick
                                                                                                                                                                                                                      $ sudo ln -s /usr/lib64/ImageMagick-7.0.10/modules-Q16HDRI /usr/local/alfresco-community70/imagemagick
                                                                                                                                                                                                                      -DIMAGEMAGICK_ROOT="/usr/local/alfresco-community70/imagemagick" 
                                                                                                                                                                                                                      -DIMAGEMAGICK_DYN="/usr/local/alfresco-community70/imagemagick" 
                                                                                                                                                                                                                      -DIMAGEMAGICK_EXE="/usr/local/alfresco-community70/imagemagick/convert"
                                                                                                                                                                                                                      -DIMAGEMAGICK_CODERS="/usr/local/alfresco-community70/imagemagick/modules-Q16HDRI/coders"
                                                                                                                                                                                                                      -DIMAGEMAGICK_CONFIG="/usr/local/alfresco-community70/imagemagick/config-Q16HDRI"



                                                                                                                                                                                                                      Assuming you have already downloaded the Libreoffice packages from download locations provided above. Use the below given steps to install LibreOffice_6.3.5.2

                                                                                                                                                                                                                      • Update packages, it is a best practice to start with an updated operating system before installing a package. If you have not done so, use the following command to update CentOS and reboot:

                                                                                                                                                                                                                      $ sudo yum update -y
                                                                                                                                                                                                                      $ sudo reboot

                                                                                                                                                                                                                      Note: If you had followed the steps to install Java11 as outlined above, you have had already updated the package, so you can skip the above given step.
                                                                                                                                                                                                                      • Use rpm file's path as per your current download location. In my case files are downloaded the packages and extracted in '/home/centos/Downloads/LibreOffice_6.3.5.2_Linux_x86-64_rpm/' folder.
                                                                                                                                                                                                                      $ sudo yum localinstall /home/centos/Downloads/LibreOffice_6.3.5.2_Linux_x86-64_rpm/RPMS/*.rpm -y
                                                                                                                                                                                                                      • LibreOffice and its dependencies will be installed and can be found in the following location:
                                                                                                                                                                                                                      /opt/libreoffice6.3
                                                                                                                                                                                                                      • For our convenience we will be creating 'links' to executable and libraries to keep everything in one place. We have a libreoffice folder within '/usr/local/alfresco-community70/' directory when we created the initial structure for setup. You can choose to keep executables and library at default location (as shown above) and use them in transformation service spring boot app launcher configuration. It is up to you.
                                                                                                                                                                                                                      • Create link for Libreoffice
                                                                                                                                                                                                                      - /opt/libreoffice6.3
                                                                                                                                                                                                                      $ sudo ln -s /opt/libreoffice6.3/* /usr/local/alfresco-community70/libreoffice
                                                                                                                                                                                                                      -DLIBREOFFICE_HOME="/usr/local/alfresco-community70/libreoffice" 


                                                                                                                                                                                                                      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 “/home/centos/Downloads/alfresco-pdf-renderer-1.1-linux.tgz"
                                                                                                                                                                                                                        $ sudo tar -xvf /home/centos/Downloads/alfresco-pdf-renderer-1.1-linux.tgz --directory /home/centos/Downloads/
                                                                                                                                                                                                                        $ sudo cp /home/centos/Downloads/alfresco-pdf-renderer /usr/local/alfresco-community70/alfresco-pdf-renderer/
                                                                                                                                                                                                                        • You would have following file in “/usr/local/alfresco-community70/alfresco-pdf-renderer/” directory:
                                                                                                                                                                                                                          • alfresco-pdf-renderer [Full path: /usr/local/alfresco-community70/alfresco-pdf-renderer/alfresco-pdf-renderer]
                                                                                                                                                                                                                          • Update the file permissions for '/usr/local/alfresco-community70/alfresco-pdf-renderer' directory:
                                                                                                                                                                                                                        $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/alfresco-pdf-renderer
                                                                                                                                                                                                                        $ sudo chmod -R 755 /usr/local/alfresco-community70/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 '/usr/local/alfresco-community70' directory.
                                                                                                                                                                                                                        $ sudo mkdir /usr/local/alfresco-community70/exiftool
                                                                                                                                                                                                                        • Extract “/home/centos/Downloads/image-exiftool-12.25.tgz" and copy the contents of '/home/centos/Downloads/Image-ExifTool-12.25' into '/usr/local/alfresco-community70/exiftool/' directory
                                                                                                                                                                                                                        $ sudo tar -xvf /home/centos/Downloads/image-exiftool-12.25.tgz --directory /home/centos/Downloads/
                                                                                                                                                                                                                        $ sudo cp -R /home/centos/Downloads/Image-ExifTool-12.25/* /usr/local/alfresco-community70/exiftool/

                                                                                                                                                                                                                        • Export the exiftool directory to PATH Variable (see here as well):
                                                                                                                                                                                                                          export PATH=$PATH:$ALF_HOME/exiftool
                                                                                                                                                                                                                          
                                                                                                                                                                                                                          or
                                                                                                                                                                                                                          
                                                                                                                                                                                                                          export PATH=$PATH:/usr/local/alfresco-community70/exiftool
                                                                                                                                                                                                                          • Update the file permissions for '/usr/local/alfresco-community70/exiftool' directory:
                                                                                                                                                                                                                            $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/exiftool
                                                                                                                                                                                                                            $ sudo chmod -R 755 /usr/local/alfresco-community70/exiftool



                                                                                                                                                                                                                            Open and edit “/usr/local/alfresco-community70/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


                                                                                                                                                                                                                            Note (Only applicable to Enterprise Edition, For community edition local transform service is only available option and must be enabled):

                                                                                                                                                                                                                            You can optionally disable local.transform service in alfresco Docker Container and enable transform service (asynchronous). Local Transform Service or Transform Service (supports only asynchronous requests) can be enabled or disabled independently of each other. Please keep in mind that when your deployment has Share and SOLR (think of full text indexing), or both then you'll need to have local.transform and transform service (asynchronous) enabled and running. The Repository will try to transform content using the Transform Service via the T-Router if possible and fall back to direct Local Transform Service. Share makes use of both, so functionality such as preview will be unavailable if local.transform service is disabled.


                                                                                                                                                                                                                            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 ''/usr/local/alfresco-community70/bin/" directory:
                                                                                                                                                                                                                            $ sudo cp /home/centos/Downloads/alfresco-transform-core-aio-boot-2.4.0.jar /usr/local/alfresco-community70/bin/
                                                                                                                                                                                                                            $ sudo chgrp Alfresco /usr/local/alfresco-community70/bin/alfresco-transform-core-aio-boot-2.4.0.jar
                                                                                                                                                                                                                            $ sudo chmod 755 /usr/local/alfresco-community70/bin/alfresco-transform-core-aio-boot-2.4.0.jar

                                                                                                                                                                                                                            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="/usr/local/alfresco-community70/alfresco-pdf-renderer/alfresco-pdf-renderer" \
                                                                                                                                                                                                                             -DLIBREOFFICE_HOME="/usr/local/alfresco-community70/libreoffice" \
                                                                                                                                                                                                                             -DIMAGEMAGICK_ROOT="/usr/local/alfresco-community70/imagemagick" \
                                                                                                                                                                                                                             -DIMAGEMAGICK_DYN="/usr/local/alfresco-community70/imagemagick" \
                                                                                                                                                                                                                             -DIMAGEMAGICK_EXE="/usr/local/alfresco-community70/imagemagick/convert" \
                                                                                                                                                                                                                             -DIMAGEMAGICK_CODERS="/usr/local/alfresco-community70/imagemagick/modules-Q16HDRI/coders" \
                                                                                                                                                                                                                             -DIMAGEMAGICK_CONFIG="/usr/local/alfresco-community70/imagemagick/config-Q16HDRI" \
                                                                                                                                                                                                                             -DACTIVEMQ_URL=failover:(tcp://localhost:61616)?timeout=3000 \
                                                                                                                                                                                                                             -jar /usr/local/alfresco-community70/bin/alfresco-transform-core-aio-boot-2.4.0.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. 

                                                                                                                                                                                                                            You can also use 'localTransformationService.sh' script to start/stop Local transformation service. 
                                                                                                                                                                                                                            • Copy the downloaded script file to ''/usr/local/alfresco-community70" directory:
                                                                                                                                                                                                                            $ sudo cp /home/centos/Downloads/alfresco7-solr-localtransform-dist-setup/linux-platform/alfresco-community70/localTransformationService.sh /usr/local/alfresco-community70/
                                                                                                                                                                                                                            $ sudo chgrp Alfresco /usr/local/alfresco-community70/localTransformationService.sh
                                                                                                                                                                                                                            $ sudo chmod 755 /usr/local/alfresco-community70/localTransformationService.sh
                                                                                                                                                                                                                            • To start/stop local transformation service, use following commands:
                                                                                                                                                                                                                            $ sudo -u alfresco /usr/local/alfresco-community70/localTransformationService.sh start
                                                                                                                                                                                                                            $ sudo -u alfresco /usr/local/alfresco-community70/localTransformationService.sh stop

                                                                                                                                                                                                                            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:

                                                                                                                                                                                                                            Metadata Extractors and Embedders Extension Point

                                                                                                                                                                                                                            metadata-extractor-demo-acs62

                                                                                                                                                                                                                             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=/usr/local/alfresco-community70
                                                                                                                                                                                                                                  • 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 /usr/local/alfresco-community70/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.

                                                                                                                                                                                                                                  For more details visit: 
                                                                                                                                                                                                                                                    For more details visit (This is forked repo containing acs7 fixes):

                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                    • Execute 'apply_amps.sh' script to apply amps, it will install amps copied under /usr/local/alfresco-community70/amps and /usr/local/alfresco-community70/amps_share directories to alfresco.war and share.war: 

                                                                                                                                                                                                                                  $ sudo $ALF_HOME/bin/apply_amps.sh

                                                                                                                                                                                                                                  OR 
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  $ sudo /usr/local/alfresco-community70/bin/apply_amps.sh
                                                                                                                                                                                                                                    • You would see following output as result of executing 'apply_amps.sh':
                                                                                                                                                                                                                                  Module 'alfresco-share-services' installed in '/usr/local/alfresco-community70/tomcat/webapps/alfresco.war'
                                                                                                                                                                                                                                  -    Title:        Alfresco Share Services AMP
                                                                                                                                                                                                                                  -    Version:      7.0.0
                                                                                                                                                                                                                                  -    Install Date: Thu June 18 20:03:49 EDT 2021
                                                                                                                                                                                                                                  -    Description:   Module to be applied to alfresco.war, containing APIs for Alfresco Share
                                                                                                                                                                                                                                  Module 'ootbee-support-tools-repo' installed in '/usr/local/alfresco-community70/tomcat/webapps/alfresco.war'
                                                                                                                                                                                                                                  -    Title:        OOTBee Support Tools - Repository Module
                                                                                                                                                                                                                                  -    Version:      1.1.0.0.9999999999
                                                                                                                                                                                                                                  -    Install Date: Thu Jun 18 20:03:48 EDT 2021
                                                                                                                                                                                                                                  - 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 '/usr/local/alfresco-community70/tomcat/webapps/alfresco.war' - Title: Javascript Console Alfresco Platform/Repository JAR Module - Version: 0.7.3 - Install Date: Thu Jun 18 20:03:46 EDT 2021
                                                                                                                                                                                                                                  - Description: Adminstration console module to execute arbitrary javascript code. Module 'support-tools-share' installed in '/usr/local/alfresco-community70/tomcat/webapps/share.war' - Title: OOTBee Support Tools - Share Module - Version: 1.1.0.0.9999999999 - Install Date: Thu Jun 18 20:03:55 EDT 2021
                                                                                                                                                                                                                                  - 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 '/usr/local/alfresco-community70/tomcat/webapps/share.war' - Title: Javascript Console Alfresco Share JAR Module - Version: 0.7.3 - Install Date: Thu Jun 18 20:03:53 EDT 2021
                                                                                                                                                                                                                                  - Description: Adminstration console module to execute arbitrary javascript code. About to clean out /usr/local/alfresco-community70/tomcat/webapps/alfresco and share directories and temporary files... Press control-c to stop this script . . . Press any other key to continue . . . Cleaning temporary Alfresco files from Tomcat...

                                                                                                                                                                                                                                  • After amps are install, you can choose to remove the backup files created by apply_amps.sh tool. Make sure the file permissions are fixed before restarting the tomcat.
                                                                                                                                                                                                                                  • When amps will be install, it may end up creating files with root user (as we would be using sudo) so make sure permissions are fixed back, Or install the amps using the 'alfresco' user mode (sudo -u alfresco). Update the file permissions for '/usr/local/alfresco-community70/tomcat/webapps/*.war' files:

                                                                                                                                                                                                                                  $ sudo chgrp -R Alfresco /usr/local/alfresco-community70/tomcat/webapps/*.war
                                                                                                                                                                                                                                  $ sudo chmod -R 775 /usr/local/alfresco-community70/tomcat/webapps/*.war


                                                                                                                                                                                                                                  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: 

                                                                                                                                                                                                                                    • 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".
                                                                                                                                                                                                                                  i.e. <show-authorization-status>false</show-authorization-status>

                                                                                                                                                                                                                                  $ sudo sed -i 's@<show-authorization-status>true</show-authorization-status>@<show-authorization-status>false</show-authorization-status>@' \
                                                                                                                                                                                                                                  	/usr/local/alfresco-community70/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml
                                                                                                                                                                                                                                    • 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 /usr/local/alfresco-community70/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xmlAdd below given config where <show-authorization-status> value should be false.
                                                                                                                                                                                                                                  $ sudo vim /usr/local/alfresco-community70/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.1.

                                                                                                                                                                                                                                  • Unzip the “alfresco-search-services-2.0.1.zip” package.
                                                                                                                                                                                                                                  $ sudo unzip /home/centos/Downloads/alfresco-search-services-2.0.1.zip -d /home/centos/Downloads/alfresco-search-services-2.0.1
                                                                                                                                                                                                                                  • Copy the extracted folder “alfresco-search-services” to “/usr/local/alfresco-search-services/
                                                                                                                                                                                                                                  $ sudo cp -R /home/centos/Downloads/alfresco-search-services-2.0.1/alfresco-search-services/* /usr/local/alfresco-search-services/
                                                                                                                                                                                                                                  • Update the permissions, we will use the user and group that we created initially for search services:
                                                                                                                                                                                                                                  $ sudo chown -R solr:Solr /usr/local/alfresco-search-services
                                                                                                                                                                                                                                                    $ sudo chmod -R 755 /usr/local/alfresco-search-services
                                                                                                                                                                                                                                                    $ sudo chmod -R 775 /usr/local/alfresco-search-services/logs
                                                                                                                                                                                                                                                    $ sudo chmod -R 775 /usr/local/alfresco-search-services/solrhome
                                                                                                                                                                                                                                                    • Open “/usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties” and add the following configuration properties: 

                                                                                                                                                                                                                                                    $ sudo vim /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties
                                                                                                                                                                                                                                                    solr.host=localhost
                                                                                                                                                                                                                                                    solr.port=8983
                                                                                                                                                                                                                                                    solr.secureComms=none #Possible values are: none, https, For ACS7.0, ACS7.1 or below ONLY
                                                                                                                                                                                                                                                    solr.base.url=/solr
                                                                                                                                                                                                                                                    index.subsystem.name=solr6

                                                                                                                                                                                                                                                    Note: We are setting up alfresco search services (solr6) without SSL, hence using non SSL port and setting secureComms property as none. "none" is only applicable to ACS7.1 or below. For ACS7.2 onwards this mode is deprecated and you have to enable secret mode. See section given below.
                                                                                                                                                                                                                                                      • [For ACS7.2 Only] Open “/usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties” and add the following configuration properties: 

                                                                                                                                                                                                                                                    $ sudo vim /usr/local/alfresco-community70/tomcat/shared/classes/alfresco-global.properties
                                                                                                                                                                                                                                                    solr.host=localhost
                                                                                                                                                                                                                                                    solr.port=8983
                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    #secret, https -- For ACS7.2 onwards
                                                                                                                                                                                                                                                    solr.secureComms=secret
                                                                                                                                                                                                                                                    solr.sharedSecret=secret # A password/secret string, here I am keeping it as 'secret'
                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    solr.base.url=/solr
                                                                                                                                                                                                                                                    index.subsystem.name=solr6

                                                                                                                                                                                                                                                    Note: ACS7.2 onwards solr.secureComms="none" and alfresco.secureComms="none" no longer works (Its deprecated). You need to configure the "secret" mode. Check this doc for more detailsYou must be using ASS 2.0.2.x and later version for 'secret' based communication when using ACS 7.2.x and later.

                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                    • We are enabling the multi language search support, Its optional if you wish to enable it. By default it is disabled. Open and edit “/usr/local/alfresco-search-services/solrhome/conf/shared.properties” and update following:
                                                                                                                                                                                                                                                    $ sudo vim /usr/local/alfresco-search-services/solrhome/conf/shared.properties
                                                                                                                                                                                                                                                    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 and edit “/usr/local/alfresco-search-services/solrhome/conf/shared.properties” and update following:
                                                                                                                                                                                                                                                    $ sudo vim /usr/local/alfresco-search-services/solrhome/conf/shared.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

                                                                                                                                                                                                                                                    • If you 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 none (Only if you are installing ACS7.1.x or ACS7.0.x, It is not supported for ACS7.2 onwards. Check this doc for more details). It is mandatory as default value is https. Open and edit “/usr/local/alfresco-search-services/solr.in.sh” file and add following at the end of the file:
                                                                                                                                                                                                                                                    $ sudo vim /usr/local/alfresco-search-services/solr.in.sh
                                                                                                                                                                                                                                                    SOLR_SOLR_HOST=localhost
                                                                                                                                                                                                                                                    SOLR_SOLR_PORT=8983
                                                                                                                                                                                                                                                    SOLR_SOLR_BASEURL=/solr
                                                                                                                                                                                                                                                    SOLR_ALFRESCO_HOST=localhost
                                                                                                                                                                                                                                                    SOLR_ALFRESCO_PORT=8080
                                                                                                                                                                                                                                                    SOLR_ALFRESCO_BASEURL=/alfresco
                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    #Since we are setting up with no SSL, this property need to be set to none. Default is https. For ACS7.0, ACS7.1 or below ONLY
                                                                                                                                                                                                                                                    SOLR_ALFRESCO_SECURECOMMS=none

                                                                                                                                                                                                                                                        • Note [For ACS7.2 Only] If you are installing ACS7.2, make sure to use "secret" mode. http only (alfresco.secureComms=none) are no longer supported for ACS7.2 onwards. Check this doc for more detailsWe are setting up without SSL, so set this variable SOLR_ALFRESCO_SECURECOMMS to "secret"It is mandatory as default value is https. Open and edit “/usr/local/alfresco-search-services/solr.in.sh” file and add following at the end of the file:
                                                                                                                                                                                                                                                      $ sudo vim /usr/local/alfresco-search-services/solr.in.sh
                                                                                                                                                                                                                                                      SOLR_SOLR_HOST=localhost
                                                                                                                                                                                                                                                      SOLR_SOLR_PORT=8983
                                                                                                                                                                                                                                                      SOLR_SOLR_BASEURL=/solr
                                                                                                                                                                                                                                                      SOLR_ALFRESCO_HOST=localhost
                                                                                                                                                                                                                                                      SOLR_ALFRESCO_PORT=8080
                                                                                                                                                                                                                                                      SOLR_ALFRESCO_BASEURL=/alfresco
                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                      #Since we are setting up with no SSL, this property need to be set to secret. Default is https. For ACS7.2 onwards
                                                                                                                                                                                                                                                      #ACS72 Shared secret [Start] ############## #export JAVA_TOOL_OPTIONS="-Dalfresco.secureComms.secret=secret" ############ OR Instead of JAVA_TOOL_OPTIONS, you can also export SOLR_OPTS , example below. Make sure you dont export both### export SOLR_OPTS="-Dalfresco.secureComms.secret=secret" #ACS72 Shared secret [End] ############## SOLR_ALFRESCO_SECURECOMMS=secret
                                                                                                                                                                                                                                                        • You can also set SOLR_HOME variable in solr.in.sh (if you see error like  ERROR: Solr home directory /usr/local/alfresco-search-services must contain solr.xml,  then this setting is must) 

                                                                                                                                                                                                                                                      SOLR_HOME=/usr/local/alfresco-search-services/solrhome
                                                                                                                                                                                                                                                      • Alternatively you can set the properties in “/usr/local/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.
                                                                                                                                                                                                                                                      $ sudo vim /usr/local/alfresco-search-services/solrhome/templates/rerank/conf/solrcore.properties
                                                                                                                                                                                                                                                      alfresco.secureComms=none
                                                                                                                                                                                                                                                      • Note [For ACS7.2 Only] - If you are installing ACS7.2, make sure to use "secret" mode. http only (alfresco.secureComms=none) are no longer supported for ACS7.2 onwards. Refer below settings if you are installing ACS7.2. Here is solrcore.properties for reference. You must be using ASS 2.0.2.x and later version for 'secret' based communication.
                                                                                                                                                                                                                                                      $ sudo vim /usr/local/alfresco-search-services/solrhome/templates/rerank/conf/solrcore.properties
                                                                                                                                                                                                                                                        • [For ACS7.2 Only] If you have previously started the solr and solr cores "alfresco" and "archive" are created already then update the following files with below given properties. You must be using ASS 2.0.2.x and later version for 'secret' based communication when using ACS 7.2.x and later.
                                                                                                                                                                                                                                                      $ sudo vim /usr/local/alfresco-search-services/solrhome/alfresco/conf/solrcore.properties
                                                                                                                                                                                                                                                      $ sudo vim /usr/local/alfresco-search-services/solrhome/archive/conf/solrcore.properties
                                                                                                                                                                                                                                                      alfresco.secureComms=secret 

                                                                                                                                                                                                                                                      For all the externalized search service configurations (environment variables), visit: https://docs.alfresco.com/search-community/concepts/external-properties-solr.html  


                                                                                                                                                                                                                                                      • Starting and stopping alfresco search service instructions.
                                                                                                                                                                                                                                                      Starting ASS:
                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                      sudo -u solr $SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"

                                                                                                                                                                                                                                                      The command line parameter, -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 ASS: 
                                                                                                                                                                                                                                                        sudo -u solr $SOLR_HOME/solr/bin/solr stop -p 8983
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        Or
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        sudo -u solr $SOLR_HOME/solr/bin/solr stop -all
                                                                                                                                                                                                                                                        • Configure solr log, The logs are stored in the /usr/local/alfresco-search-services/logs/solr.log file, by default. This can be configured in solr.in.sh using SOLR_LOGS_DIR. This is optional setup. We are keeping default settings
                                                                                                                                                                                                                                                        SOLR_LOGS_DIR=../../logs
                                                                                                                                                                                                                                                        LOG4J_PROPS=$SOLR_LOGS_DIR/log4j.properties
                                                                                                                                                                                                                                                        • We will create a system service for solr
                                                                                                                                                                                                                                                        $ sudo vim /etc/systemd/system/solr.service
                                                                                                                                                                                                                                                        # Systemd unit file for solr6
                                                                                                                                                                                                                                                        [Unit]
                                                                                                                                                                                                                                                        Description=Alfresco search service
                                                                                                                                                                                                                                                        After=syslog.target network.target
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        [Service]
                                                                                                                                                                                                                                                        Type=forking
                                                                                                                                                                                                                                                        Restart=always
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        Environment=JAVA_HOME=/usr/lib/jvm/jre
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        ExecStart=/usr/local/alfresco-search-services/solr/bin/solr start
                                                                                                                                                                                                                                                        ExecStop=/usr/local/alfresco-search-services/solr/bin/solr stop -all
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        User=solr
                                                                                                                                                                                                                                                        Group=Solr
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        [Install]
                                                                                                                                                                                                                                                        WantedBy=multi-user.target

                                                                                                                                                                                                                                                          • Reload demons
                                                                                                                                                                                                                                                        $ sudo systemctl daemon-reload
                                                                                                                                                                                                                                                          • Start and enable solr to automatically start at boot time
                                                                                                                                                                                                                                                          $ sudo systemctl start solr
                                                                                                                                                                                                                                                          $ sudo systemctl enable solr
                                                                                                                                                                                                                                                          • To check status whether solr service is running or not, use below given command:
                                                                                                                                                                                                                                                          $ sudo systemctl status solr
                                                                                                                                                                                                                                                          • We will open following ports for alfresco and share access:
                                                                                                                                                                                                                                                          - 8983 --> for alfresco and share access.
                                                                                                                                                                                                                                                          $ sudo firewall-cmd --zone=public --permanent --add-port=8983/tcp
                                                                                                                                                                                                                                                          $ sudo firewall-cmd --reload
                                                                                                                                                                                                                                                          • Verify the SOLR Admin UI. Use the URL below to launch SOLR Admin UI and validate the status and cores:



                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                              "authentication" : {
                                                                                                                                                                                                                                                                "class": "org.alfresco.solr.security.SecretSharedAuthPlugin"
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                          •  [For ACS7.2 Only] To verify the Solr Admin UI when using secret mode. 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)
                                                                                                                                                                                                                                                            • 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:

                                                                                                                                                                                                                                                          Note: You must be using ASS 2.0.2.x and later version for 'secret' based communication when using ACS 7.2.x and later.

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


                                                                                                                                                                                                                                                          ###############################
                                                                                                                                                                                                                                                          ## Common Alfresco Properties #
                                                                                                                                                                                                                                                          ###############################
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          dir.root=/usr/local/alfresco-community70/alf_data
                                                                                                                                                                                                                                                          dir.contentstore=${dir.root}/contentstore
                                                                                                                                                                                                                                                          dir.contentstore.deleted=${dir.root}/contentstore.deleted
                                                                                                                                                                                                                                                          dir.keystore=/usr/local/alfresco-community70/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=/usr/local/alfresco-community70
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          ### 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
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #none, https -- For ACS7.0, ACS7.1 or Below 
                                                                                                                                                                                                                                                          solr.secureComms=none
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #secret, https -- For ACS7.2 onwards, comment above property and enable below two properties
                                                                                                                                                                                                                                                          #solr.secureComms=secret
                                                                                                                                                                                                                                                          #solr.sharedSecret=secret
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          solr.base.url=/solr
                                                                                                                                                                                                                                                          index.subsystem.name=solr6
                                                                                                                                                                                                                                                          

                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          #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=debug
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #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=DEBUG
                                                                                                                                                                                                                                                          log4j.logger.org.alfresco.repo.content.metadata.MetadataExtracterRegistry=DEBUG
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #Thumbnail logs
                                                                                                                                                                                                                                                          log4j.logger.org.alfresco.repo.thumbnail=DEBUG
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          # FTP server debugging
                                                                                                                                                                                                                                                          log4j.logger.org.alfresco.ftp.protocol=debug
                                                                                                                                                                                                                                                          log4j.logger.org.alfresco.ftp.server=debug
                                                                                                                                                                                                                                                          



                                                                                                                                                                                                                                                          # 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_JAVA_MEM="-Xms2g -Xmx2g"
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          SOLR_LOGS_DIR=../../logs
                                                                                                                                                                                                                                                          LOG4J_PROPS=$SOLR_LOGS_DIR/log4j.properties
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          SOLR_SOLR_HOST=localhost
                                                                                                                                                                                                                                                          SOLR_SOLR_PORT=8983
                                                                                                                                                                                                                                                          SOLR_SOLR_BASEURL=/solr
                                                                                                                                                                                                                                                          SOLR_ALFRESCO_HOST=localhost
                                                                                                                                                                                                                                                          SOLR_ALFRESCO_PORT=8080
                                                                                                                                                                                                                                                          SOLR_ALFRESCO_BASEURL=/alfresco
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #Since we are setting up with no SSL, this property need to be set to none. Default is https. ACS7.1 or below only
                                                                                                                                                                                                                                                          SOLR_ALFRESCO_SECURECOMMS=none
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #Since we are setting up with no SSL, this property need to be set to 'secret'. Default is https. ACS7.2 onwards
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #SOLR_ALFRESCO_SECURECOMMS=secret
                                                                                                                                                                                                                                                          #ACS72 Shared secret [Start] ##############
                                                                                                                                                                                                                                                          #export JAVA_TOOL_OPTIONS="-Dalfresco.secureComms.secret=secret"
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          ############ OR Instead of JAVA_TOOL_OPTIONS, you can also export SOLR_OPTS , example below. Make sure you dont export both###
                                                                                                                                                                                                                                                          #export SOLR_OPTS="-Dalfresco.secureComms.secret=secret"
                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                          #ACS72 Shared secret [End] ##############
                                                                                                                                                                                                                                                          



                                                                                                                                                                                                                                                          Start and test:


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

                                                                                                                                                                                                                                                          • Start AMQ
                                                                                                                                                                                                                                                            • To start AMQ, you can use the following command:

                                                                                                                                                                                                                                                          $ sudo systemctl start activemq
                                                                                                                                                                                                                                                          • Start LocalTransformationService
                                                                                                                                                                                                                                                            • To start LocalTransformationService, you can use following command or use this script:

                                                                                                                                                                                                                                                          java -XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80 -DPDFRENDERER_EXE="/usr/local/alfresco-community70/alfresco-pdf-renderer/alfresco-pdf-renderer" -DLIBREOFFICE_HOME="/usr/local/alfresco-community70/libreoffice" -DIMAGEMAGICK_ROOT="/usr/local/alfresco-community70/imagemagick" -DIMAGEMAGICK_DYN="/usr/local/alfresco-community70/imagemagick" -DIMAGEMAGICK_EXE="/usr/local/alfresco-community70/imagemagick/convert" -DIMAGEMAGICK_CODERS="/usr/local/alfresco-community70/imagemagick/modules-Q16HDRI/coders" -DIMAGEMAGICK_CONFIG="/usr/local/alfresco-community70/imagemagick/config-Q16HDRI" -DACTIVEMQ_URL="failover:(tcp://localhost:61616)?timeout=3000" -jar /usr/local/alfresco-community70/bin/alfresco-transform-core-aio-boot-2.4.0.jar

                                                                                                                                                                                                                                                          Note: You can access "http://localhost:8090" URL to check the app status and run transform tests as well. See transformation service setup above for reference. 

                                                                                                                                                                                                                                                           


                                                                                                                                                                                                                                                            • Start DB
                                                                                                                                                                                                                                                              • To start DB, you can use the following command:
                                                                                                                                                                                                                                                            $ sudo systemctl start postgresql-13.service
                                                                                                                                                                                                                                                            • Start Alfresco
                                                                                                                                                                                                                                                              • To start Alfresco, you can use the following command:
                                                                                                                                                                                                                                                            $ sudo systemctl start tomcat

                                                                                                                                                                                                                                                                • Start ASS
                                                                                                                                                                                                                                                                  • To start ASS (solr6), use the following command by navigating to “/usr/local/alfresco-search-services/solr/bin” folder via command prompt:
                                                                                                                                                                                                                                                                    • Initial start only: sudo -u solr $SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
                                                                                                                                                                                                                                                                    • Consecutive start command: sudo systemctl start solr

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

                                                                                                                                                                                                                                                                I have created a convenience script “start.sh”, you can use this to start all services instead of doing one by one.
                                                                                                                                                                                                                                                                  • Copy this script to '/usr/local/alfresco-community70' directory and set the appropriate permissions.
                                                                                                                                                                                                                                                                $ sudo cp /home/centos/Downloads/alfresco7-solr-localtransform-dist-setup/linux-platform/alfresco-community70/start.sh /usr/local/alfresco-community70/
                                                                                                                                                                                                                                                                $ sudo chgrp Alfresco /usr/local/alfresco-community70/start.sh
                                                                                                                                                                                                                                                                $ sudo chmod 755 /usr/local/alfresco-community70/start.sh

                                                                                                                                                                                                                                                                #!/bin/bash
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                #Order of operation
                                                                                                                                                                                                                                                                ## - Start AMQ
                                                                                                                                                                                                                                                                ## - Start LocalTransformationService
                                                                                                                                                                                                                                                                ## - Start DB
                                                                                                                                                                                                                                                                ## - Start ACS
                                                                                                                                                                                                                                                                ## - Start SOLR
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                printf "\n------------------------------ Starting services ------------------------- \n"
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                #User can pass ALF_HOME path. Defaults to "/usr/local/alfresco-community70".
                                                                                                                                                                                                                                                                export ALF_HOME=${1:-"/usr/local/alfresco-community70"}
                                                                                                                                                                                                                                                                #User can pass SOLR_HOME path. Defaults to "/usr/local/alfresco-search-services".
                                                                                                                                                                                                                                                                export SOLR_HOME=${2:-"/usr/local/alfresco-search-services"}
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                export CATALINA_HOME=$ALF_HOME/tomcat
                                                                                                                                                                                                                                                                export CATALINA_TMPDIR=$CATALINA_HOME/temp
                                                                                                                                                                                                                                                                export JRE_HOME=$JAVA_HOME
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                # Check if JRE_HOME is set in path variable or not, else set default path. It is mandatory for acs to start
                                                                                                                                                                                                                                                                if [ -z "$JRE_HOME" ]
                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                  echo "JRE_HOME could not be found, setting the default..." 
                                                                                                                                                                                                                                                                  export JRE_HOME="/usr/lib/jvm/java-11"
                                                                                                                                                                                                                                                                fi
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                #Export JRE_HOME to PATH
                                                                                                                                                                                                                                                                export PATH=$PATH:$JRE_HOME/bin
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                # Check if ALF_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
                                                                                                                                                                                                                                                                if [[ "$PATH" == *"$ALF_HOME"* ]]; then
                                                                                                                                                                                                                                                                  echo "$ALF_HOME already set in PATH variable."
                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                  export PATH=$PATH:$ALF_HOME
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                fi
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                # Check if SOLR_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
                                                                                                                                                                                                                                                                if [[ "$PATH" == *"$SOLR_HOME"* ]]; then
                                                                                                                                                                                                                                                                  echo "$SOLR_HOME already set in PATH variable."
                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                  export PATH=$PATH:$SOLR_HOME
                                                                                                                                                                                                                                                                fi
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                #User need to pass this param on initial startup in order to create the cores. if core values are not passed then default 'alfresco and archive' will be used.
                                                                                                                                                                                                                                                                SOLR_CORES=${3:-"alfresco,archive"}
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                #Set the exiftool path in PATH variable.
                                                                                                                                                                                                                                                                export PATH=$PATH:$ALF_HOME/exiftool
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                JAVA_OPTS="-Xms3G -Xmx4G -Xss1024k"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -XX:+UseG1GC -XX:+UseStringDeduplication"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -Djava.io.tmpdir=${CATALINA_TMPDIR}"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote=true"
                                                                                                                                                                                                                                                                JAVA_OPTS="${JAVA_OPTS} -server"
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                echo "-------------------------------------------"
                                                                                                                                                                                                                                                                echo CATALINA_HOME: $CATALINA_HOME
                                                                                                                                                                                                                                                                echo CATALINA_TMPDIR: $CATALINA_TMPDIR
                                                                                                                                                                                                                                                                echo JRE_HOME: $JRE_HOME
                                                                                                                                                                                                                                                                echo JAVA_OPTS: $JAVA_OPTS
                                                                                                                                                                                                                                                                echo SOLR_HOME: $SOLR_HOME
                                                                                                                                                                                                                                                                echo ALF_HOME: $ALF_HOME
                                                                                                                                                                                                                                                                echo PATH: $PATH
                                                                                                                                                                                                                                                                echo "-------------------------------------------"
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartAMQ() {
                                                                                                                                                                                                                                                                	printf "\nStarting ActiveMQ... \n"
                                                                                                                                                                                                                                                                	sudo systemctl start activemq
                                                                                                                                                                                                                                                                	
                                                                                                                                                                                                                                                                	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                	then
                                                                                                                                                                                                                                                                           echo "activemq service started successfully."
                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                	   echo "Failed to start activemq service!"
                                                                                                                                                                                                                                                                	   exit 1
                                                                                                                                                                                                                                                                        fi
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartLocalTransformService() {
                                                                                                                                                                                                                                                                    printf "\nInvoking local transformation service startup script... \n"
                                                                                                                                                                                                                                                                	# Check for more info: https://docs.alfresco.com/transform-service/latest/install/#install-with-zip
                                                                                                                                                                                                                                                                	sudo -u alfresco $ALF_HOME/localTransformationService.sh start
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                	then
                                                                                                                                                                                                                                                                           echo "localTransformService script executed successfully."
                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                	   echo "Failed to execute localTransformService script!"
                                                                                                                                                                                                                                                                	   exit 1
                                                                                                                                                                                                                                                                        fi
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartDB() {
                                                                                                                                                                                                                                                                	printf "\nStarting Postgresql... \n"
                                                                                                                                                                                                                                                                	sudo systemctl start postgresql-13.service
                                                                                                                                                                                                                                                                	
                                                                                                                                                                                                                                                                	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                	   echo "postgresql-13.service started successfully."
                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                	   echo "Failed to start postgresql-13.service!"
                                                                                                                                                                                                                                                                	   exit 1
                                                                                                                                                                                                                                                                        fi
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartACS() {
                                                                                                                                                                                                                                                                        printf "\nStarting Alfresco Tomcat... \n"
                                                                                                                                                                                                                                                                	sudo systemctl start tomcat
                                                                                                                                                                                                                                                                	
                                                                                                                                                                                                                                                                	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                	then
                                                                                                                                                                                                                                                                           echo "tomcat service started successfully."
                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                	   echo "Failed to start tomcat service!"
                                                                                                                                                                                                                                                                	   exit 1
                                                                                                                                                                                                                                                                        fi
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartSOLR() {
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                	#flag for creating the cores on first startup
                                                                                                                                                                                                                                                                	INITIAL=false
                                                                                                                                                                                                                                                                		
                                                                                                                                                                                                                                                                	#Setting the context to solrhome
                                                                                                                                                                                                                                                                	cd $SOLR_HOME/solrhome
                                                                                                                                                                                                                                                                	for CORE in ${SOLR_CORES//,/ }
                                                                                                                                                                                                                                                                        do
                                                                                                                                                                                                                                                                	   echo "Checking availability of the core: $CORE"
                                                                                                                                                                                                                                                                	   if [ -d "$CORE" ]; then
                                                                                                                                                                                                                                                                              echo "'$CORE' found.."
                                                                                                                                                                                                                                                                	      INITIAL=false
                                                                                                                                                                                                                                                                	   else
                                                                                                                                                                                                                                                                	      echo "Warning: '$CORE' NOT found."
                                                                                                                                                                                                                                                                   	      INITIAL=true
                                                                                                                                                                                                                                                                	   fi
                                                                                                                                                                                                                                                                        done
                                                                                                                                                                                                                                                                	  
                                                                                                                                                                                                                                                                        #Going back to original context
                                                                                                                                                                                                                                                                        cd $ALF_HOME
                                                                                                                                                                                                                                                                	
                                                                                                                                                                                                                                                                        if [[ $INITIAL == true ]]; then
                                                                                                                                                                                                                                                                	   printf "\nStarting solr6 with initial mode, core '$SOLR_CORES' will be created... \n"
                                                                                                                                                                                                                                                                           sudo -u solr $SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                           printf "\nStarting solr6... \n"
                                                                                                                                                                                                                                                                    	   sudo systemctl start solr
                                                                                                                                                                                                                                                                	   if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                	   then
                                                                                                                                                                                                                                                                	     echo "solr6 service started successfully."
                                                                                                                                                                                                                                                                	   else
                                                                                                                                                                                                                                                                	     echo "Failed to start solr6 service!"
                                                                                                                                                                                                                                                                	     exit 1
                                                                                                                                                                                                                                                                    	   fi
                                                                                                                                                                                                                                                                       fi
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                ###################################
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                StartAMQ
                                                                                                                                                                                                                                                                StartLocalTransformService
                                                                                                                                                                                                                                                                StartDB
                                                                                                                                                                                                                                                                StartACS
                                                                                                                                                                                                                                                                StartSOLR
                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                ###################################



                                                                                                                                                                                                                                                                        http://localhost:8080/alfresco 
                                                                                                                                                                                                                                                                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 /usr/local/alfresco-community70/tomcat/conf/context.xml. so either increase it until you stop seeing the warning or disable it completely.
                                                                                                                                                                                                                                                                    • Stop tomcat and make sure to cleanup tomcat 'work' (/usr/local/alfresco-community70/tomcat/work/) directory before restarting the server.
                                                                                                                                                                                                                                                                    • Open and edit /usr/local/alfresco-community70/tomcat/conf/context.xml
                                                                                                                                                                                                                                                                  $ sudo rm -rf /usr/local/alfresco-community70/tomcat/work/Catalina/*
                                                                                                                                                                                                                                                                  $ sudo vim /usr/local/alfresco-community70/tomcat/conf/context.xml
                                                                                                                                                                                                                                                                <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" clean the tomcat 'work' (/usr/local/alfresco-community70/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
                                                                                                                                                                                                                                                                  • To stop LocalTransformationService, you can use following command or use this script:

                                                                                                                                                                                                                                                                $ sudo kill -9 $(lsof -t -i:8090)

                                                                                                                                                                                                                                                                Note: See transformation service setup above for reference.
                                                                                                                                                                                                                                                                • Stop Alfresco
                                                                                                                                                                                                                                                                  • To stop Alfresco, you can use the following command:
                                                                                                                                                                                                                                                                $ sudo systemctl stop tomcat
                                                                                                                                                                                                                                                                • Stop DB
                                                                                                                                                                                                                                                                  • To stop DB, you can use following command:
                                                                                                                                                                                                                                                                $ sudo systemctl stop postgresql-13.service

                                                                                                                                                                                                                                                                    • Stop ASS (solr6)
                                                                                                                                                                                                                                                                      • To stop ASS, use the following command by navigating to “/usr/local/alfresco-search-services/solr/bin” folder via command prompt:
                                                                                                                                                                                                                                                                        • sudo -u solr $SOLR_HOME/solr/bin/solr stop -all
                                                                                                                                                                                                                                                                        • Or sudo -u solr $SOLR_HOME/solr/bin/solr stop -p 8983

                                                                                                                                                                                                                                                                    Note: See the search service configuration section for more details.
                                                                                                                                                                                                                                                                    • Stop AMQ
                                                                                                                                                                                                                                                                      • To stop AMQ, you can use the following command:
                                                                                                                                                                                                                                                                    $ sudo systemctl stop activemq


                                                                                                                                                                                                                                                                    I have created a convenience script “stop.sh”, you can use this to stop all services instead of doing one by one.

                                                                                                                                                                                                                                                                      • Copy this script to '/usr/local/alfresco-community70' directory and set the appropriate permissions.
                                                                                                                                                                                                                                                                    $ sudo cp /home/centos/Downloads/alfresco7-solr-localtransform-dist-setup/linux-platform/alfresco-community70/stop.sh /usr/local/alfresco-community70/
                                                                                                                                                                                                                                                                    $ sudo chgrp Alfresco /usr/local/alfresco-community70/stop.sh
                                                                                                                                                                                                                                                                    $ sudo chmod 755 /usr/local/alfresco-community70/stop.sh

                                                                                                                                                                                                                                                                    #!/bin/bash
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    #Order of operation
                                                                                                                                                                                                                                                                    ## - Stop LocalTransformService
                                                                                                                                                                                                                                                                    ## - Stop ACS
                                                                                                                                                                                                                                                                    ## - Stop DB
                                                                                                                                                                                                                                                                    ## - Stop Solr
                                                                                                                                                                                                                                                                    ## - Stop AMQ
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    printf "\n------------------------------ Stopping services ------------------------- \n"
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    #User can pass ALF_HOME path. Defaults to "/usr/local/alfresco-community70".
                                                                                                                                                                                                                                                                    export ALF_HOME=${1:-"/usr/local/alfresco-community70"}
                                                                                                                                                                                                                                                                    #User can pass SOLR_HOME path. Defaults to "/usr/local/alfresco-search-services".
                                                                                                                                                                                                                                                                    export SOLR_HOME=${2:-"/usr/local/alfresco-search-services"}
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    export CATALINA_HOME=$ALF_HOME/tomcat
                                                                                                                                                                                                                                                                    export CATALINA_TMPDIR=$CATALINA_HOME/temp
                                                                                                                                                                                                                                                                    export JRE_HOME=$JAVA_HOME
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    # Check if JRE_HOME is set in path variable or not, else set default path. It is mandatory for acs to start
                                                                                                                                                                                                                                                                    if [ -z "$JRE_HOME" ]
                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                      echo "JRE_HOME could not be found, setting the default..." 
                                                                                                                                                                                                                                                                      export JRE_HOME="/usr/lib/jvm/java-11"
                                                                                                                                                                                                                                                                    fi
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    #Export JRE_HOME to PATH
                                                                                                                                                                                                                                                                    export PATH=$PATH:$JRE_HOME/bin
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    # Check if ALF_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
                                                                                                                                                                                                                                                                    if [[ "$PATH" == *"$ALF_HOME"* ]]; then
                                                                                                                                                                                                                                                                      echo "$ALF_HOME already set in PATH variable."
                                                                                                                                                                                                                                                                    else 
                                                                                                                                                                                                                                                                      export PATH=$PATH:$ALF_HOME
                                                                                                                                                                                                                                                                    fi
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    # Check if SOLR_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
                                                                                                                                                                                                                                                                    if [[ "$PATH" == *"$SOLR_HOME"* ]]; then
                                                                                                                                                                                                                                                                      echo "$SOLR_HOME already set in PATH variable."
                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                      export PATH=$PATH:$SOLR_HOME
                                                                                                                                                                                                                                                                    fi
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    echo "---------------------------------------------"
                                                                                                                                                                                                                                                                    echo CATALINA_HOME: $CATALINA_HOME
                                                                                                                                                                                                                                                                    echo CATALINA_TMPDIR: $CATALINA_TMPDIR
                                                                                                                                                                                                                                                                    echo JRE_HOME: $JRE_HOME
                                                                                                                                                                                                                                                                    echo SOLR_HOME: $SOLR_HOME
                                                                                                                                                                                                                                                                    echo ALF_HOME: $ALF_HOME
                                                                                                                                                                                                                                                                    echo PATH: $PATH
                                                                                                                                                                                                                                                                    echo "---------------------------------------------"
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopLocalTransformService() {
                                                                                                                                                                                                                                                                        printf "\nInvoking local transformation service stop script... \n"
                                                                                                                                                                                                                                                                    	# Check for more info: https://docs.alfresco.com/transform-service/latest/install/#install-with-zip
                                                                                                                                                                                                                                                                    	sudo -u alfresco $ALF_HOME/localTransformationService.sh stop
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                    	then
                                                                                                                                                                                                                                                                               echo "localTransformService script executed successfully."
                                                                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                                                                    	   echo "Failed to execute localTransformService script!"
                                                                                                                                                                                                                                                                    	   exit 1
                                                                                                                                                                                                                                                                            fi
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopACS() {
                                                                                                                                                                                                                                                                            printf "\nShutting down Alfresco Tomcat... \n"
                                                                                                                                                                                                                                                                    	sudo systemctl stop tomcat
                                                                                                                                                                                                                                                                    	
                                                                                                                                                                                                                                                                    	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                    	then
                                                                                                                                                                                                                                                                    	   echo "tomcat service stopped successfully."
                                                                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                                                                    	   echo "Failed to stop tomcat service!"
                                                                                                                                                                                                                                                                    	   exit 1
                                                                                                                                                                                                                                                                            fi
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopDB() {
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    	printf "\nShutting down Postgresql... \n"
                                                                                                                                                                                                                                                                    	sudo systemctl stop postgresql-13.service
                                                                                                                                                                                                                                                                    	
                                                                                                                                                                                                                                                                    	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                    	   echo "postgresql-13.service stopped successfully."
                                                                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                                                                    	   echo "Failed to stop postgresql-13.service!"
                                                                                                                                                                                                                                                                    	   exit 1
                                                                                                                                                                                                                                                                           fi
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopSOLR() {
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    	printf "\nShutting down solr6... \n"
                                                                                                                                                                                                                                                                    	sudo systemctl stop solr
                                                                                                                                                                                                                                                                    	
                                                                                                                                                                                                                                                                    	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                    	then
                                                                                                                                                                                                                                                                    	  echo "solr6 service stopped successfully."
                                                                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                                                                    	  echo "Failed to stop solr6 service!"
                                                                                                                                                                                                                                                                    	  exit 1
                                                                                                                                                                                                                                                                            fi
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopAMQ() {
                                                                                                                                                                                                                                                                    	printf "\nStopping ActiveMQ... \n"
                                                                                                                                                                                                                                                                    	sudo systemctl stop activemq
                                                                                                                                                                                                                                                                    	
                                                                                                                                                                                                                                                                    	if [[ $? = 0 ]]
                                                                                                                                                                                                                                                                    	then
                                                                                                                                                                                                                                                                               echo "activemq service stopped successfully."
                                                                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                                                                    	   echo "Failed to stop activemq service!"
                                                                                                                                                                                                                                                                    	   exit 1
                                                                                                                                                                                                                                                                            fi
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    ###################################
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    StopLocalTransformService
                                                                                                                                                                                                                                                                    StopACS
                                                                                                                                                                                                                                                                    StopDB
                                                                                                                                                                                                                                                                    StopSOLR
                                                                                                                                                                                                                                                                    StopAMQ
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    ###################################




                                                                                                                                                                                                                                                                    Alfresco Content Services file/folder permissions example:

                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70' directory level:
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    drwxr-xr-x. 11 root Alfresco  222 Jun 18 19:55 activemq
                                                                                                                                                                                                                                                                    drwxrwxr-x.  5 root Alfresco   88 Jun 18 19:48 alf_data
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco   53 Jun 18 16:23 alfresco-pdf-renderer
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco  140 Jun 18 16:48 amps
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco  107 Jun 18 12:45 amps_share
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco   92 Jun 18 20:03 bin
                                                                                                                                                                                                                                                                    drwxr-xr-x.  8 root Alfresco  255 Jun 24 10:05 exiftool
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco   84 Jun 18 18:05 imagemagick
                                                                                                                                                                                                                                                                    drwxr-xr-x.  2 root Alfresco  163 Jun 18 18:11 libreoffice
                                                                                                                                                                                                                                                                    drwxr-xr-x.  3 root Alfresco   78 Jun 18 17:28 licenses
                                                                                                                                                                                                                                                                    -rwxr-xr-x.  1 root Alfresco 2801 Jun 24 18:15 localTransformationService.sh
                                                                                                                                                                                                                                                                    drwxr-xr-x.  4 root Alfresco   53 Jun 18 12:45 modules
                                                                                                                                                                                                                                                                    -rwxr-xr-x.  1 root Alfresco 3839 Jun 18 17:27 start.sh
                                                                                                                                                                                                                                                                    -rwxr-xr-x.  1 root Alfresco 2428 Jun 18 17:28 stop.sh
                                                                                                                                                                                                                                                                    drwxr-xr-x. 10 root Alfresco  252 Jun 18 20:12 tomcat
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70/tomcat' directory level:
                                                                                                                                                                                                                                                                    drwxr-xr-x. 2 root Alfresco 4096 Jun 18 20:11 bin
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 19318 Jun 18 20:11 BUILDING.txt
                                                                                                                                                                                                                                                                    drwxr-xr-x. 3 root Alfresco 254 Jun 18 18:53 conf
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 5408 Jun 18 20:11 CONTRIBUTING.md
                                                                                                                                                                                                                                                                    drwxr-xr-x. 2 root Alfresco 4096 Jun 18 20:12 lib
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 57011 Jun 18 20:11 LICENSE
                                                                                                                                                                                                                                                                    drwxrwxr-x. 2 root Alfresco 197 Jun 18 17:06 logs
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 1726 Jun 18 20:11 NOTICE
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 3257 Jun 18 20:11 README.md
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 193 Jun 18 20:12 Readme.txt
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 7136 Jun 18 20:11 RELEASE-NOTES
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 root Alfresco 16507 Jun 18 20:11 RUNNING.txt
                                                                                                                                                                                                                                                                    drwxr-xr-x. 4 root Alfresco 32 Jun 18 20:12 shared
                                                                                                                                                                                                                                                                    drwxrwxr-x. 5 root Alfresco 165 Jun 18 18:43 temp
                                                                                                                                                                                                                                                                    drwxrwxr-x. 6 root Alfresco 136 Jun 18 16:12 webapps
                                                                                                                                                                                                                                                                    drwxrwxr-x. 3 root Alfresco 22 Jun 18 20:56 work
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70/tomcat/logs' directory level:
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 3476532 Jun 18 18:43 catalina.2021-01-29.log
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 1475688 Jun 18 18:43 catalina.out
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 0 Jun 18 17:06 host-manager.2021-01-29.log
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 7187 Jun 18 18:43 localhost.2021-01-29.log
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 2470863 Jun 18 18:58 localhost_access_log.2021-01-29.txt
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 0 Jun 18 17:06 manager.2021-01-29.log
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70/tomcat/temp' directory level:
                                                                                                                                                                                                                                                                    drwxr-x---. 4 alfresco Alfresco 12288 Jun 18 18:43 Alfresco
                                                                                                                                                                                                                                                                    drwxr-x---. 2 alfresco Alfresco 6 Jun 18 19:48 Alfresco-WebScripts
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 alfresco Alfresco 0 Jun 18 20:11 safeToDelete.tmp
                                                                                                                                                                                                                                                                    -rw-r-----. 1 alfresco Alfresco 5 Jun 18 18:42 tomcat.pid
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70/tomcat/webapps' directory level:
                                                                                                                                                                                                                                                                    drwxr-x---. 11 alfresco Alfresco 209 Jun 18 16:11 alfresco
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 root Alfresco 191675102 Jun 18 20:03 alfresco.war
                                                                                                                                                                                                                                                                    drwxr-x---. 6 alfresco Alfresco 119 Jun 18 19:49 ROOT
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 root Alfresco 275031 Jun 18 14:28 ROOT.war
                                                                                                                                                                                                                                                                    drwxr-x---. 16 alfresco Alfresco 4096 Jun 18 16:12 share
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 root Alfresco 76888634 Jun 18 20:03 share.war
                                                                                                                                                                                                                                                                    drwxr-x---. 4 alfresco Alfresco 54 Jun 18 19:49 _vti_bin
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 root Alfresco 762845 Jun 18 14:28 _vti_bin.war
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-community70/tomcat/work' directory level:
                                                                                                                                                                                                                                                                    drwxrwxr-x. 3 root Alfresco 23 Jun 25 20:56 Catalina


                                                                                                                                                                                                                                                                    Alfresco Search Services file/folder permissions example:

                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-search-services' directory level:
                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                    drwxr-xr-x. 3 solr solr   23 Jun 17 17:13 contentstore
                                                                                                                                                                                                                                                                    drwxr-xr-x. 4 solr Solr 72 Jun 17 16:21 licenses
                                                                                                                                                                                                                                                                    drwxrwxr-x. 3 solr Solr 4096 Jun 17 18:42 logs
                                                                                                                                                                                                                                                                    -rwxr-xr-x. 1 solr Solr 1328 Jun 17 16:21 README.MD
                                                                                                                                                                                                                                                                    drwxr-xr-x. 6 solr Solr 159 Jun 17 16:21 solr
                                                                                                                                                                                                                                                                    drwxrwxr-x. 7 solr Solr 104 Jun 17 17:13 solrhome
                                                                                                                                                                                                                                                                    -rwxr-xr-x. 1 solr Solr 6764 Jun 17 16:21 solr.in.cmd
                                                                                                                                                                                                                                                                    -rwxr-xr-x. 1 solr Solr 7520 Jun 18 16:40 solr.in.sh
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-search-services/logs' directory level: drwxr-xr-x. 2 solr Solr 54 Jun 17 18:42 archived
                                                                                                                                                                                                                                                                    -rwxr-xr-x. 1 solr Solr 1770 Jun 17 16:21 log4j.properties
                                                                                                                                                                                                                                                                    -rwxr-xr-x. 1 solr Solr 245 Jun 17 16:21 README.txt
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 solr Solr 1359 Jun 17 18:42 solr-8983-console.log
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 solr Solr 4130 Jun 17 18:45 solr_gc.log
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 solr Solr 2882 Jun 17 18:42 solr.log
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 solr Solr 30629 Jun 17 18:42 solr.log.1
                                                                                                                                                                                                                                                                    -rw-r--r--. 1 solr Solr 4871 Jun 17 18:29 solr.log.2
                                                                                                                                                                                                                                                                    Permissions at '/usr/local/alfresco-search-services/solrhome' directory level: drwxr-xr-x. 5 solr solr 79 Jun 17 17:13 alfresco
                                                                                                                                                                                                                                                                    drwxrwxr-x. 2 solr Solr 4096 Jun 17 17:13 alfrescoModels
                                                                                                                                                                                                                                                                    drwxr-xr-x. 5 solr solr 79 Jun 17 17:13 archive
                                                                                                                                                                                                                                                                    drwxrwxr-x. 2 solr Solr 93 Jun 17 16:35 conf
                                                                                                                                                                                                                                                                    -rwxrwxr-x. 1 solr Solr 151 Jun 17 16:21 solr.xml
                                                                                                                                                                                                                                                                    drwxrwxr-x. 4 solr Solr 36 Jun 17 16:21 templates



                                                                                                                                                                                                                                                                    Note: If you are planning to setup on any other OS other than CentOS, steps would pretty much the same. You would be using OS/distribution specific package manager instead of 'yum' for the most part. 


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