Обсуждение: Unable to start server - winxp

Поиск
Список
Период
Сортировка

Unable to start server - winxp

От
Joost Kuckartz
Дата:
Hello,
 
After a huge amount of trying out (I'm new at running webservers, I had a lot of problems installing apache too) I finally was able to install postpresql 8.2 (latest version) on my computer. What I want to do in the end is have a local webserver running. I installed ms4w (package with php, mapserver, apache) and I had to change the httpd.conf port to 81 (80 is in use by I-don't-know-what, I can't see that)
 
Well, I installed the .msi, and I had no idea that the "account" settings had to be left intact. First I thought I could change it, but then it installed and always gave the error "user already exists" (while in the install was asked to create the new user...)
 
Ok, so I left all ok, left the computer name there, and created the new standard username "postgres". Now I can't start the server, it will say I have to start it not as administrator. Well, I only have one useraccount here and I'm not planning on switching useraccounts just to run postgresql, or change my account so I don't have admin rights anymore.
 
How do I start it? After that the problems of configuring it with Apache will follow, but first this.
 
I can't compile, and I'm not planning to either. If I had a dedicated server I probably would run linux or unix or something which can handle better with webservers anyway. Can somebody help me? Thanks!
 
-Joost


Probeer Live.com: je eigen persoonlijke opstartpagina met alleen de dingen die jij belangrijk vindt op één plek. binnen één omgeving.

Re: Unable to start server - winxp

От
Richard Huxton
Дата:
Joost Kuckartz wrote:
> Hello,
>
> After a huge amount of trying out (I'm new at running webservers, I
> had a lot of problems installing apache too) I finally was able to
> install postpresql 8.2 (latest version) on my computer. What I want
> to do in the end is have a local webserver running. I installed ms4w
> (package with php, mapserver, apache) and I had to change the
> httpd.conf port to 81 (80 is in use by I-don't-know-what, I can't see
> that)

Stop. Find out what is on port 80 and how to disable it before going
further. If you don't know what your computer is doing, how can you hope
to run a reliable system?

You probably want to read up on "netstat" and "process explorer" and
"IIS" to start with.

> Well, I installed the .msi, and I had no idea that the "account"
> settings had to be left intact. First I thought I could change it,
> but then it installed and always gave the error "user already exists"
> (while in the install was asked to create the new user...)

Hmm - does the manual not cover details about why PostgreSQL wants to
run as a separate user?

> Ok, so I left all ok, left the computer name there, and created the
> new standard username "postgres". Now I can't start the server, it
> will say I have to start it not as administrator. Well, I only have
> one useraccount here and I'm not planning on switching useraccounts
> just to run postgresql, or change my account so I don't have admin
> rights anymore.

You can start it as anyone, but you should run it as a non-administrator
account. Do you understand how user-accounts and services on Windows work?

> How do I start it? After that the problems of configuring it with
> Apache will follow, but first this.

You don't. PostgreSQL will NOT run as an administrator account. It
doesn't need to and it's a security hole if it does so. You should be
able to start the service as an administrator just fine.

> I can't compile, and I'm not planning to either. If I had a dedicated
> server I probably would run linux or unix or something which can
> handle better with webservers anyway. Can somebody help me? Thanks!

I think you're mis-reading the error message. You can start it as an
administrator, and it should run as user "postgres". The only thing I
can think is that user "postgres" somehow has some administrator rights
and that is why its complaining.

In any case, to get a more accurate answer you'll need to provide the
exact error message and what you were doing when it happened.

PS - you can hire "virtual" linux servers quite cheaply which will let
you play around with setting up all sort of packages.

--
   Richard Huxton
   Archonet Ltd

Re: Unable to start server - winxp

От
Joost Kuckartz
Дата:
Hello all,
 
I changed port 80 again, so localhost is now running on that.
 
I checked all the manuals, which were mostly written for linux and unix based systems. The only command I found was "postmaster -D database". When I try that, I'm getting the following error:
"Execution of PostgreSQL by a user with administrative permissions is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromises. See the documentation for more information on how to properly start the server."
 
Well, the documentation doesn't say anything on how to start the server as another user. I only have one user account on my winxp (if it's that one PostgreSQL is looking at) and I don't want to switch to another user (create even one) to start the postgres server. If it's a user account at the postgres system, how do I create a new user there if the server can't start? Does anyone know how I do start the server?


Please help, Thanks,
Joost




