Friday, June 18, 2021

Setup ACS-7.0.0, ASS-2.0.1 and Local Transformation Service using distribution package step by step


In the previous blog posts, we tried setting up ACS 6.2.0-ga + ASS 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 pre-requisites to use local transformation service. 


You can take a look at the steps here

Now, from ACS 7.x onwards 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 setup ACS-7.0.0 + ASS-2.0.1 (latest stable version available) using distribution package with local transformation service.

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
  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 this documentation for additional details on Supported Platforms

Platform:

Type of deployment:

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

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


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

  • Download ACS-7.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.0.0 (Enterprise version) and ASS-2.0.1, 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.0  for this post hence we have to use ASS 2.0.1 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-rc/javascript-console-repo-0.7.amp

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


Now, we have 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
                                                                                                                                                                                                      <Connector port="8080" protocol="HTTP/1.1"
                                                                                                                                                                                                       URIEncoding="UTF-8" connectionTimeout="20000"
                                                                                                                                                                                                       maxHttpHeaderSize="32768"
                                                                                                                                                                                                       redirectPort="8443" />

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

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

                                                                                                                                                                                                      See here for more details: 

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

                                                                                                                                                                                                        $ 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.sh  
                                                                                                                                                                                                        $ 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] ##############

                                                                                                                                                                                                        • 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


                                                                                                                                                                                                                        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
                                                                                                                                                                                                                        



                                                                                                                                                                                                                        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




                                                                                                                                                                                                                        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

                                                                                                                                                                                                                         

                                                                                                                                                                                                                        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: fme Javascript Console Repository Extension - Version: 0.7.2106071737 - 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: fme Javascript Console Share Extension - Version: 0.7.2106071738 - 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
                                                                                                                                                                                                                                                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. 
                                                                                                                                                                                                                                                • 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. 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
                                                                                                                                                                                                                                                SOLR_ALFRESCO_SECURECOMMS=none
                                                                                                                                                                                                                                                • 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

                                                                                                                                                                                                                                                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:



                                                                                                                                                                                                                                                    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
                                                                                                                                                                                                                                                    solr.secureComms=none
                                                                                                                                                                                                                                                    solr.base.url=/solr
                                                                                                                                                                                                                                                    index.subsystem.name=solr6
                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    ### FTP Server Configuration ###
                                                                                                                                                                                                                                                    ftp.port=2121
                                                                                                                                                                                                                                                    ftp.enabled=true
                                                                                                                                                                                                                                                    ftp.server.enables=true
                                                                                                                                                                                                                                                    

                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                    #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
                                                                                                                                                                                                                                                    SOLR_ALFRESCO_SECURECOMMS=none


                                                                                                                                                                                                                                                    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:


                                                                                                                                                                                                                                                              Alfresco released ACS7.1.x, if you want to setup ACS7.1.x community, then download the available versions from below download locations. All the steps outlined above would be same.


                                                                                                                                                                                                                                                              • Download ACS-7.1.x community:
                                                                                                                                                                                                                                                              ACS 7.1.0.1 Community
                                                                                                                                                                                                                                                              • Download ASS-2.0.2:
                                                                                                                                                                                                                                                              ASS 2.0.2

                                                                                                                                                                                                                                                               

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



                                                                                                                                                                                                                                                              References:






                                                                                                                                                                                                                                                              22 comments:

                                                                                                                                                                                                                                                              1. Very nice and detailed blog to setting up new latest version of alfresco env. every step explained well with clear instruction. Thanks @Abhinav for sharing. Keep good work up.

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                              2. This is a real, complete, concise and professional installation guide. THANK YOU SO MUCH for your time and effort putting together so detailed manual. This page should be at the Alfresco website! I already bookmarked your blog as my new Alfresco Reference Installation Guide. It helped me with some installation issues (because the changes in the new version). Best regards!

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. Thanks @Calichon, I appreciate it. Glad to hear that post was helpful.

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                              3. Thanks Abhinav, The instructions are very clear and helpful.

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                              4. Is it available for Ubuntu? Thanks.

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. For this post I used centos, but steps should be pretty much the same. Instead of using yum you would be using apt-get.

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                              5. Thank you very much for all your effort, i finally install a distribution ZIP !
                                                                                                                                                                                                                                                                I had to add some debug, i you're interested to update, here is what i change :
                                                                                                                                                                                                                                                                sudo vim /etc/systemd/system/activemq.service
                                                                                                                                                                                                                                                                WorkingDirectory=~/usr/local/alfresco-community70/activemq/data
                                                                                                                                                                                                                                                                i had to remove ~
                                                                                                                                                                                                                                                                WorkingDirectory=/usr/local/alfresco-community70/activemq/data

                                                                                                                                                                                                                                                                i had an error with this command
                                                                                                                                                                                                                                                                sudo -u solr $SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
                                                                                                                                                                                                                                                                it didn't find the solr.xml

                                                                                                                                                                                                                                                                I had to add the SOLRHOME directory
                                                                                                                                                                                                                                                                sudo vim /usr/local/alfresco-search-services/solr.in.sh
                                                                                                                                                                                                                                                                SOLR_HOME=/usr/local/alfresco-search-services/solrhome/

                                                                                                                                                                                                                                                                To finish, i had alfresco.log and share.log error on catalina.out
                                                                                                                                                                                                                                                                i had to change those files
                                                                                                                                                                                                                                                                cd /usr/local/alfresco-community70/
                                                                                                                                                                                                                                                                grep -R 'log4j.appender.File.File=' ./
                                                                                                                                                                                                                                                                ./tomcat/webapps/share/WEB-INF/classes/log4j.properties:log4j.appender.File.File=share.log
                                                                                                                                                                                                                                                                ./tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties:log4j.appender.File.File=alfresco.log
                                                                                                                                                                                                                                                                and i changed the log4j.appender.File.File on both file to these
                                                                                                                                                                                                                                                                ./tomcat/webapps/share/WEB-INF/classes/log4j.properties:log4j.appender.File.File=logs/share.log
                                                                                                                                                                                                                                                                ./tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties:log4j.appender.File.File=logs/alfresco.log


                                                                                                                                                                                                                                                                By default, the alfresco.war and share.war try to write on tomcat folder (but we need to be root for it)
                                                                                                                                                                                                                                                                So now i have alfresco.log and share.log here
                                                                                                                                                                                                                                                                /usr/local/alfresco-community70/tomcat/logs/alfresco

                                                                                                                                                                                                                                                                Again thank you very much it's perfect like this i can now try to go on https for solr and share.

                                                                                                                                                                                                                                                                P.S : I love you !

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. Hi thanks for suggestions, I really appreciate it. I am glad that these steps were helpful.

                                                                                                                                                                                                                                                                  May i know what was the error you were getting so you had to remove "~" from activemq.service ->
                                                                                                                                                                                                                                                                  WorkingDirectory=~/usr/local/alfresco-community70/activemq/data

                                                                                                                                                                                                                                                                  So i can also test and fix the steps.

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                              6. This is the most detail instruction I can find. Thank you. But I am still have question.

                                                                                                                                                                                                                                                                I am tasked to install an enterprise edition on a server. I login as myself (with sudo enabled), creating accounts 'alfresco', 'solo' per your instruction. When it comes to setting ALF_HOME, SOLR_HOME, JAVA_HOME environment variable to '.bash_profile' file, which user's .bash_profile ? ALF_HOME to '.bash_profile' of user 'alfresco' ? And SOLR_HOME to user 'soar' ? Or ALF_HOME, SOLR_HOME, JAVA_HOME environment variables to both user 'alfresco' and user 'solr' ?

                                                                                                                                                                                                                                                                You create group name 'Alfresco', 'Solr'. My system already has group name 'alfresco' and 'solr' (lower case). Does case of group names matter?

                                                                                                                                                                                                                                                                Also, do you have or plan to make an equivalent version using Ansible?

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. '.bash_profile' of the user which will be starting up the services manually. Checkout the notes:

                                                                                                                                                                                                                                                                  "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. This is needed if you are planning to use the scripts given here: https://javaworld-abhinav.blogspot.com/2021/06/setup-acs70-ass201-and-transformation-service.html#start-stop-test "

                                                                                                                                                                                                                                                                  If you are planning to setup system service for all services then the updates are not required.

                                                                                                                                                                                                                                                                  Group name casing doesn't matter as long as you have reference the users and system services to use that. Check all the instances where group is used in system services and permissioning and use accordingly.


                                                                                                                                                                                                                                                                  Alfresco already has ansible based deployment option for both enterprise and community, checkout here:

                                                                                                                                                                                                                                                                  https://docs.alfresco.com/content-services/community/install/ansible/
                                                                                                                                                                                                                                                                  https://docs.alfresco.com/content-services/latest/install/ansible/

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                              7. Hello @Abhinav Kumar Mishra

                                                                                                                                                                                                                                                                Thank you very much for this guide, it is super detailed and helps you to perform the installation and configuration correctly for me the best guide I found on the internet. Just 2 little things to see if you can help me. I need to configure a NFS server to install the data directory and make a cross server. Then the files are saved in .bin format but the idea we have is that it is saved with the original format that would be possible is more than everything if the servers are down to search for them by the nfs.

                                                                                                                                                                                                                                                                Greetings

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                              8. I would rather suggest to use S3 as contentstore. Checkout this community project: https://github.com/Redpill-Linpro/alfresco-s3-adapter

                                                                                                                                                                                                                                                                If you are using enterprise version, check this documentation: https://docs.alfresco.com/aws-s3/4.0/

                                                                                                                                                                                                                                                                You can't change how alfresco store the files in contentstore, under the hood there are a lot of code and configurations that depend on this format. If you were to change, it would require a lot of customizations. So the simple answer to this is "no dont do that".

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                              9. Hello,

                                                                                                                                                                                                                                                                Only one piece of information should be added secretRequired=false because its default value is true as long as it is on a trusted network.



                                                                                                                                                                                                                                                                Regards

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. Hi @Juancho, Can you provide more details as to where and why we need to add "secretRequired=false"? What happens if the value is not set if you have faced any issue?

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                                2. I assume you are trying to setup proxy web server. Since we are not setting up reverse proxy for this post, it is not required. However, if someone is setting the proxy webserver then your info will be helpful. Here is another reference: https://stackoverflow.com/questions/60552873/tomcat-8-5-51-issues-with-secretrequired-false

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                              10. That's a rare piece of work. So much in detail and well structure. Many congrats.

                                                                                                                                                                                                                                                                One issue faced when I run following command to Start LocalTransformationService
                                                                                                                                                                                                                                                                ===================================================
                                                                                                                                                                                                                                                                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-Q16/coders" -DIMAGEMAGICK_CONFIG="/usr/local/alfresco-community70/imagemagick/config-Q16" -DACTIVEMQ_URL="failover:(tcp://localhost:61616)?timeout=3000" -jar /usr/local/alfresco-community70/bin/alfresco-transform-core-aio-boot-2.4.0.jar
                                                                                                                                                                                                                                                                ===================================================

                                                                                                                                                                                                                                                                I get following error:
                                                                                                                                                                                                                                                                2021-11-13 17:38:14.530 INFO 13941 --- [ main] o.a.j.office.ProcessPoolOfficeManager : ProcessManager implementation is LinuxProcessManager
                                                                                                                                                                                                                                                                2021-11-13 17:38:14.859 ERROR 13941 --- [ main] o.a.t.e.JodConverterSharedInstance : Unable to start JodConverter library. The following error is shown for informational purposes only.

                                                                                                                                                                                                                                                                org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
                                                                                                                                                                                                                                                                at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:62) ~[alfresco-jodconverter-core-3.0.1.12.jar!/:3.0.1.12]
                                                                                                                                                                                                                                                                at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:96) ~[alfresco-jodconverter-core-3.0.1.12.jar!/:3.0.1.12]
                                                                                                                                                                                                                                                                ....

                                                                                                                                                                                                                                                                ===================================================

                                                                                                                                                                                                                                                                Note that by default ImageMagick 6.9.10-68 Q16 x86_64 2021-10-14 installed on my system.And the folder name "modules-Q16" and "config-Q16" in the command I am running are also right as per my setup.

                                                                                                                                                                                                                                                                ReplyDelete
                                                                                                                                                                                                                                                                Replies
                                                                                                                                                                                                                                                                1. If you notice the error:

                                                                                                                                                                                                                                                                  -------------------------------------------------------------------------------------------------
                                                                                                                                                                                                                                                                  - [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : profile dir '/tmp/.jodconverter_socket_host-127.0.0.1_port-8100' already exists; deleting
                                                                                                                                                                                                                                                                  2021-11-14 12:45:06.793 ERROR 7371 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : could not delete profileDir: Failed to list contents of /tmp/.jodconverter_socket_host-127.0.0.1_port-8100
                                                                                                                                                                                                                                                                  2021-11-14 12:45:06.793 INFO 7371 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : Using original OpenOffice command: [/usr/local/alfresco-community70/libreoffice/program/soffice.bin, -accept=socket,host=127.0.0.1,port=8100;urp;, -env:UserInstallation=file:///tmp/.jodconverter_socket_host-127.0.0.1_port-8100, -headless, -nocrashreport, -nodefault, -nofirststartwizard, -nolockcheck, -nologo, -norestore]
                                                                                                                                                                                                                                                                  2021-11-14 12:45:06.794 INFO 7371 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : starting process with acceptString 'socket,host=127.0.0.1,port=8100,tcpNoDelay=1' and profileDir '/tmp/.jodconverter_socket_host-127.0.0.1_port-8100'
                                                                                                                                                                                                                                                                  2021-11-14 12:45:06.883 INFO 7371 --- [ProcessThread-0] o.a.jodconverter.office.OfficeProcess : started process; pid = 7413
                                                                                                                                                                                                                                                                  2021-11-14 12:45:08.283 ERROR 7371 --- [ main] o.a.t.e.JodConverterSharedInstance : Unable to start JodConverter library. The following error is shown for informational purposes only.
                                                                                                                                                                                                                                                                  org.artofsolving.jodconverter.office.OfficeException: failed to start and connect

                                                                                                                                                                                                                                                                  -----------------------------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                  It seems a jodconvertor instance is already running on port 8100 on your vm and when you start the tr service, it also tried to start another instance on same port. Try killing any existing processes running on 8100.

                                                                                                                                                                                                                                                                  Note that the versions you have mentioned for Imagemagick and Libreoffice is not something tested.


                                                                                                                                                                                                                                                                  ImageMagick v7.0.1 - https://javaworld-abhinav.blogspot.com/2021/06/setup-acs70-ass201-and-transformation-service.html#download-imagemagick
                                                                                                                                                                                                                                                                  LibreOffice v6.3.5 - https://javaworld-abhinav.blogspot.com/2021/06/setup-acs70-ass201-and-transformation-service.html#download-libreoffice


                                                                                                                                                                                                                                                                  Check the support platform documentation here. I would recommend to use what is documented in supported platform official docs.

                                                                                                                                                                                                                                                                  Delete
                                                                                                                                                                                                                                                                2. Thanks, i am glad you found the steps helpful.

                                                                                                                                                                                                                                                                  Delete

                                                                                                                                                                                                                                                              Thanks for your comments/Suggestions.