我对使用Chef很陌生:我需要在CentOS 7上配置我的Apache
post_inst_config.rb
我以这种方式把它放在我的厨师名单上。。。
"recipe[mapserver_install::inst_apache2]",
"recipe[mapserver_install::post_inst_config]"
post\u inst\u配置。rb型
#Add to /etc/httpd/conf/httpd.conf the string: ScriptAlias /cgi-bin/ /var/www/cgi-bin/
File.open("/etc/httpd/conf/httpd.conf", 'a') do |file|
file.write "ScriptAlias /cgi-bin/ /var/www/cgi-bin/"
file.write "\n"
end
#Define the following symblink: ln -s /usr/bin/mapserv /var/www/cgi-bin/mapserv
link '/usr/bin/mapserv' do
to '/var/www/cgi-bin/mapserv'
end
#Create the directory for the imagepath ...
directory '/var/www/html/output' do
owner 'root'
group 'root'
mode '0755'
action :create
end
#Restart apache ....
service "httpd" do
action :restart
end
当我试图执行我的厨师烹饪书时,我得到了这个错误。。。
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/mapserver_install/recipes/post_inst_config.rb
================================================================================
Errno::ENOENT
-------------
No such file or directory @ rb_sysopen - /etc/httpd/conf/httpd.conf
请注意,如果我尝试在没有
post\u inst\u配置。rb型
Apache已安装并运行良好。
感谢您的建议。。。