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: