From 5e42a0e6badeddb758b5124bd2c1baa97ae1c865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakov=20M=2E=20Ve=C5=BEi=C4=87?= Date: Thu, 23 Sep 2021 17:08:57 +0200 Subject: [PATCH] Modernized and updated the "Manual installation" section (#1879) * Modernized and updated the "Manual installation" section - PHP 7.2 to PHP 7.4 - Explained bash "whoami" a bit better - PostgreSQL 10 to 11 - Explained the postgresql.conf change a bit better - UTF8 PostgreSQL databases - Composer 1 to Composer 2 - Drush 9 to Drush 10 - Drupal 8 to Drupal 9 - Change ownership of /var/www directory for Composer - Clone original drupal-project git repo instead of Islandora outdated one - run project:9.x-dev instead of 8.x-dev - Explained Apache conf a bit better - Tomcat 8 to Tomcat 9 - Cantaloupe 4 to Cantaloupe 5 - OpenJDK 8 to OpenJDK 11 - Install Cantaloupe as a service and standalone jar (no longer in Tomcat as a .war) - Fedora 5 to Fedora 6 - Updated Tomcat setenv script - Explained the Fedora errors when Syn valve is installed - Solr 8.3 to Solr 8.9 - Search API solr 3.0 to 4.2 - Explained Solr a bit more - Crayfish 1.1 to 2.0 - Removed Gemini (obsolete) - Added Karaf users.properties config - Equalize Karaf apt version with features version - Made it easier to copy Drupal config change * fix karaf feature versions; restore feature install Co-authored-by: Seth Shaw --- .../installation/manual/configuring_drupal.md | 42 ++++------ .../installing_composer_drush_and_drupal.md | 26 +++--- .../manual/installing_crayfish.md | 75 ++--------------- .../installing_fedora_syn_and_blazegraph.md | 51 +++++++---- .../manual/installing_karaf_and_alpaca.md | 44 ++++++++-- docs/installation/manual/installing_solr.md | 57 +++++++++---- .../installing_tomcat_and_cantaloupe.md | 84 ++++++++++--------- .../manual/preparing_a_webserver.md | 36 +++++--- 8 files changed, 223 insertions(+), 192 deletions(-) diff --git a/docs/installation/manual/configuring_drupal.md b/docs/installation/manual/configuring_drupal.md index 70fa5f514..6b414bcbc 100644 --- a/docs/installation/manual/configuring_drupal.md +++ b/docs/installation/manual/configuring_drupal.md @@ -21,31 +21,23 @@ The below configuration will establish `localhost` as a trusted host pattern, bu > 790 | ); **After**: -> 789 | 'driver' => 'pgsql', - -> 790 | ); - -> 791 | $settings['trusted_host_patterns'] = [ - -> 792 | 'localhost', - -> 793 | ]; - -> 794 | $settings['flysystem'] = [ - -> 795 | 'fedora' => [ - -> 796 | 'driver' => 'fedora', - -> 797 | 'config' => [ - -> 798 | 'root' => 'http://localhost:8080/fcrepo/rest/', - -> 799 | ], - -> 800 | ], - -> 801 | ]; +``` +'driver' => 'pgsql', +); + +$settings['trusted_host_patterns'] = [ + 'localhost', +]; + +$settings['flysystem'] = [ + 'fedora' => [ + 'driver' => 'fedora', + 'config' => [ + 'root' => 'http://localhost:8080/fcrepo/rest/', + ], +], +]; +``` Once this is done, refresh the cache to take hold of the new settings. diff --git a/docs/installation/manual/installing_composer_drush_and_drupal.md b/docs/installation/manual/installing_composer_drush_and_drupal.md index ee457165c..f73695956 100644 --- a/docs/installation/manual/installing_composer_drush_and_drupal.md +++ b/docs/installation/manual/installing_composer_drush_and_drupal.md @@ -4,10 +4,10 @@ - [Composer](https://getcomposer.org/) at its current latest version, the package manager that will allow us to install PHP applications - The Islandora fork of the composer installer from [drupal-composer/drupal-project](https://github.com/Islandora/drupal-project), which will install, among other things: - - [Drush 9](https://www.drush.org/) at its latest version, the command-line PHP application for running tasks in Drupal - - [Drupal 8](https://www.drupal.org/) at its latest version, the content management system Islandora uses for content modelling and front-end display + - [Drush 10](https://www.drush.org/) at its latest version, the command-line PHP application for running tasks in Drupal + - [Drupal 9](https://www.drupal.org/) at its latest version, the content management system Islandora uses for content modelling and front-end display -## Composer 1.x +## Composer 2.x ### Download and install Composer @@ -20,9 +20,9 @@ php composer-install.php sudo mv composer.phar /usr/local/bin/composer ``` -## Drush 9 and Drupal 8 +## Drush 10 and Drupal 9 -### Clone `drupal-project` and run `composer install` +### Clone `drupal-project` and install it via Composer Before we can fully install Drupal, we’re going to need to clone `drupal-project` and provision it using Composer. We’re going to install it into the `/opt` directory: @@ -32,12 +32,14 @@ Before we can fully install Drupal, we’re going to need to clone `drupal-proje sudo mkdir /opt/drupal sudo chown www-data:www-data /opt/drupal sudo chmod 775 /opt/drupal +# Change the ownership of default Apache directory so Composer can access it +sudo chown -R www-data:www-data /var/www/ # Clone drupal-project and build it in our newly-created folder. -git clone https://github.com/Islandora/drupal-project.git +git clone https://github.com/drupal-composer/drupal-project.git cd drupal-project # Expect this to take a little while, as this is grabbing the entire # requirements set for Drupal. -sudo -u www-data composer create-project drupal-composer/drupal-project:8.x-dev /opt/drupal --no-interaction +sudo -u www-data composer create-project drupal-composer/drupal-project:9.x-dev /opt/drupal --no-interaction ``` ### Make Drush accessible in `$PATH` @@ -60,6 +62,8 @@ Before we can proceed with the actual site installation, we’re going to need t Listen 80 ``` +Remove everything but the "Listen 80" line. You can leave the comments in if you want. + `/etc/apache2/sites-enabled/000-default.conf | root:root/777` ```xml @@ -76,7 +80,7 @@ Listen 80 ``` - `SERVER_NAME`: `localhost` - - For a development environment hosted on your own machine or a VM, `localhost` should suffice. Realistically, this should be the domain the server will be accessed at. + - For a development environment hosted on your own machine or a VM, `localhost` should suffice. Realistically, this should be the domain or IP address the server will be accessed at. Restart the Apache 2 service to apply these changes: @@ -93,13 +97,13 @@ PostgreSQL roles are directly tied to users. We’re going to ensure a user is i # access. sudo -u postgres psql # Then, run these commands within psql itself: -create database DRUPAL_DB; +create database DRUPAL_DB encoding 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' TEMPLATE template0; create user DRUPAL_DB_USER with encrypted password 'DRUPAL_DB_PASSWORD'; grant all privileges on database DRUPAL_DB to DRUPAL_DB_USER; # Then, quit psql. \q ``` -- `DRUPAL_DB`: `drupal8` +- `DRUPAL_DB`: `drupal9` - This will be used as the core database that Drupal is installed into - `DRUPAL_DB_USER`: `drupal` - Specifically, this is the user that will connect to the PostgreSQL database being created, not the user that will be logging into Drupal @@ -118,7 +122,7 @@ drush -y site-install standard --db-url="pgsql://DRUPAL_DB_USER:DRUPAL_DB_PASSWO ``` This uses the same parameters from the above step, as well as: -- `SITE_NAME`: Islandora 8 +- `SITE_NAME`: Islandora 2.0 - This is arbitrary, and is simply used to title the site on the home page - `DRUPAL_LOGIN`: `islandora` - The Drupal administrative username to use diff --git a/docs/installation/manual/installing_crayfish.md b/docs/installation/manual/installing_crayfish.md index 7a2a41bfb..15c1ccf14 100644 --- a/docs/installation/manual/installing_crayfish.md +++ b/docs/installation/manual/installing_crayfish.md @@ -1,10 +1,10 @@ # Installing Crayfish ## In this section, we will install: -- [Islandora/Crayfish](https://github.com/islandora/crayfish), the suite of microservices that power the backend of Islandora 8 +- [Islandora/Crayfish](https://github.com/islandora/crayfish), the suite of microservices that power the backend of Islandora 2.0 - Indvidual microservices underneath Crayfish -## Crayfish 1.1 +## Crayfish 2.0 ### Installing Prerequisites @@ -21,21 +21,7 @@ sudo apt-get update sudo apt-get -y install imagemagick tesseract-ocr ffmpeg poppler-utils ``` -### Preparing a Gemini Database - -This database will be set up (and function) mostly the same as the other databases we’ve previously installed. - -```bash -sudo -u postgres psql -create database CRAYFISH_DB; -create user CRAYFISH_DB_USER with encrypted password 'CRAYFISH_DB_PASSWORD'; -grant all privileges on database CRAYFISH_DB to CRAYFISH_DB_USER; -\q -``` -- `CRAYFISH_DB`: `gemini` -- `CRAYFISH_DB_USER`: `gemini` -- `CRAYFISH_DB_PASSWORD`: `gemini` - - As always, this should be a secure password of some kind, and not this default. +**NOTICE:** If you get the `sudo: apt-add-repository: command not found`, run `sudo apt-get install software-properties-common` in order to make the command available. ### Cloning and Installing Crayfish @@ -45,7 +31,6 @@ We’re going to clone Crayfish to `/opt`, and individually run `composer instal cd /opt sudo git clone https://github.com/Islandora/Crayfish.git crayfish sudo chown -R www-data:www-data crayfish -sudo -u www-data composer install -d crayfish/Gemini sudo -u www-data composer install -d crayfish/Homarus sudo -u www-data composer install -d crayfish/Houdini sudo -u www-data composer install -d crayfish/Hypercube @@ -66,31 +51,9 @@ sudo chown www-data:www-data /var/log/islandora Each Crayfish component requires one or more `.yaml` file(s) to ensure everything is wired up correctly. -!!! notice - The following configuration files represent somewhat sensible defaults; you should take consideration of the logging levels in use, as this can vary in desirability from installation to installation. Also note that in all cases, `http` URLs are being used, as this guide does not deal with setting up https support. In a production installation, this should not be the case. These files also assume a connection to a PostgreSQL database; use a `pdo_mysql` driver and the appropriate `3306` port if using MySQL. - +**NOTICE** -#### Gemini - -`/opt/crayfish/Gemini/cfg/config.yaml | www-data:www-data/644` -```yaml ---- -debug: false -fedora_base_url: http://localhost:8080/fcrepo/rest -db.options: - driver: pdo_pgsql - host: 127.0.0.1 - port: 5432 - dbname: CRAYFISH_DB - user: CRAYFISH_DB_USER - password: CRAYFISH_DB_PASSWORD -log: - level: NOTICE - file: /var/log/islandora/gemini.log -syn: - enable: true - config: /opt/fcrepo/config/syn-settings.xml -``` +The following configuration files represent somewhat sensible defaults; you should take consideration of the logging levels in use, as this can vary in desirability from installation to installation. Also note that in all cases, `http` URLs are being used, as this guide does not deal with setting up https support. In a production installation, this should not be the case. These files also assume a connection to a PostgreSQL database; use a `pdo_mysql` driver and the appropriate `3306` port if using MySQL. #### Homarus (Audio/Video derivatives) @@ -180,7 +143,6 @@ services: ```yaml crayfish_commons: fedora_base_uri: 'http://localhost:8080/fcrepo/rest' - gemini_base_uri: 'http://localhost:9000/gemini' syn_config: '/opt/fcrepo/config/syn-settings.xml' ``` @@ -282,7 +244,6 @@ syn: --- fedora_base_url: http://localhost:8080/fcrepo/rest drupal_base_url: http://localhost -gemini_base_url: http://localhost/gemini modified_date_predicate: http://schema.org/dateModified strip_format_jsonld: true debug: false @@ -308,7 +269,6 @@ syn: --- fedora_resource: base_url: http://localhost:8080/fcrepo/rest -gemini_base_url: http://localhost/gemini drupal_base_url: http://localhost debug: false log: @@ -329,34 +289,15 @@ namespaces: vcard: "http://www.w3.org/2006/vcard/ns#" ``` -### Installing the Gemini Database - -Our Gemini database is unusable until it's installed. - -```bash -cd /opt/crayfish/Gemini -php bin/console --no-interaction migrations:migrate -``` - ### Creating Apache Configurations for Crayfish Components Finally, we need appropriate Apache configurations for Crayfish; these will allow other services to connect to Crayfish components via their HTTP endpoints. Each endpoint we need to be able to connect to will get its own `.conf` file, which we will then enable. -!!! notice - These configurations would potentially have collisions with Drupal routes, if any are created in Drupal with the same name. If this is a concern, it would likely be better to reserve a subdomain or another port specifically for Crayfish. For the purposes of this installation guide, these endpoints will suffice. +**NOTICE** -`/etc/apache2/conf-available/Gemini.conf | root:root/644` -``` -Alias "/gemini" "/opt/crayfish/Gemini/src" - - FallbackResource /gemini/index.php - Require all granted - DirectoryIndex index.php - SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 - -``` +These configurations would potentially have collisions with Drupal routes, if any are created in Drupal with the same name. If this is a concern, it would likely be better to reserve a subdomain or another port specifically for Crayfish. For the purposes of this installation guide, these endpoints will suffice. `/etc/apache2/conf-available/Homarus.conf | root:root/644` ``` @@ -418,7 +359,7 @@ Alias "/recast" "/opt/crayfish/Recast/src" Enabling each of these configurations involves creating a symlink to them in the `conf-enabled` directory; the standardized method of doing this in Apache is with `a2enconf`. ```bash -sudo a2enconf Gemini Homarus Houdini Hypercube Milliner Recast +sudo a2enconf Homarus Houdini Hypercube Milliner Recast ``` ### Restarting the Apache Service diff --git a/docs/installation/manual/installing_fedora_syn_and_blazegraph.md b/docs/installation/manual/installing_fedora_syn_and_blazegraph.md index 4085b3897..9324a19a5 100644 --- a/docs/installation/manual/installing_fedora_syn_and_blazegraph.md +++ b/docs/installation/manual/installing_fedora_syn_and_blazegraph.md @@ -2,11 +2,19 @@ ## In this section, we will install: -- [Fedora 5](https://duraspace.org/fedora/), the back-end repository that Islandora will use +- [Fedora 6](https://duraspace.org/fedora/), the back-end repository that Islandora will use - [Syn](https://github.com/Islandora/Syn), the authentication broker that will manage communication with Fedora - [Blazegraph](https://blazegraph.com/), the resource index layer on top of Fedora for managing discoverability via RDF -## Fedora 5 +## Fedora 6 + +### Stop the Tomcat Service + +We're going to stop the Tomcat service while working on setting up Fedora to prevent any autodeploy misconfigurations. + +```bash +sudo systemctl stop tomcat +``` ### Creating a Working Space for Fedora @@ -24,7 +32,7 @@ The method for creating the database here will closely mimic the method we used ```bash sudo -u postgres psql -create database FEDORA_DB; +create database FEDORA_DB encoding 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' TEMPLATE template0; create user FEDORA_DB_USER with encrypted password 'FEDORA_DB_PASSWORD'; grant all privileges on database FEDORA_DB to FEDORA_DB_USER; \q @@ -82,10 +90,11 @@ We intend to have Crayfish installed later. Since Fedora needs to be able to rea `/opt/fcrepo/config/allowed_hosts.txt | tomcat:tomcat/644` ``` -http://localhost:CRAYFISH_PORT/ +http://CRAYFISH_HOST:CRAYFISH_PORT/ ``` +- `CRAYFISH_HOST`: localhost - `CRAYFISH_PORT`: 80 - - This guide will install Crayfish on the same port that Drupal is installed on. This may not be desirable, and if Crayfish is installed on a different port later, that change should be reflected here. + - This guide will install Crayfish on the same host and port that Drupal is installed on. This may not be desirable, and if Crayfish is installed on a different host or port later, that change should be reflected here. The next part of the configuration defines where the pieces of the actual repository will live. Note that this file contains some of the defined `FEDORA_DB` variables from earlier. @@ -233,10 +242,10 @@ We need our Tomcat `JAVA_OPTS` to include references to our repository configura `/opt/tomcat/bin/setenv.sh` **Before**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -server -Xmx1500m -Xms1000m" +> 3 | export JAVA_OPTS="-Djava.awt.headless=true -server -Xmx1500m -Xms1000m" **After**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -Dfcrepo.modeshape.configuration=file:///opt/fcrepo/config/repository.json -Dfcrepo.home=/opt/fcrepo/data -Dfcrepo.spring.configuration=file:///opt/fcrepo/config/fcrepo-config.xml -server -Xmx1500m -Xms1000m" +> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dfcrepo.home=/otp/fcrepo/data -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log -Dfcrepo.jms.baseUrl=http://localhost:8080/fcrepo/rest -Dfcrepo.autoversioning.enabled=false -DconnectionTimeout=-1 -Dfcrepo.db.url=jdbc:postgresql://localhost:5432/fcrepo -Dfcrepo.db.user=fedora -Dfcrepo.db.password=fedora -server -Xmx1500m -Xms1000m" ### Ensuring Tomcat Users Are In Place @@ -263,25 +272,29 @@ While not strictly necessary, we can use the `tomcat-users.xml` file to give us ### Downloading and Placing the Latest Release -Fedora `.war` files are packaged up as releases on the official GitHub repository; you can find the latest version at the releases page; the official GitHub repository is labelled as fcrepo4 but does actually contain more recent versions than 4. You should download the most recent stable release. +Fedora `.war` files are packaged up as releases on the official GitHub repository. You should download the most recent stable release. ```bash sudo wget -O fcrepo.war FCREPO_WAR_URL sudo mv fcrepo.war /opt/tomcat/webapps sudo chown tomcat:tomcat /opt/tomcat/webapps/fcrepo.war ``` -- `FCREPO_WAR_URL`: This can be found at the [fcrepo downloads page](https://github.com/fcrepo4/fcrepo4/releases); the file you're looking for is: +- `FCREPO_WAR_URL`: This can be found at the [fcrepo downloads page](https://github.com/fcrepo/fcrepo/releases); the file you're looking for is: - Tagged in green as the 'Latest release' - - The `.war` version of the file + - Named "fcrepo-webapp-VERSION.war" -### Restarting the Tomcat Service +### Start the Tomcat Service -As before, restart the Tomcat service to get Fedora up and running. +As before, start the Tomcat service to get Fedora up and running. ```bash -sudo systemctl restart tomcat +sudo systemctl start tomcat ``` +**Note:** sometimes it takes a while for Fedora and Tomcat to start up, usually it shouldn't take longer than 5 minutes. + +Once it starts up, Fedora REST API should be available at http://localhost:8080/fcrepo/rest. The username is fedoraAdmin and we defined the password before as `FEDORA_ADMIN_PASSWORD` (default: "islandora"). + ## Syn ### Downloading the Syn JAR File @@ -347,6 +360,10 @@ Finally, restart tomcat to apply the new configurations. sudo systemctl restart tomcat ``` +**Note:** sometimes it takes a while for Fedora and Tomcat to start up, usually it shouldn't take longer than 5 minutes. + +**Note:** after installing the Syn valve, you'll no longer be able to manually manage objects via Fedora Web UI or access the Fedora home page (http://localhost:8080/fcrepo). All communication with Fedora will now be handled from the Islandora module in Drupal. + ## Blazegraph 2 ### Creating a Working Space for Blazegraph @@ -435,7 +452,7 @@ com.bigdata.journal.Journal.collectPlatformStatistics=false `/opt/blazegraph/conf/blazegraph.properties | tomcat:tomcat/644` ``` -com.bigdata.rdf.store.AbstractTripleStore.textIndex=false +com.bigdata.rdf.store.AbstractTripleStore.textIndex=false com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.OwlAxioms com.bigdata.rdf.sail.isolatableIndices=false com.bigdata.rdf.store.AbstractTripleStore.justify=true @@ -462,10 +479,12 @@ In order to enable our configuration when Tomcat starts, we need to reference th `/opt/tomcat/bin/setenv.sh` **Before**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -Dfcrepo.modeshape.configuration=file:///opt/fcrepo/config/repository.json -Dfcrepo.home=/opt/fcrepo/data -Dfcrepo.spring.configuration=file:///opt/fcrepo/config/fcrepo-config.xml -server -Xmx1500m -Xms1000m" +> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dfcrepo.home=/otp/fcrepo/data -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log -Dfcrepo.jms.baseUrl=http://localhost:8080/fcrepo/rest -Dfcrepo.autoversioning.enabled=false -DconnectionTimeout=-1 -Dfcrepo.db.url=jdbc:postgresql://localhost:5432/fcrepo -Dfcrepo.db.user=fedora -Dfcrepo.db.password=fedora -server -Xmx1500m -Xms1000m" + **After**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -Dfcrepo.modeshape.configuration=file:///opt/fcrepo/config/repository.json -Dfcrepo.home=/opt/fcrepo/data -Dfcrepo.spring.configuration=file:///opt/fcrepo/config/fcrepo-config.xml -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=/opt/blazegraph/conf/RWStore.properties -Dlog4j.configuration=file:/opt/blazegraph/conf/log4j.properties -server -Xmx1500m -Xms1000m" +> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dfcrepo.home=/otp/fcrepo/data -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log -Dfcrepo.jms.baseUrl=http://localhost:8080/fcrepo/rest -Dfcrepo.autoversioning.enabled=false -DconnectionTimeout=-1 -Dfcrepo.db.url=jdbc:postgresql://localhost:5432/fcrepo -Dfcrepo.db.user=fedora -Dfcrepo.db.password=fedora -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=/opt/blazegraph/conf/RWStore.properties -Dlog4j.configuration=file:/opt/blazegraph/conf/log4j.properties -server -Xmx1500m -Xms1000m" + ### Restarting Tomcat diff --git a/docs/installation/manual/installing_karaf_and_alpaca.md b/docs/installation/manual/installing_karaf_and_alpaca.md index 99e39f38d..b3e0f0308 100644 --- a/docs/installation/manual/installing_karaf_and_alpaca.md +++ b/docs/installation/manual/installing_karaf_and_alpaca.md @@ -24,6 +24,14 @@ This will give us: - An `activemq` service that will be run on boot - A user, `activemq`, who will be in charge of the ActiveMQ service +Take note of the version of ActiveMQ we're going to be installing. It needs to match a Karaf blueprint we'll create later. Check the version with + +```bash +sudo apt-cache policy activemq +``` + +Write down the version listed under `Installed: `. + ## Karaf 4 ## Creating a Karaf User @@ -107,12 +115,26 @@ Similar to Tomcat, our Karaf service is going to rely on a `setenv` shell script #!/bin/sh export JAVA_HOME="PATH_TO_JAVA_HOME" ``` -- `PATH_TO_JAVA_HOME`: This will be the same `JAVA_HOME` we used when installing Tomcat , and can be found using the same method (i.e., still `/usr/lib/jvm/java-8-openjdk-amd64` if that's what it was before). +- `PATH_TO_JAVA_HOME`: This will be the same `JAVA_HOME` we used when installing Tomcat , and can be found using the same method (i.e., still `/usr/lib/jvm/java-11-openjdk-amd64` if that's what it was before). ### Initializing Karaf We’re going to start Karaf, then run the installer to put our configurations in place and generate a Karaf service. Once these are installed, we’re going to stop Karaf, as from there on out its start/stop management should be handled via that service. +First we need to enable the default Karaf user in `/opt/karaf/etc/users.properties`: + +**Before**: +> 32 | # karaf = karaf,\_g\_:admingroup + +> 33 | # \_g\_\\:admingroup = group,admin,manager,viewer,systembundles,ssh + +**After**: +> 32 | karaf = karaf,\_g\_:admingroup + +> 33 | \_g\_\\:admingroup = group,admin,manager,viewer,systembundles,ssh + +Save the file and close it, then: + ```bash sudo -u karaf /opt/karaf/bin/start # You may want to wait a bit for Karaf to start. @@ -126,13 +148,21 @@ sudo -u karaf /opt/karaf/bin/start ### Creating and Starting the Karaf Service -Installing the Karaf wrapper generates several service files that can be used on different types of systems. For this example installation on an Ubuntu 18.04 machine, we want to enable the `karaf.service` service so that Karaf is properly started on boot. +Installing the Karaf wrapper generates several service files that can be used on different types of systems. For Debian and Ubuntu installation we want to enable the `karaf.service` service so that Karaf is properly started on boot. ```bash sudo systemctl enable /opt/karaf/bin/karaf.service sudo systemctl start karaf ``` +We can check if the service started correctly with: + +```bash +sudo systemctl status karaf +``` + +Press Q to close the status. + ## Alpaca 1.0.x ### Adding the Required Karaf Repositories @@ -147,14 +177,15 @@ For the Karaf features we’re going to install, we need a few different reposit ```bash /opt/karaf/bin/client repo-add mvn:org.apache.activemq/activemq-karaf/ACTIVEMQ_KARAF_VERSION/xml/features /opt/karaf/bin/client repo-add mvn:org.apache.camel.karaf/apache-camel/APACHE_CAMEL_VERSION/xml/features -/opt/karaf/bin/client repo-add mvn:ca.islandora.alpaca/islandora-karaf/LATEST/xml/features +/opt/karaf/bin/client repo-add mvn:ca.islandora.alpaca/islandora-karaf/ISLANDORA_KARAF_VERSION/xml/features # XXX: This shouldn't be strictly necessary, but appears to be a missing # upstream dependency for some fcrepo features. /opt/karaf/bin/client repo-add mvn:org.apache.jena/jena-osgi-features/JENA_OSGI_VERSION/xml/features ``` -- `ACTIVEMQ_KARAF_VERSION`: The latest version of ActiveMQ Karaf 5.x.x; you can find this listed at the [activemq-karaf repository page](https://mvnrepository.com/artifact/org.apache.activemq/activemq-karaf) (e.g., 5.15.11 at the time of writing) -- `APACHE_CAMEL_VERSION`: The latest version of Apache Camel 2.x.x; you can find this listed at the [apache-camel repository page](https://mvnrepository.com/artifact/org.apache.camel.karaf/apache-camel) (e.g., 2.25.0 at the time of writing) -- `JENA_OSGI_VERSION`: The latest version of the Apache Jena OSGi features; you can find this listed at the [jena-osgi-features repository page](https://mvnrepository.com/artifact/org.apache.jena/jena-osgi-features) (e.g., 3.14.0 at the time of writing) +- `ACTIVEMQ_KARAF_VERSION`: The version of ActiveMQ we wrote down at the beginning of this chapter when installing ActiveMQ via `apt-get` +- `APACHE_CAMEL_VERSION`: The latest version of Apache Camel 2.x.x; you can find this listed at the [apache-camel repository page](https://mvnrepository.com/artifact/org.apache.camel.karaf/apache-camel) (e.g., 2.25.4 at the time of writing) +- `ISLANDORA_KARAF_VERSION`: The latest version of Islandora Karaf 1.x; you can find this listed at the [islandora-karaf repository page](https://mvnrepository.com/artifact/ca.islandora.alpaca/islandora-karaf) (e.g., 1.0.5 at the time of writing) +- `JENA_OSGI_VERSION`: The latest version of the Apache Jena 3.x OSGi features; you can find this listed at the [jena-osgi-features repository page](https://mvnrepository.com/artifact/org.apache.jena/jena-osgi-features) (e.g., 3.17.0 at the time of writing) ### Configuring Karaf Features @@ -190,7 +221,6 @@ media.stream=activemq:queue:islandora-indexing-fcrepo-media file.stream=activemq:queue:islandora-indexing-fcrepo-file file.delete.stream=activemq:queue:islandora-indexing-fcrepo-file-delete milliner.baseUrl=http://localhost/milliner -gemini.baseUrl=http://localhost/gemini ``` ### Blueprinting Karaf Derivative Connectors diff --git a/docs/installation/manual/installing_solr.md b/docs/installation/manual/installing_solr.md index 310db03c3..b026f0c6d 100644 --- a/docs/installation/manual/installing_solr.md +++ b/docs/installation/manual/installing_solr.md @@ -8,18 +8,19 @@ ### Downloading and Placing Solr -The Solr binaries can be found at the [Solr downloads page](https://lucene.apache.org/solr/downloads.html); the most recent stable release of Solr 8 should be used. +The Solr binaries can be found at the [Solr downloads page](https://solr.apache.org/downloads.html); the most recent stable release of Solr 8 should be used. ```bash # While generally we download tarballs as .tar.gz files without version # information, the Solr installer is a bit particular in that it expects a .tgz # file with the same name as the extracted folder it contains. It's odd, and we # can't really get around it. +cd wget SOLR_DOWNLOAD_LINK tar -xzvf SOLR_TARBALL ``` -- `SOLR_DOWNLOAD_LINK`: This will depend on a few different things, not least of all the current version of Solr. The link to the `.tgz` for the binary on the downloads page will take you to a list of mirrors that Solr can be downloaded from, and provide you with a preferred mirror at the top. This preferred mirror should be used as the `SOLR_DOWNLOAD_LINK`. -- `SOLR_TARBALL`: The filename that was downloaded, e.g., `solr-8.3.0.tgz` +- `SOLR_DOWNLOAD_LINK`: **NOTICE**: This will depend on a few different things, not least of all the current version of Solr. The link to the `.tgz` for the binary on the downloads page will take you to a list of mirrors that Solr can be downloaded from, and provide you with a preferred mirror at the top. This preferred mirror should be used as the `SOLR_DOWNLOAD_LINK`. +- `SOLR_TARBALL`: The filename that was downloaded, e.g., `solr-8.9.0.tgz` ### Running the Solr Installer @@ -30,7 +31,19 @@ sudo UNTARRED_SOLR_FOLDER/bin/install_solr_service.sh SOLR_TARBALL ``` - `UNTARRED_SOLR_FOLDER`: This will likely simply be `solr-VERSION`, where `VERSION` is the version number that was downloaded. -The port that Solr runs on can potentially be configured at ths point, but we'll expect it to be running on `8983`. +The port that Solr runs on can potentially be configured at this point, but we'll expect it to be running on `8983`. + +Wait until the command output reaches: + +``` +Started Solr server on port 8983 (pid=****). Happy searching! +systemd[1]: Started LSB: Controls Apache Solr as a Service. +``` + +After which you can press `q` to quit the output (this won't kill Solr so it's safe). + +You can check if Solr is running correctly by going to http://localhost:8983/solr + ### Increasing the Open File Limit (Optional) @@ -38,13 +51,11 @@ Solr's installation guide recommends that you increase the open file limit so th `/etc/sysctl.conf` -**Before**: -> 77 | #fs.protected_symlinks=0 - -**After**: -> 77 | #fs.protected_symlinks=0 +Add the following line to the end of the file: -> 78 | fs.file-max = 65535 +``` +fs.file-max = 65535 +``` Then apply your new configuration. @@ -65,21 +76,39 @@ sudo -u solr bin/solr create -c SOLR_CORE -p 8983 ``` - `SOLR_CORE`: `islandora8` +You should see an output similar to this: +``` +WARNING: Using _default configset with data driven schema functionality. NOT RECOMMENDED for production use. + To turn off: bin/solr config -c islandora8 -p 8983 -action set-user-property -property update.autoCreateFields -value false + +Created new core 'islandora8' +``` + ### Installing `search_api_solr` Rather than use an out-of-the-box configuration that won’t be suitable for our purposes, we’re going to use the Drupal `search_api_solr` module to generate one for us. This will also require us to install the module so we can create these configurations using Drush. ```bash cd /opt/drupal -sudo -u www-data composer require drupal/search_api_solr:^3.0 +sudo -u www-data composer require drupal/search_api_solr:^4.2 drush -y en search_api_solr ``` +You should see an output similar to this: +``` +The following module(s) will be enabled: search_api_solr, language, search_api + + // Do you want to continue?: yes. + + [success] Successfully enabled: search_api_solr, language, search_api + +``` + ### Configuring search_api_solr Before we can create configurations to use with Solr, the core we created earlier needs to be referenced in Drupal. -Log in to the Drupal site at `/user` using the sitewide administrator username and password, then navigate to `/admin/config/search/search-api/add-server`. +Log in to the Drupal site at `/user` using the sitewide administrator username and password (if using defaults from previous chapters this should be `islandora` and `islandora`), then navigate to `/admin/config/search/search-api/add-server`. Fill out the server addition form using the following options: @@ -108,7 +137,7 @@ As a recap for this configuration: Click **Save** to create the server configuration. -!!! notice +**NOTICE** You can ignore the error about an incompatible Solr schema; we're going to set this up in the next step. In fact, if you refresh the page after restarting Solr in the next step, you should see the error disappear. ### Generating and Applying Solr Configurations @@ -128,7 +157,7 @@ sudo systemctl restart solr In order for content to be indexed back into Solr, a search index needs to be added to our server. Navigate to `/admin/config/search/search-api/add-index` and check off the things you'd like to be indexed. -!!! notice +**NOTICE** You should come back here later and reconfigure this after completing the last step in this guide. The default indexing configuration is pretty permissive, and you may want to restrict, for example, indexed content to just Islandora-centric bundles. This guide doesn't set up the index's fields either, which are going to be almost wholly dependent on the needs of your installation. Once you complete that configuration later on, re-index Solr from the configuration page of the index we're creating here. ![Adding a Search Index](../../assets/adding_a_search_index.png) diff --git a/docs/installation/manual/installing_tomcat_and_cantaloupe.md b/docs/installation/manual/installing_tomcat_and_cantaloupe.md index fd034fec2..05ff0c294 100644 --- a/docs/installation/manual/installing_tomcat_and_cantaloupe.md +++ b/docs/installation/manual/installing_tomcat_and_cantaloupe.md @@ -1,17 +1,17 @@ # Installing Tomcat and Cantaloupe ## In this section, we will install: -- [Tomcat 8](https://tomcat.apache.org/download-80.cgi), the Java servlet container that will serve up some Java applications on various endpoints, including, importantly, Fedora -- [Cantaloupe 4](https://cantaloupe-project.github.io/), the image tileserver - running in Tomcat - that will be used to serve up large images in a web-accessible fashion +- [Tomcat 9](https://tomcat.apache.org/download-90.cgi), the Java servlet container that will serve up some Java applications on various endpoints, including, importantly, Fedora +- [Cantaloupe 5](https://cantaloupe-project.github.io/), the image tileserver - running in Tomcat - that will be used to serve up large images in a web-accessible fashion -## Tomcat 8 +## Tomcat 9 -### Installing OpenJDK 8 +### Installing OpenJDK 11 -Tomcat runs in a Java runtime environment, so we'll need one to continue. In our case, OpenJDK 8 is open-source, free to use, and can fairly simply be installed using `apt-get`: +Tomcat runs in a Java runtime environment, so we'll need one to continue. In our case, OpenJDK 11 is open-source, free to use, and can fairly simply be installed using `apt-get`: ```bash -sudo apt-get -y install openjdk-8-jdk openjdk-8-jre +sudo apt-get -y install openjdk-11-jdk openjdk-11-jre ``` The installation of OpenJDK via `apt-get` establishes it as the de-facto Java runtime environment to be used on the system, so no further configuration is required. @@ -21,6 +21,7 @@ The resultant location of the java JRE binary (and therefore, the correct value ```bash update-alternatives --list java ``` +Take a note of this path as we will need it later. ### Creating a `tomcat` User @@ -33,11 +34,11 @@ sudo adduser tomcat --ingroup tomcat --home /opt/tomcat --shell /usr/bin You will be prompted to create a password for the `tomcat` user; all the other information as part of the `adduser` command can be ignored. -### Downloading and Placing Tomcat 8 +### Downloading and Placing Tomcat 9 -Tomcat 8 itself can be installed in several different ways; while it’s possible to install via `apt-get`, this doesn’t give us a great deal of control over exactly how we’re going to run and manage it; as a critical part of the stack, it is beneficial for our purposes to have a good frame of reference for the inner workings of Tomcat. +Tomcat 9 itself can be installed in several different ways; while it’s possible to install via `apt-get`, this doesn’t give us a great deal of control over exactly how we’re going to run and manage it; as a critical part of the stack, it is beneficial for our purposes to have a good frame of reference for the inner workings of Tomcat. -We’re going to download the latest version of Tomcat to `/opt` and set it up so that it runs automatically. Bear in mind that with the following commands, this is going to be entirely relative to the current version of Tomcat 8, which we’ll try to mitigate as we go. +We’re going to download the latest version of Tomcat to `/opt` and set it up so that it runs automatically. Bear in mind that with the following commands, this is going to be entirely relative to the current version of Tomcat 9, which we’ll try to mitigate as we go. ```bash cd /opt @@ -46,8 +47,8 @@ sudo tar -zxvf tomcat.tar.gz sudo mv /opt/TOMCAT_DIRECTORY/* /opt/tomcat sudo chown -R tomcat:tomcat /opt/tomcat ``` -- `TOMCAT_TARBALL_LINK`: No default can be provided here; you should navigate to the [Tomcat 8 downloads page](https://tomcat.apache.org/download-80.cgi) and grab the link to the latest `.tar.gz` file under the “Core” section of “Binary Distributions”. It is highly recommended to grab the latest version of Tomcat 8, as it will come with associated security patches and fixes. -- `TOMCAT_DIRECTORY`: This will also depend entirely on the exact version of tomcat downloaded - for example, `apache-tomcat-8.5.47`. Again, `ls /opt` can be used to find this. +- `TOMCAT_TARBALL_LINK`: No default can be provided here; you should navigate to the [Tomcat 9 downloads page](https://tomcat.apache.org/download-90.cgi) and grab the link to the latest `.tar.gz` file under the “Core” section of “Binary Distributions”. It is highly recommended to grab the latest version of Tomcat 9, as it will come with associated security patches and fixes. +- `TOMCAT_DIRECTORY`: This will also depend entirely on the exact version of tomcat downloaded - for example, `apache-tomcat-9.0.50`. Again, `ls /opt` can be used to find this. ### Creating a setenv.sh Script @@ -59,13 +60,16 @@ export CATALINA_HOME="/opt/tomcat" export JAVA_HOME="PATH_TO_JAVA_HOME" export JAVA_OPTS="-Djava.awt.headless=true -server -Xmx1500m -Xms1000m" ``` -- `PATH_TO_JAVA_HOME`: This will vary a bit depending on the environment, but will likely live in `/usr/lib/jvm` somewhere (e.g., `/usr/lib/jvm/java-8-openjdk-amd64` for an installation on a machine with an AMD processor); again, in an Ubunutu environment you can check a part of this using `update-alternatives --list java`, which will give you the path to the JRE binary within the Java home +- `PATH_TO_JAVA_HOME`: This will vary a bit depending on the environment, but will likely live in `/usr/lib/jvm` somewhere (e.g., `/usr/lib/jvm/java-11-openjdk-amd64`); again, in an Ubunutu environment you can check a part of this using `update-alternatives --list java`, which will give you the path to the JRE binary within the Java home. Note that `update-alternatives --list java` will give you the path to the binary, so for `PATH_TO_JAVA_HOME` delete the `/bin/java` at the end to get the Java home directory, so it should look something like this: +``` +export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" +``` ### Creating the Tomcat Service Tomcat includes two shell scripts we’re going to make use of - `startup.sh` and `shutdown.sh` - which are light wrappers on top of a third script, `catalina.sh`, which manages spinning up and shutting down the Tomcat server. -Ubuntu 18.04 uses `systemctl` to manage services; we’re going to create a .service file that can run these shell scripts. +Debian and Ubuntu use `systemctl` to manage services; we’re going to create a .service file that can run these shell scripts. `/etc/systemd/system/tomcat.service | root:root/755` ``` @@ -91,31 +95,21 @@ sudo systemctl enable tomcat sudo systemctl start tomcat ``` -We can check that Tomcat has started by running `systemctl status tomcat | grep Active`; we should see that Tomcat is `active (running)`, which is the correct result of startup.sh finishing its run successfully. - -## Installing Cantaloupe 4 - -### Stopping the Tomcat service +We can check that Tomcat has started by running `sudo systemctl status tomcat | grep Active`; we should see that Tomcat is `active (running)`, which is the correct result of startup.sh finishing its run successfully. -Before we start working with Cantaloupe, we should `stop` Tomcat; otherwise, Cantaloupe will automatically be deployed from its .war file, and we’d like everything to be in place before the deployment. +## Installing Cantaloupe 5 -```bash -sudo systemctl stop tomcat -``` +Since version 5, Cantaloupe is released as a standalone Java application and is no longer deployed in Tomcat via a .war file. Even so, we can still fine-tune how it runs and even install it as a service. -### Downloading and Placing the Cantaloupe WAR +### Downloading Cantaloupe Releases of Cantaloupe live on the [Cantaloupe release page](https://github.com/cantaloupe-project/cantaloupe/releases); the latest version can be found here as a `.zip` file. ```bash sudo wget -O /opt/cantaloupe.zip CANTALOUPE_RELEASE_URL sudo unzip /opt/cantaloupe.zip -sudo cp CANTALOUPE_DIR/CANTALOUPE_WAR /opt/tomcat/webapps/cantaloupe.war -sudo chown tomcat:tomcat /opt/tomcat/webapps/cantaloupe.war ``` -- `CANTALOUPE_RELEASE_URL`: It’s recommended we grab the latest version of Cantaloupe 4. This can be found on the above-linked release page, as the `.zip` version; for example, https://github.com/cantaloupe-project/cantaloupe/releases/download/v4.1.4/cantaloupe-4.1.4.zip -- `CANTALOUPE_DIR`: This will depend on the exact version of Cantaloupe downloaded; in the above example release, this would be `cantaloupe-4.1.4` -- `CANTALOUPE_WAR`: This will also depend on the exact version of Cantaloupe downloaded; in the above example release, this would be `cantaloupe-4.1.4.war` +- `CANTALOUPE_RELEASE_URL`: It’s recommended we grab the latest version of Cantaloupe 5. This can be found on the above-linked release page, as the `.zip` version; for example, https://github.com/cantaloupe-project/cantaloupe/releases/download/v5.0.3/cantaloupe-5.0.3.zip - make sure **not** to download the source code zip file as that isn't compiled for running out-of-the-box. ### Creating a Cantaloupe Configuration @@ -125,28 +119,36 @@ Creating these files from scratch is *not* recommended; rather, we’re going to ```bash sudo mkdir /opt/cantaloupe_config -sudo cp CANTALOUPE_DIR/cantaloupe.properties.sample /opt/cantaloupe_config/cantaloupe.properties -sudo cp CANTALOUPE_DIR/delegates.rb.sample /opt/cantaloupe_config/delegates.rb +sudo cp CANTALOUPE_VER/cantaloupe.properties.sample /opt/cantaloupe_config/cantaloupe.properties +sudo cp CANTALOUPE_VER/delegates.rb.sample /opt/cantaloupe_config/delegates.rb ``` +- `CANTALOUPE_VER`: This will depend on the exact version of Cantaloupe downloaded; in the above example release, this would be `cantaloupe-5.0.3` The out-of-the-box configuration will work fine for our purposes, but it’s highly recommended that you take a look through the `cantaloupe.properties` and see what changes can be made; specifically, logging to actual logfiles isn’t set up by default, so you may want to take a peek at the `log.application.SyslogAppender` or `log.application.RollingFileAppender`, as well as changing the logging level. -### Defining the Cantaloupe Configuration Location +### Installing and configuring Cantaloupe as a service -Now that we have a Cantaloupe configuration, we need to make a change to Tomcat’s `JAVA_OPTS` so that its location can be referenced when Tomcat spins it up. This will involve changing the `setenv.sh` created when setting up Tomcat. +Since it is a standalone application, we can configure Cantaloupe as a systemd service like we did with Tomcat, so it can start on boot: -`/opt/tomcat/bin/setenv.sh` - -**Before**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -server -Xmx1500m -Xms1000m" +`/etc/systemd/system/cantaloupe.service | root:root/755` +``` +[Unit] +Description=Cantaloupe -**After**: -> 3 | export JAVA_OPTS="-Djava.awt.headless=true -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -server -Xmx1500m -Xms1000m" +[Service] +ExecStart=java -cp /opt/CANTALOUPE_VER/CANTALOUPE_VER.jar -Dcantaloupe.config=/opt/cantaloupe_config/cantaloupe.properties -Xmx1500m -Xms1000m edu.illinois.library.cantaloupe.StandaloneEntry +SyslogIdentifier=cantaloupe -### Starting the Tomcat Service +[Install] +WantedBy=multi-user.target +``` +- `CANTALOUPE_VER`: This will depend on the exact version of Cantaloupe downloaded; in the above example release, this would be `cantaloupe-5.0.3` -After Cantaloupe has been completely provisioned, we’re ready to switch Tomcat back on so that Cantaloupe automatically deploys with the established configuration. +We can now enable the service and run it: ```bash -sudo systemctl start tomcat +sudo systemctl enable cantaloupe +sudo systemctl start cantaloupe ``` + +We can check the service status with `sudo systemctl status cantaloupe | grep Active` and the splash screen of Cantaloupe should be available at http://localhost:8182 diff --git a/docs/installation/manual/preparing_a_webserver.md b/docs/installation/manual/preparing_a_webserver.md index 89a6dc298..cf9a0f065 100644 --- a/docs/installation/manual/preparing_a_webserver.md +++ b/docs/installation/manual/preparing_a_webserver.md @@ -40,6 +40,8 @@ Since the user we are currently logged in as is going to work quite a bit inside **N.B.** This code block uses **backticks**, not single quotes; this is an important distinction as backticks have special meaning in `bash`. +**Note** If doing this in the terminal, replace "whoami" with your username and remove the backticks + ```bash sudo usermod -a -G www-data `whoami` sudo usermod -a -G `whoami` www-data @@ -47,28 +49,38 @@ sudo usermod -a -G `whoami` www-data sudo su `whoami` ``` -## PHP 7.2 +## PHP 7.4 + +### Install PHP 7.4 + +Islandora defaults, a module which will install Islandora at the end, requires PHP 7.4. If you're running Debian 11 you should be able to install PHP 7.4 from the apt packages directly: -### Install PHP 7.2 +```bash +sudo apt-get -y install php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-gd php7.4-imap php7.4-json php7.4-mbstring php7.4-opcache php7.4-xml php7.4-yaml php7.4-zip libapache2-mod-php7.4 php-pgsql php-redis php-xdebug unzip +``` -PHP can generally be easily installed using your operating system’s package manager, though whether or not the version you’ll be given is up to date depends entirely on whether or not that package manager is kept up-to-date. We’re going to enable both PHP 7.2, as well as the myriad modules we require, simultaneously: +If you're running Debian 10, the repository for the PHP 7.4 packages needs to be installed first: ```bash -sudo apt-get -y install php7.2 php7.2-cli php7.2-common php7.2-curl php7.2-dev php7.2-gd php7.2-imap php7.2-json php7.2-mbstring php7.2-opcache php7.2-xml php7.2-yaml php7.2-zip libapache2-mod-php7.2 php-pgsql php-redis php-xdebug unzip +sudo apt-get -y install lsb-release apt-transport-https ca-certificates +sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg +echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list +sudo apt-get update +sudo apt-get -y install php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-gd php7.4-imap php7.4-json php7.4-mbstring php7.4-opcache php7.4-xml php7.4-yaml php7.4-zip libapache2-mod-php7.4 php-pgsql php-redis php-xdebug unzip ``` -This will install a series of PHP configurations and mods in `/etc/php/7.2`, including: +This will install a series of PHP configurations and mods in `/etc/php/7.4`, including: - A `mods-available` folder (from which everything is typically enabled by default) - A configuration for PHP when run from Apache in the `apache2` folder - A configuration for PHP when run from the command line - including when run via Drush - in the `cli` folder - `unzip`, which is important for PHP’s zip module to function correctly despite it not being a direct dependency of the module. We will also need to unzip some things later, so this is convenient to have in place early in the installation process. -## PostgreSQL 10 +## PostgreSQL 11 -### Install PostgreSQL 10 +### Install PostgreSQL 11 -PostgreSQL can generally be easily installed using your operating system’s package manager. It is typically sensible to install the version the system recognizes as up-to-date; Ubuntu 18.04 sees this as version 10. We’re simply going to install the database software: +PostgreSQL can generally be easily installed using your operating system’s package manager. It is typically sensible to install the version the system recognizes as up-to-date. We’re simply going to install the database software: ```bash sudo apt-get -y install postgresql @@ -78,11 +90,11 @@ This will install: - A user at the system level named `postgres`; this will be the only user, by default, that has permission to run the `psql` binary and have access to Postgres configurations - A binary executable at `/usr/bin/psql`, which anyone - even `root` - will get kicked out of the moment they run it, since only the `postgres` user has permission to run any Postgres commands -- A series of configurations that live in `/etc/postgresql/10/main` which can be used to modify how PostgreSQL works. +- A series of configurations that live in `/etc/postgresql/11/main` which can be used to modify how PostgreSQL works. -### Configure Postgresql 10 For Use With Drupal +### Configure Postgresql 11 For Use With Drupal -A modification needs to be made to the PostgreSQL configuration in order for Drupal to properly install and function. This change can be made to the main configuration file at `/etc/postgresql/10/main/postgresql.conf`: +A modification needs to be made to the PostgreSQL configuration in order for Drupal to properly install and function. This change can be made to the main configuration file at `/etc/postgresql/11/main/postgresql.conf`: **Before**: > 558 | #bytea_output = ‘hex’ # hex, escape @@ -90,6 +102,8 @@ A modification needs to be made to the PostgreSQL configuration in order for Dru **After**: > 558 | bytea_output = ‘escape’ +(Remove the "# hex, escape" comment and change the value from "hex" to "escape") + The `postgresql` service should be restarted to accept the new configuration: ```bash