Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"From there to here, from here to there, funny things are everywhere." -- Dr. Seuss


devel / comp.lang.python / Running two separate servers (was Re: venv questions)

SubjectAuthor
o Running two separate servers (was Re: venv questions)Chris Angelico

1
Running two separate servers (was Re: venv questions)

<mailman.372.1661829373.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19379&group=comp.lang.python#19379

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Running two separate servers (was Re: venv questions)
Date: Tue, 30 Aug 2022 13:16:00 +1000
Lines: 34
Message-ID: <mailman.372.1661829373.20444.python-list@python.org>
References: <fdedd484-da4d-5663-26f1-3ef6019d94a2@shentel.net>
<CAPTjJmr5ynuN0OUSyEPoKYWtiu3vnhRjnjYD7Ls9Sxnn7jGAVg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de A/ULPUvHLliPyzeMO8CzRg68WMsur4nodvH6zsofuqAQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=IxixHi05;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.028
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; '2022': 0.05; 'aug': 0.07;
'subject:two': 0.09; 'problem.': 0.15; '5000': 0.16; 'chrisa':
0.16; 'easiest': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'heskett': 0.16; 'invoke': 0.16; 'part.': 0.16;
'subject:questions': 0.16; 'thread.': 0.16; 'variable,': 0.16;
'wrote:': 0.16; "can't": 0.17; 'addresses': 0.19; 'tue,': 0.19;
'to:addr:python-list': 0.20; 'code': 0.23; 'run': 0.23;
'anything': 0.25; 'configure': 0.26; 'port': 0.26; 'environment':
0.29; 'else,': 0.32; 'to:name:python': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "i'm": 0.33; 'able': 0.34;
'same': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'processes': 0.36; 'change':
0.36; 'received:209.85': 0.37; 'way': 0.38; 'could': 0.38;
'means': 0.38; 'received:209': 0.39; 'two': 0.39; 'mentioned':
0.39; 'received:209.85.208': 0.39; 'setting': 0.39; 'use': 0.39;
'methods': 0.39; 'both': 0.40; 'want': 0.40; 'should': 0.40;
'method': 0.61; 'browser': 0.64; 'down': 0.64; 'your': 0.64; 'url-
ip:lookup error': 0.70; 'depending': 0.70; "you'll": 0.73; 'are;':
0.84; 'bind': 0.84; 'cooperate': 0.84; 'poking': 0.84; 'realise':
0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc; bh=rDSGvityE7YzvSaQVWUbqvjgaWd4zr/CFocMEwMYSDI=;
b=IxixHi051aqY/PDMsEUm2ZK6IqZfIOUE9ugPsjUVOpZpoBCRfy0qpMn4EzNaIqzE2x
yIrofJ2BUaIx2d/+sKaIULB1FWNqcE2EMiUktfEYjHn2k6wj61djPt0x/a5CwPf8Em7V
LdXdbhs1Hseg2w4pfMsH8wMu5n69t10aRkEhXhYtklvR1kVLhaozCT711WLLBrk489eA
zZSdQ9Cz8C1p3m0whPnEr7PXi+Kz+B30rIeTfMZA5237drNdUEStxhm59GtOMT+EW2RA
U4T3oCfVwJyu4mAln2V8qsePlP8frvxkJ6bqtTq3dxigUfm9iC6dMTk6JdPXtfB1id6h
FKlw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc;
bh=rDSGvityE7YzvSaQVWUbqvjgaWd4zr/CFocMEwMYSDI=;
b=TzKtZnO3s56ZtpkhCto4JIZJ9H8P9hO2Tel3m0iHzPOfxcIfjmpUSPXGoJj5H1tQL5
f4azpf0AIlzh+CvP+FqLHCQbv7iQgP/0tddY3WZG+U8/i4l8ZM4OrNSOhURkz61YOSs2
vLXaaEcBf0eoN62ROLs3NTaiqJTqxA4Q4rEpdeSXSN16KlJoT3wqeSG0IBE5CS/84IgH
Ics7V9B7PxfZ4HxW83aP4ava46t7uWK1vPU4LWDCI2qQ4EKiOZLRZHdLyL37id/vrBhi
BzpmLguV/pAZDgQ+3JRQm4vCr58AcQA2ofr8v9a61WaGf+W3B/avjNFwxud88SlIMGiR
FvXg==
X-Gm-Message-State: ACgBeo2UhM47uwvojjMHRYTeTLgNAXVx7kA9yoTttqAccK5i34G7c8ra
yVmOTl+GrBl1Q18ddLG4Li2jCqtYblCMZkWomI2GtHo2
X-Google-Smtp-Source: AA6agR5zameJXVspIXhuml6jr/ioERK56RCCl/fFhsAWDlHMDg3i4LMXse6oN6zde/2I8tlg/Dg5OfyOjDdsQpk8VVw=
X-Received: by 2002:aa7:d385:0:b0:447:d5ec:d452 with SMTP id
x5-20020aa7d385000000b00447d5ecd452mr15283776edq.231.1661829371426; Mon, 29
Aug 2022 20:16:11 -0700 (PDT)
In-Reply-To: <fdedd484-da4d-5663-26f1-3ef6019d94a2@shentel.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmr5ynuN0OUSyEPoKYWtiu3vnhRjnjYD7Ls9Sxnn7jGAVg@mail.gmail.com>
X-Mailman-Original-References: <fdedd484-da4d-5663-26f1-3ef6019d94a2@shentel.net>
 by: Chris Angelico - Tue, 30 Aug 2022 03:16 UTC

On Tue, 30 Aug 2022 at 12:59, gene heskett <gheskett@shentel.net> wrote:
>
> 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?

This is nothing to do with venvs, so I'm forking the thread.

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor