我的Vagrantfile是如此配置,如果我做“流浪”,它运行一个配置脚本,安装我所有我想要的包。这正是我正在做的事情,但是在做了“流浪汉”之后我得到了一个错误(第一次) 这是错误:
这是我的provisions.sh代码:
#!/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() { "$@" 2>&1 | logger -t "${PROJECT}" > /dev/null; }
ol() { echo "[${PROJECT_LOG}] $@"; }
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
答案 0 :(得分:1)
抱怨
==> 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
在您的Vagrantfile中,请确保将主机名设置为完全限定的域,例如
config.vm.hostname = "dev.local"
应该让配置开心。
第二,它不喜欢你的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
它来自oe
方法但不确定如何处理它