Ubuntu14-Apache2未使用ENVVARS运行
我目前正在使用Puppet进行实验,但遇到了一个错误,它在没有环境变量的情况下启动apache2。我一直在关注,这是一个非常简单的清单,但它抛出以下错误Ubuntu14-Apache2未使用ENVVARS运行,apache,ubuntu,puppet,Apache,Ubuntu,Puppet,我目前正在使用Puppet进行实验,但遇到了一个错误,它在没有环境变量的情况下启动apache2。我一直在关注,这是一个非常简单的清单,但它抛出以下错误 [Mon May 18 23:18:35.725947 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined [Mon May 18 23:18:35.726451 2015] [core:warn] [pid 5312]
[Mon May 18 23:18:35.725947 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon May 18 23:18:35.726451 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon May 18 23:18:35.726538 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon May 18 23:18:35.726611 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon May 18 23:18:35.726696 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon May 18 23:18:35.750730 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon May 18 23:18:35.751241 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon May 18 23:18:35.751331 2015] [core:warn] [pid 5312] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
我知道问题在于它没有加载到envvar文件中,如果我不从Puppet运行它,这是可以做到的,但我正在寻找一个解决方案,以便我可以使用Puppet创建服务器。有什么想法吗
我的木偶清单如下:
# execute 'apt-get update'
exec { 'apt-update': # exec resource named 'apt-update'
command => '/usr/bin/apt-get update' # command this resource will run
}
# install apache2 package
package { 'apache2':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure apache2 service is running
service { 'apache2':
ensure => running,
}
# install mysql-server package
package { 'mysql-server':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure mysql service is running
service { 'mysql':
ensure => running,
}
# install php5 package
package { 'php5':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure info.php file exists
file { '/var/www/html/info.php':
ensure => file,
content => '<?php phpinfo(); ?>', # phpinfo code
require => Package['apache2'], # require 'apache2' package before creating
}
#执行'apt get update'
exec{'apt update':#名为'apt update'的exec资源
command=>'/usr/bin/apt get update'#此资源将运行的命令
}
#安装apache2软件包
包{'apache2':
require=>Exec['apt-update'],#安装前需要'apt-update'
确保=>已安装,
}
#确保apache2服务正在运行
服务{'apache2':
确保=>正在运行,
}
#安装mysql服务器包
包{“mysql服务器”:
require=>Exec['apt-update'],#安装前需要'apt-update'
确保=>已安装,
}
#确保mysql服务正在运行
服务{'mysql':
确保=>正在运行,
}
#安装php5软件包
包{'php5':
require=>Exec['apt-update'],#安装前需要'apt-update'
确保=>已安装,
}
#确保info.php文件存在
文件{'/var/www/html/info.php':
确保=>文件,
内容=>'',#phpinfo代码
require=>Package['apache2'],#在创建之前需要'apache2'包
}
是,但为什么从Puppet运行时它不起作用?你试过调试吗?它应该可以工作,因为它没有加载envvars文件,但我想问为什么以及如何解决这个问题