2014-09-23 115 views
2

我试图让vvv启动并运行,以便在wordpress网站上工作,并且在遵循“First Vagrant Up”指示的同时,我的安装失败。您可以在下面找到终端输出。第一个流浪汉失败

需要注意的是,下面的命令vagrant up以sudo的方式运行,但是在没有运行时会得到相同的结果。

https://github.com/Varying-Vagrant-Vagrants/VVV/tree/master#the-first-vagrant-up

我的安装失败,在第8步

[email protected] vagrant-local$ sudo vagrant up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Importing base box 'ubuntu/trusty64'... 
==> default: Matching MAC address for NAT networking... 
==> default: Checking if box 'ubuntu/trusty64' is up to date... 
==> default: Setting the name of the VM: vagrant-local_default_1411438722704_61758 
==> default: Clearing any previously set forwarded ports... 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
    default: Adapter 2: hostonly 
==> default: Forwarding ports... 
    default: 22 => 2222 (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2222 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
==> default: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
==> default: Checking for host entries 
==> default: adding to (/etc/hosts) : 192.168.50.4 vvv # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: adding to (/etc/hosts) : 192.168.50.4 vvv.dev # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: adding to (/etc/hosts) : 192.168.50.4 local.wordpress.dev # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: adding to (/etc/hosts) : 192.168.50.4 local.wordpress-trunk.dev # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: adding to (/etc/hosts) : 192.168.50.4 src.wordpress-develop.dev # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: adding to (/etc/hosts) : 192.168.50.4 build.wordpress-develop.dev # VAGRANT: 5060d38a36f5e1f12d46263feb41f99a (default)/502bc2fa-8395-48b4-a09c-09aa74586389 
==> default: Setting hostname... 
==> default: Configuring and enabling network interfaces... 
==> default: Mounting shared folders... 
    default: /vagrant => /Users/doug/WebsitesNoMamp/vagrant-local 
    default: /srv/www => /Users/doug/WebsitesNoMamp/vagrant-local/www 
    default: /srv/log => /Users/doug/WebsitesNoMamp/vagrant-local/log 
    default: /srv/config => /Users/doug/WebsitesNoMamp/vagrant-local/config 
    default: /srv/database => /Users/doug/WebsitesNoMamp/vagrant-local/database 
==> default: Running provisioner: shell... 
    default: Running: /tmp/vagrant-shell20140922-5634-vig5ba.sh 
==> default: stdin: is not a tty 
==> default: Check for apt packages to install... 
==> default: * php5-fpm [not installed] 
==> default: * php5-cli [not installed] 
==> default: * php5-common [not installed] 
==> default: * php5-dev [not installed] 
==> default: * php5-memcache [not installed] 
==> default: * php5-imagick [not installed] 
==> default: * php5-mcrypt [not installed] 
==> default: * php5-mysql [not installed] 
==> default: * php5-imap [not installed] 
==> default: * php5-curl [not installed] 
==> default: * php-pear [not installed] 
==> default: * php5-gd [not installed] 
==> default: * nginx [not installed] 
==> default: * memcached [not installed] 
==> default: * mysql-server [not installed] 
==> default: * imagemagick [not installed] 
==> default: * subversion [not installed] 
==> default: * git-core [not installed] 
==> default: * zip [not installed] 
==> default: * unzip [not installed] 
==> default: * ngrep [not installed] 
==> default: * curl            7.35.0-1ubuntu2.1 
==> default: * make            3.81-8.2ubuntu3 
==> default: * vim             2:7.4.052-1ubuntu3 
==> default: * colordiff [not installed] 
==> default: * postfix [not installed] 
==> default: * gettext [not installed] 
==> default: * graphviz [not installed] 
==> default: * dos2unix [not installed] 
==> default: * g++ [not installed] 
==> default: * nodejs [not installed] 
==> default: Linked custom apt sources 
==> default: No network connection available, skipping package installation 
==> default: Generate Nginx server private key... 
==> default: /etc/nginx/server.key: No such file or directory 140344758421152:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/etc/nginx/server.key','w') 140344758421152:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400: 
==> default: Generate Certificate Signing Request (CSR)... 
==> default: Error opening Private Key /etc/nginx/server.key 
==> default: 140567930091168:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/etc/nginx/server.key','r') 
==> default: 140567930091168:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400: 
==> default: unable to load Private Key 
==> default: Sign the certificate using the above private key and CSR... 
==> default: /etc/nginx/server.csr: No such file or directory 
==> default: Setup configuration files... 
==> default: * /srv/config/init/vvv-start.conf    -> /etc/init/vvv-start.conf 
==> default: cp: 
==> default: cannot create regular file '/etc/nginx/nginx.conf' 
==> default: : No such file or directory 
==> default: cp: 
==> default: cannot create regular file '/etc/nginx/nginx-wp-common.conf' 
==> default: : No such file or directory 
==> default: mkdir: 
==> default: cannot create directory '/etc/nginx/custom-sites/' 
==> default: : No such file or directory 
==> default: sending incremental file list 
==> default: rsync: mkdir "/etc/nginx/custom-sites" failed: No such file or directory (2) 
==> default: rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.0] 
==> default: * /srv/config/nginx-config/nginx.conf   -> /etc/nginx/nginx.conf 
==> default: * /srv/config/nginx-config/nginx-wp-common.conf -> /etc/nginx/nginx-wp-common.conf 
==> default: * /srv/config/nginx-config/sites/    -> /etc/nginx/custom-sites 
==> default: cp: 
==> default: cannot create regular file '/etc/php5/fpm/php5-fpm.conf' 
==> default: : No such file or directory 
==> default: cp: 
==> default: cannot create regular file '/etc/php5/fpm/pool.d/www.conf' 
==> default: : No such file or directory 
==> default: cp: 
==> default: cannot create regular file '/etc/php5/fpm/conf.d/php-custom.ini' 
==> default: : No such file or directory 
==> default: cp: 
==> default: cannot create regular file '/etc/php5/fpm/conf.d/opcache.ini' 
==> default: : No such file or directory 
==> default: cp: 
==> default: cannot create regular file '/etc/php5/mods-available/xdebug.ini' 
==> default: : No such file or directory 
==> default: sed: can't read /etc/php5/mods-available/xdebug.ini: No such file or directory 
==> default: * /srv/config/php5-fpm-config/php5-fpm.conf  -> /etc/php5/fpm/php5-fpm.conf 
==> default: * /srv/config/php5-fpm-config/www.conf   -> /etc/php5/fpm/pool.d/www.conf 
==> default: * /srv/config/php5-fpm-config/php-custom.ini -> /etc/php5/fpm/conf.d/php-custom.ini 
==> default: * /srv/config/php5-fpm-config/opcache.ini  -> /etc/php5/fpm/conf.d/opcache.ini 
==> default: * /srv/config/php5-fpm-config/xdebug.ini  -> /etc/php5/mods-available/xdebug.ini 
==> default: * /srv/config/memcached-config/memcached.conf -> /etc/memcached.conf 
==> default: sending incremental file list 
==> default: db_backup 
==> default: develop_git 
==> default: makepot 
==> default: vagrant_destroy 
==> default: vagrant_halt 
==> default: vagrant_suspend 
==> default: xdebug_off 
==> default: xdebug_on 
==> default: sent 2.22K bytes received 168 bytes 4.78K bytes/sec 
==> default: total size is 3.00K speedup is 1.25 
==> default: * /srv/config/bash_profile      -> /home/vagrant/.bash_profile 
==> default: * /srv/config/bash_aliases      -> /home/vagrant/.bash_aliases 
==> default: * /srv/config/vimrc        -> /home/vagrant/.vimrc 
==> default: * /srv/config/subversion-servers    -> /home/vagrant/.subversion/servers 
==> default: * /srv/config/homebin       -> /home/vagrant/bin 
==> default: Restart services... 
==> default: nginx: unrecognized service 
==> default: memcached: unrecognized service 
==> default: /tmp/vagrant-shell: line 318: php5dismod: command not found 
==> default: php5-fpm: unrecognized service 
==> default: mysql: unrecognized service 
==> default: Setup MySQL configuration file links... 
==> default: cp: 
==> default: cannot create regular file '/etc/mysql/my.cnf' 
==> default: : No such file or directory 
==> default: * /srv/config/mysql-config/my.cnf    -> /etc/mysql/my.cnf 
==> default: * /srv/config/mysql-config/root-my.cnf   -> /home/vagrant/.my.cnf 
==> default: service mysql restart 
==> default: mysql: unrecognized service 
==> default: No custom MySQL scripting found in database/init-custom.sql, skipping... 
==> default: /tmp/vagrant-shell: line 357: mysql: command not found 
==> default: Initial MySQL prep... 
==> default: Start MySQL Database Import 
==> default: No custom databases to import 
==> default: No network available, skipping network installations 
==> default: find: 
==> default: `/etc/nginx/custom-sites' 
==> default: : No such file or directory 
==> default: Restart Nginx... 
==> default: nginx: unrecognized service 
==> default: Cleaning the virtual machine's /etc/hosts file... 
==> default: Adding domains to the virtual machine's /etc/hosts file... 
==> default: * Added vvv.dev from /srv/www/vvv-hosts 
==> default: * Added local.wordpress.dev from /srv/www/vvv-hosts 
==> default: * Added local.wordpress-trunk.dev from /srv/www/vvv-hosts 
==> default: * Added src.wordpress-develop.dev from /srv/www/vvv-hosts 
==> default: * Added build.wordpress-develop.dev from /srv/www/vvv-hosts 
==> default: ----------------------------- 
==> default: Provisioning complete in 32 seconds 
==> default: No external network available. Package installation and maintenance skipped. 
==> default: For further setup instructions, visit http://vvv.dev 
==> default: Running provisioner: shell... 
    default: Running: inline script 
==> default: stdin: is not a tty 
==> default: mysql: unrecognized service 
The SSH command responded with a non-zero exit status. Vagrant 
assumes that this means the command failed. The output for this command 
should be in the log above. Please read the output to determine what 
went wrong. 

更新:

事实证明,由于某种原因,只有这样,才能解决甚至不能够的问题连接到虚拟机是用vagrant ssh手动ssh进入服务器,并手动安装它通过运行以下命令(在这种情况下)说它缺少的软件:

sudo apt-get install php5-fpm 
sudo apt-get install php5-cli 
sudo apt-get install php5-common 
sudo apt-get install php5-dev 
sudo apt-get install php5-memcache 
sudo apt-get install php5-imagick 
sudo apt-get install php5-mcrypt 
sudo apt-get install php5-mysql 
sudo apt-get install php5-imap 
sudo apt-get install php5-curl 
sudo apt-get install php-pear 
sudo apt-get install php5-gd 
sudo apt-get install nginx 
sudo apt-get install memcached 
sudo apt-get install mysql-server 
sudo apt-get install imagemagick 
sudo apt-get install subversion 
sudo apt-get install git-core 
sudo apt-get install zip 
sudo apt-get install unzip 
sudo apt-get install ngrep 
sudo apt-get install colordiff 
sudo apt-get install postfix 
sudo apt-get install gettext 
sudo apt-get install graphviz 
sudo apt-get install dos2unix 
sudo apt-get install g++ 
sudo apt-get install nodejs 

这并没有解决实际能够在虚拟机上查看我的网站的问题。即使现在已经安装了所有东西,但我仍然无法查看实际的网站,我认为虚拟机配置不正确,并且配置应该在我运行vagrant up时自动发生,对吗?

回答

0

事实证明,我无法通过流浪者完全安装虚拟机的原因是因为提供失败。在提供过程中,它会检查是否可以ping某个IP地址,在本例中为8.8.4.4。在一个正常的网络上,它应该可以工作,但是我的ping是禁用的,因此即使存在网络连接,这也会为ping结果返回一个错误的结果。

为了解决这个问题,我不得不改变检查ping的if语句。

if [[ $ping_result == *bytes?from* ]]; then

线136 https://github.com/Varying-Vagrant-Vagrants/VVV/blob/master/provision/provision.sh#L136

和614 https://github.com/Varying-Vagrant-Vagrants/VVV/blob/master/provision/provision.sh#L614

这是不是您永久修复变得

if [[ 1==1 ]]; then

,但在这种情况下,对我的作品。

+0

要检查问题的状态,可以查看https://github.com/Varying-Vagrant-Vagrants/VVV/pull/428 – 2014-09-29 15:18:16

1

看起来像您的VM无法访问网络。什么是你的本地网络的IP和子网掩码? https://github.com/Varying-Vagrant-Vagrants/VVV#caveats

+0

我在家里运行的网络的IP范围是192.168.0.x.将它分配给该网络不是更好吗? – 2014-09-23 17:08:38

+1

你不想要相同的网络,或者你可能会导致你自己的问题。您的主机系统充当虚拟机的路由器)事实上,如果您的子网掩码是255.255.0.0,这可能是您的问题的原因。按照说明进行操作,并更改为虚拟机的172.16.x.x或10.x.x.x,然后查看是否可以解决您的问题。 ( – 2014-09-23 18:41:12

+0

子网是255.255.255.0 – 2014-09-23 23:29:51