我试过了
sudo apt-get purge postgresql
sudo apt-get autoremove postgresql
Run Code Online (Sandbox Code Playgroud)
和
sudo apt-get --purge remove postgresql
Run Code Online (Sandbox Code Playgroud)
但在这之后dpkg -l | grep postgres
给了我:
pi postgresql-9.1 9.1.11-0ubuntu0.13.04 amd64 object-relational SQL database, version 9.1 server
pi postgresql-client-9.1 9.1.11-0ubuntu0.13.04 amd64 front-end programs for PostgreSQL 9.1
ii postgresql-client-common 140 all manager for multiple PostgreSQL client versions
ii postgresql-common 140 all PostgreSQL database-cluster manager
ii postgresql-contrib 9.1+140 all additional facilities for PostgreSQL (supported version)
ii postgresql-contrib-9.1 9.1.11-0ubuntu0.13.04 amd64 additional facilities for PostgreSQL
ii postgresql-doc-9.1 9.1.11-0ubuntu0.13.04 all …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的项目设置到虚拟机中,以便我可以在我的主机上使用它。我已经在 vagrantfile 中设置了端口转发,当我运行 'vagrant up' 时一切正常,没有错误。但是当我尝试从主机访问 VM 中的应用程序时,我不能。我的流浪文件非常简单:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
config.vm.network :forwarded_port, host: 4567, guest: 8001
config.vm.synced_folder "data", "/home/vagrant/projects/myapp/"
end
Run Code Online (Sandbox Code Playgroud)
一开始我得到这个:
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8001 => 4567 (adapter 1)
default: 22 => 2222 (adapter 1)
Run Code Online (Sandbox Code Playgroud)
看起来一切正常,但是当我尝试从我的主机访问 127.0.0.1:4567(并且我在 127.0.0.1:8001 上的来宾机器上运行我的应用程序)时,我ERR_EMPTY_RESPONSE
在浏览器中收到err_code。我做错了什么?
我无法使用 ssh id_rsa/id_rsa.pub 密钥,因为看起来 ssh 认为输入的密码是错误的。但我确信这是对的。它看起来是这样的:
ssh myuser@myhost_ip -i ~/.ssh/id_rsa.pub
The authenticity of host 'myhost_ip (myhost_ip)' can't be established.
RSA key fingerprint is SHA256: (some hash).
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'myhost_ip' (RSA) to the list of known hosts.
Enter passphrase for key '/Users/paul/.ssh/id_rsa.pub':
Enter passphrase for key '/Users/paul/.ssh/id_rsa.pub':
Enter passphrase for key '/Users/paul/.ssh/id_rsa.pub':
Run Code Online (Sandbox Code Playgroud)
据我了解,它认为密码是错误的。在这个问题之前,我还有另一个问题(我不确定,但也许它们是相关的?):
Permissions 0644 for '/Users/paul/.ssh/id_rsa.pub' are too open.
Run Code Online (Sandbox Code Playgroud)
我用 修复了它chmod 400 ~/.ssh/id_rsa.pub
。我不确定为什么会出现这个问题,我猜测这些密钥是在 Ubuntu 上生成并转移到 MacOS 上的。 …