But that might create another problem. how to differentiate the servers,
both of which
will want to use localhost:5000 to serve up their web pages we run
things with.
Suggested solutions?
On Tue, 30 Aug 2022 at 12:59, gene heskett <gheskett@shentel.net> wrote:That is a limitation I'd druther not have to deal with Chris. I want two separate octoprint servers running with no interaction between them.
But that might create another problem. how to differentiate the servers,This is nothing to do with venvs, so I'm forking the thread.
both of which
will want to use localhost:5000 to serve up their web pages we run
things with.
Suggested solutions?
By far the easiest way to differentiate them is to NOT have them both
on localhost:5000. Depending on how you invoke the servers, you should
be able to find a way to configure one (or both) of them to a
different port; common methods include a "--port" argument, setting
the PORT environment variable, and poking in the code to find the
number 5000 and changing it to some other value.
(Less common methods include poking in ctypes to find the number 5000
and changing it to some other value. Mentioned only because I realise
the alternative interpretation of my previous comment.)
Another method would be to change the "localhost" part. The standard
for IP addresses is that 127.x.y.z means localhost, regardless of what
x, y, and z are; so you could have one of them bind to 127.0.0.2 and
the other to 127.0.0.3, which you could then use in your browser the
same way (http://127.0.0.2:5000/ and http://127.0.0.3:5000/
respectively).
But if you can't change anything else, you'll have to make the two
processes cooperate in some way, or worst case, just make sure you
shut one down before you start the other up.
ChrisA
So I'm thinking of venv's named rock64prusa, and rock64ender5+, each with "port#" on my local net. So chromium could have two tabs open, one to localhost:5000 and one to localhost:5001, totally independent of each other.
On Tue, 30 Aug 2022 at 19:51, gene heskett <gheskett@shentel.net> wrote:The short script as /etc/default/octoprint has that PORT item. I see no
So I'm thinking of venv's named rock64prusa, and rock64ender5+, each withAs I said, that has absolutely nothing to do with venvs, so you'd have
"port#" on my local net. So chromium could have two tabs open, one to
localhost:5000 and one to localhost:5001, totally independent of each other. >>
to figure out how to change their port numbers independently.
(Although you could probably add an env var to the venv's activation
script, if that would help.)
ChrisA
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 62:09:19 |
Calls: | 6,712 |
Files: | 12,244 |
Messages: | 5,355,895 |