> Date: Wed, 20 Dec 2006 07:11:58 +0000
> From: dev@archonet.com
> To: jkuckartz1984@hotmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Unable to start server - winxp
>
> Joost Kuckartz wrote:
> > Hello,
> >
> > After a huge amount of trying out (I'm new at running webservers, I
> > had a lot of problems installing apache too) I finally was able to
> > install postpresql 8.2 (latest version) on my computer. What I want
> > to do in the end is have a local webserver running. I installed ms4w
> > (package with php, mapserver, apache) and I had to change the
> > httpd.conf port to 81 (80 is in use by I-don't-know-what, I can't see
> > that)
>
> Stop. Find out what is on port 80 and how to disable it before going
> further. If you don't know what your computer is doing, how can you hope
> to run a reliable system?
>
> You probably want to read up on "netstat" and "process explorer" and
> "IIS" to start with.
>
> > Well, I installed the .msi, and I had no idea that the "account"
> > settings had to be left intact. First I thought I could change it,
> > but then it installed and always gave the error "user already exists"
> > (while in the install was asked to create the new user...)
>
> Hmm - does the manual not cover details about why PostgreSQL wants to
> run as a separate user?
>
> > Ok, so I left all ok, left the computer name there, and created the
> > new standard username "postgres". Now I can't start the server, it
> > will say I have to start it not as administrator. Well, I only have
> > one useraccount here and I'm not planning on switching useraccounts
> > just to run postgresql, or change my account so I don't have admin
> > rights anymore.
>
> You can start it as anyone, but you should run it as a non-administrator
> account. Do you understand how user-accounts and services on Windows work?
>
> > How do I start it? After that the problems of configuring it with
> > Apache will follow, but first this.
>
> You don't. PostgreSQL will NOT run as an administrator account. It
> doesn't need to and it's a security hole if it does so. You should be
> able to start the service as an administrator just fine.
>
> > I can't compile, and I'm not planning to either. If I had a dedicated
> > server I probably would run linux or unix or something which can
> > handle better with webservers anyway. Can somebody help me? Thanks!
>
> I think you're mis-reading the error message. You can start it as an
> administrator, and it should run as user "postgres". The only thing I
> can think is that user "postgres" somehow has some administrator rights
> and that is why its complaining.
>
> In any case, to get a more accurate answer you'll need to provide the
> exact error message and what you were doing when it happened.
>
> PS - you can hire "virtual" linux servers quite cheaply which will let
> you play around with setting up all sort of packages.
>
> --
> Richard Huxton
> Archonet Ltd
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq



Met MSN Spaces kun je per e-mail je weblog bijwerken. Publiceer leuke verhalen, foto's en meer! Het is gratis! Het is gratis!

Re: Unable to start server - winxp

От
"Filip Rembiałkowski"
Дата:
2006/12/22, Joost Kuckartz <jkuckartz1984@hotmail.com>:
> I only have one user account on my winxp (if it's that one
> PostgreSQL is looking at) and I don't want to switch to another user (create
> even one) to start the postgres server.

If you don't want to create another user account (why?),
then you will have to change the account that you are using to
"standard" or "unprivileged" user. Use the power of Control Panel.

I can't understand why you didn't follow the standard installer (MSI
package) way of setting things up.


--
Filip Rembiałkowski

Re: Unable to start server - winxp

От
Joost Kuckartz
Дата:
 
> 2006/12/22, Joost Kuckartz <jkuckartz1984@hotmail.com>:
> > I only have one user account on my winxp (if it's that one
> > PostgreSQL is looking at) and I don't want to switch to another user (create
> > even one) to start the postgres server.
>
> If you don't want to create another user account (why?),
> then you will have to change the account that you are using to
> "standard" or "unprivileged" user. Use the power of Control Panel.

 
Why? Because I want to work with only one user on my computer, which is me. I want to be able to run everything as admin, because then I've got control over everything I do. It's my own computer and I want to be able to change whatever I want. I could understand if more people use your computer, you set up multiple users an add restrictions like not editing other peoples files. I'm the only user, I always used 98, and there you had the ability to change all, and you didn't even had users. That was ok with me, I don't need all those fancy winxp users, all those (very iritating) winxp "documents and settings", "my music" etc. folders. So I hid that far away.
 
So there's no other way to start the server else than to create an unpriviledged winxp user account, or change my user account (and forever not be able to install programs, change settings etc etc.)? There must be, I can't imagine postgresql is in backwards world: making the admin less priviledged than an unpriviledged user.

> I can't understand why you didn't follow the standard installer (MSI
> package) way of setting things up.
>

Actually, I did. I didn't change any of the settings pre-given, but still I can't start the postgresql server. The installer refused to initiate the server though, because it's on FAT32. But for that I used the initdb.exe.
 
> --
> Filip Rembiałkowski
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend


-Joost




