Virtual domains ?

Started by Kris Van Hulleabout 25 years ago9 messagesgeneral
Jump to latest
#1Kris Van Hulle
uxs@compulink.gr

Hi.

Does PostgreSQL have support for virtual domains ? And if so, how
can i set it up ? (relevant documentation, ...)

Thnx

Kris

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kris Van Hulle (#1)
Re: Virtual domains ?

"Kris Van Hulle" <uxs@compulink.gr> writes:

Does PostgreSQL have support for virtual domains ?

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

regards, tom lane

#3Kris Van Hulle
uxs@compulink.gr
In reply to: Tom Lane (#2)
Re: Virtual domains ?

On 3 Apr 2001, at 10:31, Tom Lane wrote:

"Kris Van Hulle" <uxs@compulink.gr> writes:

Does PostgreSQL have support for virtual domains ?

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into. Every domain points to the same IP-
address, and the server is on that address.

So, for example, one user connects to the server at
company1.com, and another to the one at company2.com, and
they see a different content, allthough the servers are actually the
same; it's only faking that they're different. (both company1.com
and company2.com point to to same IP)

This is possible for http and ftp-servers, and email (allthough that
seems a bit more difficult), so I was wondering if it was possible for
SQL servers.

Kris

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kris Van Hulle (#3)
Re: Virtual domains ?

"Kris Van Hulle" <uxs@compulink.gr> writes:

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into.

So use a different database for each "domain".

regards, tom lane

#5Matthew
matt@ctlno.com
In reply to: Tom Lane (#4)
RE: Virtual domains ?

Does PostgreSQL have support for virtual domains ?

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into.

[snip]

I thought there were patches that allowed this to work. So that
different users could have their own copy of postgre running. I would very
much like this also since that would prevent problems with one database
effecting other databases. I know with 7.1 you can specify the unix socket
file location along with a specific port.

#6Noname
fabrizio.ermini@sysdat.it
In reply to: Tom Lane (#4)
Re: Virtual domains ?

"Kris Van Hulle" <uxs@compulink.gr> writes:

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into.

So use a different database for each "domain".

You could bind postmaster to different ports for each domain,
possibly even with different $PGDATA. So you will have

server 1: www.server1.com, port 5432, user whatever, tablespace
whatever

server 2: www.server2.com, port 5433, user whatever, tablespace
whatever

...and so on...

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini@tin.it
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini@sms.tin.it

#7will trillich
will@serensoft.com
In reply to: Kris Van Hulle (#3)
Re: Virtual domains ?

On Tue, Apr 03, 2001 at 05:41:54PM +0300, Kris Van Hulle wrote:

On 3 Apr 2001, at 10:31, Tom Lane wrote:

"Kris Van Hulle" <uxs@compulink.gr> writes:

Does PostgreSQL have support for virtual domains ?

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into. Every domain points to the same IP-
address, and the server is on that address.

So, for example, one user connects to the server at
company1.com, and another to the one at company2.com, and
they see a different content, allthough the servers are actually the
same; it's only faking that they're different. (both company1.com
and company2.com point to to same IP)

This is possible for http and ftp-servers, and email (allthough that
seems a bit more difficult), so I was wondering if it was possible for
SQL servers.

from what i know of this, the reason HTTP works with virtual
domains is because the recent web browsers know to send a HOST:
mime header with their requests to the http servers. older web
browsers don't include any such HOST: field, and so wind up
getting the default domain for whatever IP they're requesting
from. (serensoft.com -- to use my example -- serves
dontUthink.com and others; without the HOST: field, my server
will never know to delve into the dontUthink.com document tree,
and would return serensoft.com stuff by default.)

so postgres would then <if guess is correct> need to accomodate
the mime fields in a similar fashion, and clients would need to
generate them, likewise.

probably.

--
americans should never read anything so subversive as what's at
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

#8Joel Burton
jburton@scw.org
In reply to: will trillich (#7)
Re: Virtual domains ?

On Mon, 9 Apr 2001, will trillich wrote:

On Tue, Apr 03, 2001 at 05:41:54PM +0300, Kris Van Hulle wrote:

On 3 Apr 2001, at 10:31, Tom Lane wrote:

"Kris Van Hulle" <uxs@compulink.gr> writes:

Does PostgreSQL have support for virtual domains ?

In 7.1 you can configure the postmaster to bind only to one specific IP
address, if that helps.

Not really. I want to set up one SQL server, which should have a
different tablespace, userspace, whatever, depending on which
domain the user logs into. Every domain points to the same IP-
address, and the server is on that address.

So, for example, one user connects to the server at
company1.com, and another to the one at company2.com, and
they see a different content, allthough the servers are actually the
same; it's only faking that they're different. (both company1.com
and company2.com point to to same IP)

This is possible for http and ftp-servers, and email (allthough that
seems a bit more difficult), so I was wondering if it was possible for
SQL servers.

from what i know of this, the reason HTTP works with virtual
domains is because the recent web browsers know to send a HOST:
mime header with their requests to the http servers. older web
browsers don't include any such HOST: field, and so wind up
getting the default domain for whatever IP they're requesting
from. (serensoft.com -- to use my example -- serves
dontUthink.com and others; without the HOST: field, my server
will never know to delve into the dontUthink.com document tree,
and would return serensoft.com stuff by default.)

so postgres would then <if guess is correct> need to accomodate
the mime fields in a similar fashion, and clients would need to
generate them, likewise.

If you have a shortage of machines, but not of IP addresses, you can bind
multiple IP addresses to the same physical network device. A ipchains (or
whatever your OS calls it) script could then redirect requests for
192.168.0.1 to port X, and requests for 192.168.0.2 to port Y, which
different postmasters could hear.

(Even though many people virtual masquerade w/the same IP, if you have an
IP to spare, you should do this for web serving too, as it gives you a way
to make the (dwindling number of) HTTP/1.0 clients happy.

--
Joel Burton <jburton@scw.org>
Director of Information Systems, Support Center of Washington

#9Dominic J. Eidson
sauron@the-infinite.org
In reply to: Joel Burton (#8)
Re: Re: Virtual domains ?

On Mon, 9 Apr 2001, Joel Burton wrote:

[snip]

(Even though many people virtual masquerade w/the same IP, if you have an
IP to spare, you should do this for web serving too, as it gives you a way
to make the (dwindling number of) HTTP/1.0 clients happy.

What we decided to do, is create a new database for each virtualhost user
who buys the DB add-on to his service. It's still all one PostgreSQL
installation, just different logical databases that they connect to.

Problem solved.

--
Dominic J. Eidson
"Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/ http://www.the-infinite.org/~dominic/