错误:deploy 青云

####下面是在把专案部署到青云服务器上出现的错误:

在远端机器输入:sudo apt-get update

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

输入以下代码搞定:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

答案来源:1

本地cap deploy出现cap aborted!

报错信息如下:

Net::SSH::HostKeyMismatch: fingerprint d3:c2:ce:21:88:cb:a6:7b:68:ef:44:b0:bd:c1:83:bd does not match for "121.201.7.137"
Tasks: TOP => rvm:hook => passenger:rvm:hook => passenger:test_which_passenger
(See full trace by running task with --trace)

在deploy.rb里面加入set :ssh_options, paranoid: false 答案来源:2

输入sudo /etc/init.d/nginx restart出现的问题

restart fail,查看nginx error log(vi /opt/nginx/logs)得到以下报错信息:

2017/01/08 14:19:14 [emerg] 1965#0: unknown directive "server_names_hash_max_size:" in /opt/nginx/conf/nginx.conf:22
2017/01/08 14:19:36 [emerg] 1977#0: unknown directive "server_names_hash_bucket_size:" in /opt/nginx/conf/nginx.conf:23
2017/01/08 14:20:13 [emerg] 1999#0: could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/01/08 14:21:38 [emerg] 2037#0: could not build server_names_hash, you should increase server_names_hash_bucket_size: 32

修改sudo vi /opt/nginx/conf/nginx.conf加入如下代码:

server_names_hash_bucket_size 64;
server_names_hash_max_size 512;

答案来源:1,2