> Date: Fri, 22 Dec 2006 12:12:33 +0100
> From: plk.zuber@gmail.com
> To: jkuckartz1984@hotmail.com
> Subject: Re: [GENERAL] Unable to start server - winxp
> CC: pgsql-general@postgresql.org
>
> 2006/12/22, Joost Kuckartz <jkuckartz1984@hotmail.com>:
> > I only have one user account on my winxp (if it's that one
> > PostgreSQL is looking at) and I don't want to switch to another user (create
> > even one) to start the postgres server.
>
> If you don't want to create another user account (why?),
> then you will have to change the account that you are using to
> "standard" or "unprivileged" user. Use the power of Control Panel.
>
> I can't understand why you didn't follow the standard installer (MSI
> package) way of setting things up.
>
>
> --
> Filip Rembiałkowski


Probeer Live.com: je eigen persoonlijke opstartpagina met alleen de dingen die jij belangrijk vindt op één plek. binnen één omgeving.

Re: Unable to start server - winxp

От
"Joshua D. Drake"
Дата:
> So there's no other way to start the server else than to create an
> unpriviledged winxp user account, or change my user account (and
> forever not be able to install programs, change settings etc etc.)?
> There must be, I can't imagine postgresql is in backwards world:
> making the admin less priviledged than an unpriviledged user.
>

I think you are missing the point here. We are not going to give you a
foot gun. :). Secondly, having the second user DOES NOT mean you can't
use your user. It just means, when you connect to postgresql you will
use the unprivealged user to do so. You can do this *as* your normal
user.

PgAdmin will ask you for a user and password when you start the program.
As your *normal* user, just use the username and password of the non
privealged user.

This is really not a big deal.

Sincerely,

Joshua D. Drake




> > I can't understand why you didn't follow the standard installer (MSI
> > package) way of setting things up.
> >
>
> Actually, I did. I didn't change any of the settings pre-given, but
> still I can't start the postgresql server. The installer refused to
> initiate the server though, because it's on FAT32. But for that I used
> the initdb.exe.
>
> > --
> > Filip Rembiałkowski
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 6: explain analyze is your friend
>
>
> -Joost
>
>
>
>
> ______________________________________________________________________
> > Date: Fri, 22 Dec 2006 12:12:33 +0100
> > From: plk.zuber@gmail.com
> > To: jkuckartz1984@hotmail.com
> > Subject: Re: [GENERAL] Unable to start server - winxp
> > CC: pgsql-general@postgresql.org
> >
> > 2006/12/22, Joost Kuckartz <jkuckartz1984@hotmail.com>:
> > > I only have one user account on my winxp (if it's that one
> > > PostgreSQL is looking at) and I don't want to switch to another
> user (create
> > > even one) to start the postgres server.
> >
> > If you don't want to create another user account (why?),
> > then you will have to change the account that you are using to
> > "standard" or "unprivileged" user. Use the power of Control Panel.
> >
> > I can't understand why you didn't follow the standard installer (MSI
> > package) way of setting things up.
> >
> >
> > --
> > Filip Rembiałkowski
>
>
> ______________________________________________________________________
> Probeer Live.com: je eigen persoonlijke opstartpagina met alleen de
> dingen die jij belangrijk vindt op één plek. binnen één omgeving.
--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate




Re: Unable to start server - winxp

От
Magnus Hagander
Дата:
> So there's no other way to start the server else than to create an
> unpriviledged winxp user account, or change my user account (and forever
> not be able to install programs, change settings etc etc.)? There must
> be, I can't imagine postgresql is in backwards world: making the admin
> less priviledged than an unpriviledged user.

Taking a peek back through the archives on this, let me just add one
piece of information: You *can* start the server from an admin account,
but you have to start it with pg_ctl (or as a service). You can *not*
start it by directly executing postmaster.exe. This is because you can
only give up privileges permanently if you cross a process creation
boundary, which pg_ctl does.

Oh, and this is only in 8.2 of course - for 8.1 and earlier you have to
use a non-admin account.

>> I can't understand why you didn't follow the standard installer (MSI
>> package) way of setting things up.
>>
>
> Actually, I did. I didn't change any of the settings pre-given, but
> still I can't start the postgresql server. The installer refused to
> initiate the server though, because it's on FAT32. But for that I used
> the initdb.exe.

If you're running on FAT32, you are doing yourself a *major* disservice.
But it's your choice.
Beware that there are some things that don't work on FAT32. For example,
tablespaces won't work. I can't recall offhand if there is anything
else, but you're certainly at a *much* larger risk of issues with that
choice.

//Magnus

Re: Unable to start server - winxp

От
Joost Kuckartz
Дата:
Thanks for all the help guys,
I actually found the problem and solution.
 
Maybe for others who will have this, let me recap:
- While installing the msi file I had to disable the initialization in the installer, because of installation on a FAT32 partition
- I then ran the initdb.exe, typing in my own database directory in the commandline using "initdb -D databasedir"
- I then wanted to start the postgresql server using the command "postgres -D database" , where 'database' is the directory
- I got an error I can't run as an admin, but a unpriviledged user needs to start it.
 
