PostgreSQL无法启动:"server.key"拥有群组或世界访问权限 [英] PostgreSQL won't start: "server.key" has group or world access
问题描述
每当我使用以下命令启动PostgreSQL时:
Whenerver I start PostgreSQL using command:
$ sudo /etc/init.d/postgresql start
Pg无法启动.报告的错误是:
Pg doesn't start up. The error reported is:
* Starting PostgreSQL 8.4 database server
* The PostgreSQL server failed to start. Please check the log output:
2010-01-21 22:10:00 PST FATAL: private key file "server.key" has group or world access
2010-01-21 22:10:00 PST DETAIL: File must be owned by the database user or root, must have no write permission for "group", and must have no permissions for "other".
...,当我尝试以postgres
用户身份访问psql
时:
... and when I try to access psql
as the postgres
user with:
$ sudo su postgres
$ psql
它给我一个错误:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
推荐答案
我已经使用..
1)输入相关目录(使用>找到server.key)
1) Enter the relevant directory (use> locate server.key)
2)备份旧的server.key链接.
2) Back up old server.key link.
3)将ssl-cert-snakeoil.key复制到server.key
3) Copy ssl-cert-snakeoil.key to server.key
4-5)更改其所有者&分组到postgres
4-5) Change its owner & group to postgres
6)确保权限为700或740(根据错误消息的要求)
6) Ensure the permissions are 700 or 740 (as requested by error message)
我的Ubuntu 12.04&的配方PostgreSQL 8.3:
Recipe for my Ubuntu 12.04 & postgresql-8.3:
sudo cd /var/lib/postgresql/8.3/main/
sudo mv server.key server.key-0
sudo cp /etc/ssl/private/ssl-cert-snakeoil.key server.key
sudo chown postgres server.key
sudo chgrp postgres server.key
sudo chmod 740 server.key
sudo /etc/init.d/postgres-8.3 start
现在可以正常工作了! 感谢您的支持.
And now its working ! Thanks for support.
这篇关于PostgreSQL无法启动:"server.key"拥有群组或世界访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!