From d96bf8fbd03fc45efe2f728558b8eb7498a32bbd Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 12 Sep 2024 20:10:10 +0200 Subject: [PATCH 1/8] add install notes for classic ui, pip and buildout method --- docs/classic-ui/index.md | 1 + docs/classic-ui/install.md | 198 +++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) create mode 100644 docs/classic-ui/install.md diff --git a/docs/classic-ui/index.md b/docs/classic-ui/index.md index 8fd0f5a9c..683b345c3 100644 --- a/docs/classic-ui/index.md +++ b/docs/classic-ui/index.md @@ -51,6 +51,7 @@ This chapter is a developer reference manual for working with Classic UI. csrf forms icons +install images layers module-federation diff --git a/docs/classic-ui/install.md b/docs/classic-ui/install.md new file mode 100644 index 000000000..cfbef2753 --- /dev/null +++ b/docs/classic-ui/install.md @@ -0,0 +1,198 @@ +--- +myst: + html_meta: + "description": "Installation notes for Plone Classic UI" + "property=og:description": "Installation notes for Plone Classic UI" + "property=og:title": "Installation notes for pip and buildout based installation paths" + "keywords": "Plone, Classic UI, classic-ui, installation, pip, buildout" +--- + +(classic-ui-installation-label)= + +# Installation + +This sections describes how to install Plone 6 Classic UI. +Examples include the following. + +- pip based install method +- buildout based install method + +(classic-ui-installation-pip-label)= + +## Quickstart pip based installation + +install notes for linux + +requirements: + +- python3.10 or greater +- python venv module + +in our example we use python3.12 + +On debian based systems you can install python with following command + +```bash +sudo apt install python3.12 python3.12-dev python3.12-venv +``` + +Select a directory of your choice + +```bash +mkdir -p /tmp/plone && cd /tmp/plone +``` + +Create a virtual environment + +```bash +python3 -m venv ./venv +``` + +Activate the virtual environment + +```bash +source ./venv/bin/activate +``` + +Install Plone and a helper package + +```bash +pip install Plone cookiecutter +``` + +```bash +cookiecutter -f --no-input --config-file ./instance.yaml https://github.com/plone/cookiecutter-zope-instance +``` + +Deactivate the virtual environment + +```bash +deactivate +``` + +minimal content for the `instance.yaml` file + +```yaml +# please change the password to a secrue token! +default_context: + initial_user_name: "admin" + initial_user_password: "admin" + wsgi_listen: "localhost:8080" + debug_mode: false + verbose_security: false + db_storage: "direct" + environment: { + "zope_i18n_compile_mo_files": true, + } +``` + +Start the instance for quick test + +```bash +./venv/bin/runwsgi -v instance/etc/zope.ini +``` + +Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes, + +Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site** + +Let's have fun with Plone! + +```{todo} +add an example to create a zeo installation +``` + +```{todo} +add an example to start the instance via for systemd +``` + +(classic-ui-installation-buildout-label)= + +## Quickstart buildout based installation + +install notes for linux + +requirements: + +- python3.10 or greater +- python venv module + +in our example we use python3.12 + +On debian based systems you can install python with following command + +```bash +sudo apt install python3.12 python3.12-dev python3.12-venv +``` + +Select a directory of your choice + +```bash +mkdir -p /tmp/plone && cd /tmp/plone +``` + +Create a virtual environment + +```bash +python3 -m venv . +``` + +Activate the virtual environment + +```bash +source ./bin/activate +``` + +install requirements + +```bash +pip install -r https://dist.plone.org/release/6-latest/requirements.txt +``` + +add a minimal `buildout.cfg` file to your directory + +```cfg +[buildout] +extends = + https://dist.plone.org/release/6-latest/versions.cfg + +parts = + instance + +[instance] +recipe = plone.recipe.zope2instance +user = admin:admin +http-address = 8080 +eggs = + Plone +``` + +run buildout + +```bash +buildout +``` + +Start the instance for quick test in foreground mode + +```bash +./bin/instance fg +``` + +Start the instance normal + +```bash +./bin/instance start +``` + +Stop the instance + +```bash +./bin/instance stop +``` + +Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes, + +Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site** + +Let's have fun with Plone! From 578c226c21e5a27cf8fd82dd66d52f081d48e499 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Mon, 16 Sep 2024 17:22:29 +0200 Subject: [PATCH 2/8] add instructions for zeo install and systemd service --- docs/classic-ui/install.md | 159 ++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 4 deletions(-) diff --git a/docs/classic-ui/install.md b/docs/classic-ui/install.md index cfbef2753..4ba05ab10 100644 --- a/docs/classic-ui/install.md +++ b/docs/classic-ui/install.md @@ -98,12 +98,163 @@ Now you can call the url `http://localhost:8080` in your browser and you can add Let's have fun with Plone! -```{todo} -add an example to create a zeo installation + +(classic-ui-installation-example-plone-systemd)= + +### Example to create a Zeo Server - Client installation + +Go to a directory of you choice + +You need three files + +`requirements.txt` + +``` +-c constraints.txt +Plone + +cookiecutter +zope.mkzeoinstance +``` + +`constraints.txt` + +``` +-c https://dist.plone.org/release/6.1-latest/constraints.txt ``` -```{todo} -add an example to start the instance via for systemd +`setup-zeo.sh` + +``` bash +#!/bin/bash + +ZEO_HOST=127.0.0.1 +ZEO_PORT=8100 +ZEO_NAME=zeoserver + +# number of clients +CLIENTS=2 + +CLIENT_HOST=127.0.0.1 +# a counter calculate the port number to 8081, 8082 ... +CLIENT_PORT_BASE=808 + +BLOBSTORAGE=$(pwd)/$ZEO_NAME/var/blobs/ + +if [[ ! -v INITIAL_PASSWORD ]]; then + echo "INITIAL_PASSWORD is not set" + exit 1 +elif [[ -z "$INITIAL_PASSWORD" ]]; then + echo "INITIAL_PASSWORD is set to the empty string" + exit 1 +fi + +# Create the zeo server +# configure zeo with mkzeoinstance +./venv/bin/mkzeoinstance ${ZEO_NAME} ${ZEO_HOST}:${ZEO_PORT} -b ${BLOBSTORAGE} + +# Create the zeo clients +COUNTER=0 +for OUTPUT in $(seq $CLIENTS) +do + let COUNTER++ + CLIENT_NAME=client${COUNTER} + CLIENT_PORT=${CLIENT_PORT_BASE}${COUNTER} + CLIENT_FILE=${CLIENT_NAME}.yaml + + # configure a wsgi client with cookiecutter-zope-instance + cat < ./setup-zeo.sh +``` + +For quick test start the zeoserver and the clients in foreground mode + +``` +zeoserver/bin/runzeo +runwsgi -v client1/etc/zope.ini +runwsgi -v client2/etc/zope.ini +``` + +your site is available via browser: + +`localhost:8081` or `localhost:8082` + +for production environment daemonize the services via systemd + +```todo +daemonize scripts +``` + + +(classic-ui-installation-example-plone-systemd)= + +### Example to start the instance via systemd + + The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user plone: + +```ini +[Unit] +Description=Plone instance +After=network.target + +[Service] +Type=simple +User=plone +ExecStart=/opt/plone/bin/runwsgi /opt/plone/instance/etc/zope.ini +KillMode=control-group +TimeoutStartSec=10 +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target +``` + +Save this configuration under /etc/systemd/system/plone.service and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: + +``` +systemctl start plone +systemctl restart plone +systemctl status plone +systemctl stop plone ``` (classic-ui-installation-buildout-label)= From 5b9f1fd0ad01c359124ead884203c9a6c18bb291 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Mon, 16 Sep 2024 20:29:49 +0200 Subject: [PATCH 3/8] add examples for daemonize scripts --- docs/classic-ui/install.md | 125 ++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 16 deletions(-) diff --git a/docs/classic-ui/install.md b/docs/classic-ui/install.md index 4ba05ab10..8d7d5a3bd 100644 --- a/docs/classic-ui/install.md +++ b/docs/classic-ui/install.md @@ -39,7 +39,7 @@ sudo apt install python3.12 python3.12-dev python3.12-venv Select a directory of your choice ```bash -mkdir -p /tmp/plone && cd /tmp/plone +mkdir -p /opt/plone && cd /opt/plone ``` Create a virtual environment @@ -98,10 +98,40 @@ Now you can call the url `http://localhost:8080` in your browser and you can add Let's have fun with Plone! +### Example to start the instance via systemd + + The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user *plone*: + +```ini +[Unit] +Description=Plone instance +After=network.target + +[Service] +Type=simple +User=plone +ExecStart=/opt/plone/bin/runwsgi /opt/plone/instance/etc/zope.ini +KillMode=control-group +TimeoutStartSec=10 +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target +``` + +Save this configuration under /etc/systemd/system/plone.service and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: + +``` +systemctl start plone +systemctl restart plone +systemctl status plone +systemctl stop plone +``` + (classic-ui-installation-example-plone-systemd)= -### Example to create a Zeo Server - Client installation +### Example to create a zeo server - client installation Go to a directory of you choice @@ -220,26 +250,24 @@ your site is available via browser: for production environment daemonize the services via systemd -```todo -daemonize scripts -``` +### Example to start the zeo cluster via systemd -(classic-ui-installation-example-plone-systemd)= +The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user *plone*: -### Example to start the instance via systemd +You need a service file for every client and for the zeoserver. - The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user plone: +`plone-zeoserver.service` ```ini [Unit] -Description=Plone instance +Description=Plone zeoserver After=network.target [Service] Type=simple User=plone -ExecStart=/opt/plone/bin/runwsgi /opt/plone/instance/etc/zope.ini +ExecStart=/opt/plone/zeoserver/bin/runzeo KillMode=control-group TimeoutStartSec=10 TimeoutStopSec=10 @@ -248,15 +276,80 @@ TimeoutStopSec=10 WantedBy=multi-user.target ``` -Save this configuration under /etc/systemd/system/plone.service and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: +`plone-client1.service` + +```ini +[Unit] +Description=Plone client1 +Requires=plone-zeoserver.service +[Service] +Type=simple +User=plone +ExecStart=/opt/plone/venv/bin/runwsgi /opt/plone/client1/etc/zope.ini +KillMode=control-group +TimeoutStartSec=10 +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target ``` -systemctl start plone -systemctl restart plone -systemctl status plone -systemctl stop plone + +`plone-client2.service` + +```ini +[Unit] +Description=Plone client2 +Requires=plone-zeoserver.service + +[Service] +Type=simple +User=plone +ExecStart=/opt/plone/venv/bin/runwsgi /opt/plone/client2/etc/zope.ini +KillMode=control-group +TimeoutStartSec=10 +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target ``` + +Save this configurations in /etc/systemd/system `plone-zeoserver.service`, `plone-client1.service` and `plone-client2.service` and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: + +for startup the cluster, use: + +``` +systemctl start plone-client1.service +systemctl start plone-client2.service +``` + +the zeoserver starts automatically, because the clients have a requirements directive in the service definition `Requires=plone-zeoserver.service` + +for a full shutdown of cluster, use + +``` +systemctl stop plone-zeoserver.service +``` + +the clients stops automatically, because the clients have a requirements directive in the service definition `Requires=plone-zeoserver.service` + +to enable the startup of cluster on boot process: + +`systemctl enable plone-client1.service` + +`systemctl enable plone-client2.service` + +to disable the startup of cluster on boot process: + +`systemctl disable plone-client1.service` + +`systemctl disable plone-client2.service` + +(classic-ui-installation-example-plone-systemd)= + + + (classic-ui-installation-buildout-label)= ## Quickstart buildout based installation @@ -279,7 +372,7 @@ sudo apt install python3.12 python3.12-dev python3.12-venv Select a directory of your choice ```bash -mkdir -p /tmp/plone && cd /tmp/plone +mkdir -p /opt/plone && cd /opt/plone ``` Create a virtual environment From f0a842c8a8fc064d122cd5796e8f6cf6dd3f2ed3 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 2 Oct 2024 02:56:36 -0700 Subject: [PATCH 4/8] Move to Install directory --- docs/classic-ui/index.md | 1 - docs/{classic-ui => install}/install.md | 0 2 files changed, 1 deletion(-) rename docs/{classic-ui => install}/install.md (100%) diff --git a/docs/classic-ui/index.md b/docs/classic-ui/index.md index 683b345c3..8fd0f5a9c 100644 --- a/docs/classic-ui/index.md +++ b/docs/classic-ui/index.md @@ -51,7 +51,6 @@ This chapter is a developer reference manual for working with Classic UI. csrf forms icons -install images layers module-federation diff --git a/docs/classic-ui/install.md b/docs/install/install.md similarity index 100% rename from docs/classic-ui/install.md rename to docs/install/install.md From bcb8403a36271142812fe62e68a20f649bdc7210 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 2 Oct 2024 02:58:59 -0700 Subject: [PATCH 5/8] Use generic shell for syntax highlighting --- docs/install/install.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/install/install.md b/docs/install/install.md index 8d7d5a3bd..e03f63cb2 100644 --- a/docs/install/install.md +++ b/docs/install/install.md @@ -32,41 +32,41 @@ in our example we use python3.12 On debian based systems you can install python with following command -```bash +```shell sudo apt install python3.12 python3.12-dev python3.12-venv ``` Select a directory of your choice -```bash mkdir -p /opt/plone && cd /opt/plone +```shell ``` Create a virtual environment -```bash +```shell python3 -m venv ./venv ``` Activate the virtual environment -```bash +```shell source ./venv/bin/activate ``` Install Plone and a helper package -```bash +```shell pip install Plone cookiecutter ``` -```bash +```shell cookiecutter -f --no-input --config-file ./instance.yaml https://github.com/plone/cookiecutter-zope-instance ``` Deactivate the virtual environment -```bash +```shell deactivate ``` @@ -88,7 +88,7 @@ default_context: Start the instance for quick test -```bash +```shell ./venv/bin/runwsgi -v instance/etc/zope.ini ``` @@ -365,31 +365,31 @@ in our example we use python3.12 On debian based systems you can install python with following command -```bash +```shell sudo apt install python3.12 python3.12-dev python3.12-venv ``` Select a directory of your choice -```bash +```shell mkdir -p /opt/plone && cd /opt/plone ``` Create a virtual environment -```bash +```shell python3 -m venv . ``` Activate the virtual environment -```bash +```shell source ./bin/activate ``` install requirements -```bash +```shell pip install -r https://dist.plone.org/release/6-latest/requirements.txt ``` @@ -413,25 +413,25 @@ eggs = run buildout -```bash +```shell buildout ``` Start the instance for quick test in foreground mode -```bash +```shell ./bin/instance fg ``` Start the instance normal -```bash +```shell ./bin/instance start ``` Stop the instance -```bash +```shell ./bin/instance stop ``` From 0fad52153c2874f8627e9202d17be104f15a0125 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 2 Oct 2024 03:05:18 -0700 Subject: [PATCH 6/8] Update per @mrtango review. --- docs/install/install.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/install/install.md b/docs/install/install.md index e03f63cb2..a68545fa8 100644 --- a/docs/install/install.md +++ b/docs/install/install.md @@ -38,8 +38,9 @@ sudo apt install python3.12 python3.12-dev python3.12-venv Select a directory of your choice -mkdir -p /opt/plone && cd /opt/plone ```shell +mkdir -p /opt/plone +cd /opt/plone ``` Create a virtual environment @@ -128,6 +129,16 @@ systemctl status plone systemctl stop plone ``` +Alternatively, you can use the `service` command. +% TODO: Why would someone use `service *` versus `systemctl *`? Is this OS dependent? + +```shell +service plone start +service plone stop +service plone status +service plone restart +``` + (classic-ui-installation-example-plone-systemd)= From 7edd163884821a6b333d12f247aa780959739c20 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 2 Oct 2024 03:06:23 -0700 Subject: [PATCH 7/8] One sentence per line, fix some punctuation. --- docs/install/install.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/install/install.md b/docs/install/install.md index a68545fa8..ddf797dfa 100644 --- a/docs/install/install.md +++ b/docs/install/install.md @@ -93,15 +93,17 @@ Start the instance for quick test ./venv/bin/runwsgi -v instance/etc/zope.ini ``` -Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes, +Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes. -Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site** +Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site**. Let's have fun with Plone! + ### Example to start the instance via systemd - The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user *plone*: +The following systemd service configuration works with the runwsgi script. +It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user `plone`: ```ini [Unit] @@ -120,9 +122,10 @@ TimeoutStopSec=10 WantedBy=multi-user.target ``` -Save this configuration under /etc/systemd/system/plone.service and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: +Save this configuration under /etc/systemd/system/plone.service and execute `systemctl daemon-reload` for systemd to read it. +After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: -``` +```shell systemctl start plone systemctl restart plone systemctl status plone @@ -264,7 +267,8 @@ for production environment daemonize the services via systemd ### Example to start the zeo cluster via systemd -The following systemd service configuration works with the runwsgi script. It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user *plone*: +The following systemd service configuration works with the runwsgi script. +It assumes your installation is located at /opt/plone and the user account your Plone instance runs under user *plone*: You need a service file for every client and for the zeoserver. @@ -325,8 +329,9 @@ TimeoutStopSec=10 WantedBy=multi-user.target ``` - -Save this configurations in /etc/systemd/system `plone-zeoserver.service`, `plone-client1.service` and `plone-client2.service` and execute `systemctl daemon-reload` for systemd to read it. After that you can use standard `systemctl` commands to `start`, `restart` or `stop` the Plone instance: +Save these configurations in `/etc/systemd/system` as `plone-zeoserver.service`, `plone-client1.service`, and `plone-client2.service`. +Execute `systemctl daemon-reload` for systemd to reload it. +After that you can use standard `systemctl` commands to `start`, `restart`, or `stop` the Plone instance: for startup the cluster, use: @@ -446,8 +451,8 @@ Stop the instance ./bin/instance stop ``` -Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes, +Your instance starts in foreground mode, which is only advisable for troubleshooting or for local demonstration purposes. -Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site** +Now you can call the url `http://localhost:8080` in your browser and you can add a **Classic UI Plone site**. Let's have fun with Plone! From bb2e9ecfc0adc2d58e2cf70a376d63f7400554b1 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 2 Oct 2024 03:07:49 -0700 Subject: [PATCH 8/8] Add install to the index as a temporary file name --- docs/install/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/install/index.md b/docs/install/index.md index 1f8c95ce7..247e783c2 100644 --- a/docs/install/index.md +++ b/docs/install/index.md @@ -55,5 +55,6 @@ Choose a version to demo. create-project create-project-classic-ui create-project-cookieplone +install containers/index ```