The solution:
- in the initdb.exe, always type "initdb -D ../data", and no other directory. Reason: the service installed in windows xp always points to the data folder within the postgres installation directory. I haven't found a way to change that, so I just run initdb for that dir. Then start the service in the windows service panel (configuration - system control - services - postgresql)
 
Extra information: Within the installer, the first 'account name' you encounter is the new windows service user account created. The second 'user' in the installer is the superuser for accessing the database.
 
------
For me this was a long way of founding out, but now I did and I could access the database. So maybe a lot think now I'm a noob with accounts and users and stuff - well maybe I am. I never installed one before, it always was available for me on the webserver I use. But now I need to work a lot with postGIS and mapserver and it's better to do that offline, so that's the reason I jumped into installing it myself.

Looking at your answers you think I had a complete other problem. About postmaster.exe - I don't even know where to find that one. Windows found that one himself when the service was installed I suppose.

-Joost




> Date: Fri, 22 Dec 2006 18:39:38 +0100
> From: magnus@hagander.net
> To: jkuckartz1984@hotmail.com
> CC: plk.zuber@gmail.com; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Unable to start server - winxp
>
> > So there's no other way to start the server else than to create an
> > unpriviledged winxp user account, or change my user account (and forever
> > not be able to install programs, change settings etc etc.)? There must
> > be, I can't imagine postgresql is in backwards world: making the admin
> > less priviledged than an unpriviledged user.
>
> Taking a peek back through the archives on this, let me just add one
> piece of information: You *can* start the server from an admin account,
> but you have to start it with pg_ctl (or as a service). You can *not*
> start it by directly executing postmaster.exe. This is because you can
> only give up privileges permanently if you cross a process creation
> boundary, which pg_ctl does.
>
> Oh, and this is only in 8.2 of course - for 8.1 and earlier you have to
> use a non-admin account.
>
> >> I can't understand why you didn't follow the standard installer (MSI
> >> package) way of setting things up.
> >>
> >
> > Actually, I did. I didn't change any of the settings pre-given, but
> > still I can't start the postgresql server. The installer refused to
> > initiate the server though, because it's on FAT32. But for that I used
> > the initdb.exe.
>
> If you're running on FAT32, you are doing yourself a *major* disservice.
> But it's your choice.
> Beware that there are some things that don't work on FAT32. For example,
> tablespaces won't work. I can't recall offhand if there is anything
> else, but you're certainly at a *much* larger risk of issues with that
> choice.
>
> //Magnus



Probeer Live.com: je eigen persoonlijke opstartpagina met alleen de dingen die jij belangrijk vindt op één plek. binnen één omgeving.

Re: Unable to start server - winxp

От
Magnus Hagander
Дата:
Joost Kuckartz wrote:
> Thanks for all the help guys,
> I actually found the problem and solution.
>
> Maybe for others who will have this, let me recap:
> - While installing the msi file I had to disable the initialization in
> the installer, because of installation on a FAT32 partition
> - I then ran the initdb.exe, typing in my own database directory in the
> commandline using "initdb -D databasedir"
> - I then wanted to start the postgresql server using the command
> "postgres -D database" , where 'database' is the directory
> - I got an error I can't run as an admin, but a unpriviledged user needs
> to start it.

Right. This is where you have to use pg_ctl if you want to start it from
the commandline. (If you look at the entry in the services list, you
will see that it starts the service using pg_ctl)


> The solution:
> - in the initdb.exe, always type "initdb -D ../data", and no other
> directory. Reason: the service installed in windows xp always points to
> the data folder within the postgres installation directory. I haven't
> found a way to change that, so I just run initdb for that dir. Then
> start the service in the windows service panel (configuration - system
> control - services - postgresql)

You can change this during the install by clicking the "Data directory"
entry and change the location for it.
If you want to change it after you've installed, you are unfortunately
currently restricted to using the registry editor, or to unregister and
re-register the service.


> ------
> For me this was a long way of founding out, but now I did and I could
> access the database. So maybe a lot think now I'm a noob with accounts
> and users and stuff - well maybe I am. I never installed one before, it
> always was available for me on the webserver I use.

Let us know if there is any specific portion of the documentation that
you think should be improved to make this easier for others - and
preferably how it should be improved as well ;-)

> Looking at your answers you think I had a complete other problem. About
> postmaster.exe - I don't even know where to find that one. Windows found
> that one himself when the service was installed I suppose.

Ah, my bad. Prior to 8.2 there was both postmaster.exe and postgres.exe.
In 8.2 they were unified into one binary called postgres.exe. I
temporarily forgot about that.


//Magnus