2016-04-22 8 views
0

Meine Vagrantfile ist so konfiguriert, dass, wenn ich "vagrant up" tun, es ein Provisionsskript läuft, die alle meine gewünschten Pakete installieren. Das ist genau das, was ich tue, aber ich erhalte eine Fehlermeldung nach „Vagrant up“ (zum ersten Mal) tun Hier ist der Fehler: enter image description hereFehler nach Vagabund up

Hier ist mein provisions.sh Code:

#!/usr/bin/env bash 

PROJECT="foundation" 
PROJECT_LOG="foundation" 

MYSQL_PASSWORD="password" 

set -o nounset -o errexit -o pipefail -o errtrace 

error() { 
    local sourcefile=$1 
    local lineno=$2 
    echo "ERROR at ${sourcefile}:${lineno}; Last logs:" 
    grep "${PROJECT}" /var/log/syslog | tail -n 20 
} 

trap 'error "${BASH_SOURCE}" "${LINENO}"' ERR 

oe() { "[email protected]" 2>&1 | logger -t "${PROJECT}" > /dev/null; } 
ol() { echo "[${PROJECT_LOG}] [email protected]"; } 

export DEBIAN_FRONTEND=noninteractive 

ol 'Updating repository caches' 
oe sudo apt-get -q -y update 

ol 'Adding apt repositories' 
oe sudo apt-get -q -y install python-software-properties 
oe sudo add-apt-repository ppa:ondrej/php5-5.6 

ol 'Updating repository caches (second time)' 
oe sudo apt-get -q -y update 

ol "Installing misc packages" 
oe sudo apt-get -q -y install language-pack-nl 

ol 'Installing Apache 2' 
oe sudo apt-get -q -y install apache2 
oe sudo systemctl restart apache2 
oe sudo systemctl status apache2 

ol "Installing PHP" 
oe sudo apt-get -q -y install php5 libapache2-mod-php5 \\ 
    php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick \\ 
    php5-imap php5-mcrypt php5-memcached php5-ming php5-ps \\ 
    php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy \\ 
    php5-xmlrpc php5-xsl php5-xcache 

ol 'Installing Sendmail' 
oe sudo apt-get -q -y install sendmail 

ol 'Restarting Apache 2' 
oe sudo systemctl restart apache2 
oe sudo systemctl status apache2 

ol "Installing MySQL" 
oe sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password ${MYSQL_PASSWORD}" 
oe sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${MYSQL_PASSWORD}" 
oe sudo apt-get -q -y install mysql-server mysql-client 
oe sudo systemctl restart mysql 
oe sudo systemctl status mysql 

Antwort

1

Es klagt über

==> default: Apr 22 01:06:22 vagrant-ubuntu-wily-64 foundation: * Starting Apache httpd web server apache2 
==> default: Apr 22 01:06:22 vagrant-ubuntu-wily-64 foundation: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message 

in Ihrem Vagrantfile, stellen Sie sicher, dass Sie die Hostnamen als Fully Qualified Domain setzen, so etwas wie

config.vm.hostname = "dev.local" 

sollte die Bereitstellung glücklich machen.

Sekunden mag es nicht die \\ in Ihrer PHP-Paket

installieren

Sie alles in einer Zeile setzen können, und es wird

oe sudo apt-get -q -y install php5 libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache 

es aus dem oe Methode kommt arbeiten, aber nicht sicher, wie zu handhaben es

+0

Vielen Dank! Das ist es. – Kevin

Verwandte Themen