Volto on local network

I want to run Plone/Volto on 'my local ubuntu machine' (operation in the foot, so I will be stuck at home for a while). I installed it 'from packages' in case I want to add my own theme or product.

  1. How can I access Plone/Volto without any apache/similar in front (or do I need to set that up)
  2. Is it possible to run several 'sites' on the same setup (just as 'old some, Plone1, Plone2, etc)
  3. Where do I change the ports if I run several sites (and the admin password)
1 Like
  1. How can I access Plone/Volto without any apache/similar in front (or do I need to set that up)

Plone localhost:8080/Plone, volto localhost:3000. yarn start

  1. Is it possible to run several 'sites' on the same setup (just as 'old some, Plone1, Plone2, etc)
echo "RAZZLE_DEV_PROXY_API_PATH=http://localhost:8080/Plone2" > .env.development
  1. Where do I change the ports if I run several sites (and the admin password)
env PORT=4000 yarn start
curl localhost:4000

But it's easier if you run the multiple Voltos for each of your Plone websites one at a time.

Please note, this is for a development setup.

Thanks

Forgot to tell:
I want to install Plone / Volto on a Ubuntu machine, and access it from my Mac (laptop) / iPad etc.

I do "remote development" all the time. From your Mac you need to connect to the Ubuntu machine with ssh -L 3000:localhost:3000 user@ubuntu.

This may be more difficult from Ipad, I don't know. Keep in mind that if you connect to Plone via Volto, you'll need to configure Plone to access the hostname that's visible in the ipad as a acceptable for CORS purposes. Maybe you'll have to setup setup apache and serve via an internal hostname.

... if you want to access the RESTAPI:

localhost:8080/Plone1/++api++/@yourentrypoint
or
localhost:8080/Plone2/++api++/@yourentrypoint

I did not state that I want to access the server from my laptop, ipad etc ( As far as I know, I can not access http://10.0.0.something:3000

In the case you want to access your server with e.g. ip 10.0.0.123 you must tell your wsgi server to listen to this ip (not to localhost or 127.0.0.1).

In your .../etc/zope.ini change localhost to 10.0.0.123 (or simply to *)

...
[server:main]
...
# listen = localhost:8080
# listen = *:8080
listen = 10.0.0.123:8080
...

And for Volto:

HOST=10.0.0.123 PORT=4000 yarn start

Alternatively, listen to all IPs at once if this is an option. This is handy with DHCP in place.

listen = 0.0.0.0:8080

0.0.0.0 will listen to all available IPv4 addresses, but not IPv6!
Use * to listen to all available IP addresses, both IPv4 and IPv6

Indeed, but since I always use IPv4 on my local network it never caught me.

Should these edits be done in a file (frankly, I feel like there are a lot of config files everywhere, and almost impossible for someone that is not an experienced programmer to test Plone 'locally').

you can use the .env.development file for that.

impossible for someone that is not an experienced programmer to test Plone 'locally'

You're not "just testing locally", you want to use two separate machines, multiple Plone sites and multiple Volto frontends, each on a separate port. It is an obvious non-standard scenario.

The scenario you want to use is indeed not quite standard.

You are not simply installing the Plone dependencies (aka pip install) but you are installing a non trivial constellation of servers (ZEO, WSGI, Node etc.). Those servers must be configured to know each other and (in your case) must be reachable from another machine. Furthermore you want multiple instances of those.

Configuring a such constellation is not too complicated but every piece must know at least the ip and port of the other pieces it is talking or listening to. This is usually done in the different configuration files.

A container (docker) installation might be a choice to consider. It is pretty configurable and gives you the chance to "test locally".

If you need a different architecture (e.g. installing from the packages) you must cope with the configuration details.

Do not hesitate to ask for help. You will get it here.

In case you consider to give docker a try. Here is an example that runs one backend (with one or more Plone Sites) and two different frontends.

The following will create and run a container with a plone-backend and a Plone Site "Plone1"

sudo docker run \
    --name mybackend \
    -e SITE=Plone1 \
    -e CORS_ALLOW_ORIGIN='*' \
    -d \
    -p 8080:8080 \
    plone/plone-backend:6.0

The following command will create and run a container with a plone-frontend to access your Plone Site "Plone1". This container will internally run on port 3000 but will publish it on port 3001 to the host.

sudo docker run \
    --name myfrontend1 \
    --link mybackend:backend \
    -e RAZZLE_API_PATH=http://localhost:8080/Plone1 \
    -e RAZZLE_INTERNAL_API_PATH=http://backend:8080/Plone1 \
    -d \
    -p 3001:3000 \
    plone/plone-frontend:latest

You can access your Volto Site "Plone 1" with http://10.0.0.123:3001.

If you want a second Plone Site, visit your browser http://10.0.0.123:8080/ and create a second Plone Site "Plone2" (not a Classic UI if you want to access it via Volto)

The following command will create and run a container with a plone-frontend to access your Plone Site "Plone2". This container will internally run on port 3000 but will publish it on port 3002 to the host.

sudo docker run \
    --name myfrontend2 \
    --link mybackend:backend \
    -e RAZZLE_API_PATH=http://localhost:8080/Plone2 \
    -e RAZZLE_INTERNAL_API_PATH=http://backend:8080/Plone2 \
    -d \
    -p 3002:3000 \
    plone/plone-frontend:latest

You can access your Volto Site "Plone 2" with http://10.0.0.123:3002.

As a side note:

RAZZLE_API_PATH and RAZZLE_INTERNAL_API_PATH are "the classic way" of connecting to Volto to the Plone backend. The new way, the "seamless mode", while developing, declares that "Volto is the api path" and uses the Volto nodejs express server to provide a proxy to the backend Plone. To use the seamless mode, no longer declare the RAZZLE_API_PATH / RAZZLE_INTERNAL_API_PATH and instead use the RAZZLE_DEV_PROXY_API_PATH=http://localhost:8080/Plone2 environment variable.

1 Like

It feels like there is an endless list of new technologies that needs to be mastered before making anything with volto,

Currently, I cant even log in with 1 site (CORRS, maybe), feel like giving up and stay with classic and Mosaic.

Just to make it sure: should both RAZZLE_API_PATH and RAZZLE_INTERNAL_API_PATH be avoided and replaced with RAZZLE_DEV_PROXY_API_PATH as follows? I have changed the ip to access it from another machine.

sudo docker run \
    --name myfrontend2 \
    --link mybackend:backend \
    -e RAZZLE_DEV_PROXY_API_PATH=http://10.0.0.123:8080/Plone2 \
    -d \
    -p 3002:3000 \
    plone/plone-frontend:latest

Should RAZZLE_API_PATH and RAZZLE_INTERNAL_API_PATH nonetheless be used in productive environments instead?

@mekell we still use both in production just fine. But they're not needed for production, if you follow the setup for the "seamless mode", where the browser connect directly to Plone helped by a special nginx rewrite rule, for the ++api++ paths.

For development Volto acts as a proxy for the ++api++ paths, so that's why it needs to know, in case you have a non-standard setup, how to connect to Plone. The standard setup is http://localhost:8080/Plone.

@mekell I've never tried the plone-frontend docker image. But your setup looks fine. I'm more used to docker-compose setup, though, I find them easier to understand. I'd rather have an .yml file than a bunch of flags and switches.