sous-chefs / apache2 Goto Github PK
View Code? Open in Web Editor NEWDevelopment repository for the apache2 cookbook
Home Page: https://supermarket.chef.io/cookbooks/apache2
License: Apache License 2.0
Development repository for the apache2 cookbook
Home Page: https://supermarket.chef.io/cookbooks/apache2
License: Apache License 2.0
CentOS 5.10, run list is apache2 & apache2::mod_ssl.
Here's the error message:
[2014-07-28T12:20:42-07:00] DEBUG: Mixlib::ShellOut::ShellCommandFailed: service[apache2] (apache2::default line 188) had an error: Mixlib::
ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service httpd restart && sleep 1 ----
STDOUT: Stopping httpd: [FAILED]
Starting httpd: [FAILED]
STDERR: httpd: Syntax error on line 223 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/proxy_ajp.conf: Cannot lo
ad /etc/httpd/modules/mod_proxy_ajp.so into server: /etc/httpd/modules/mod_proxy_ajp.so: undefined symbol: proxy_module
---- End output of /sbin/service httpd restart && sleep 1 ----
I'm confused as to why it is trying to use mod_proxy_ajp because prior to this error, I see this in the logs:
[2014-07-28T12:10:59-07:00] INFO: Processing file[/etc/httpd/conf.d/proxy_ajp.conf] action delete (apache2::default line 62)
[2014-07-28T12:10:59-07:00] INFO: file[/etc/httpd/conf.d/proxy_ajp.conf] deleted file at /etc/httpd/conf.d/proxy_ajp.conf
If I manually remove the /etc/httpd/conf.d/proxy_ajp.conf
after that and do a chef run again, it will complete successfully.
please release the branch [COOK-3900] to the chef market for the time being
maby under a name such as 'apache24'
because it takes to long it has been for 6 months now that this branch is alive and working.
and since last month ubuntu raring 13.04 has been deprecated and removed
FC015: Consider converting definition to a LWRP: ./definitions/apache_conf.rb:1
FC015: Consider converting definition to a LWRP: ./definitions/apache_config.rb:1
FC015: Consider converting definition to a LWRP: ./definitions/apache_mod.rb:1
FC015: Consider converting definition to a LWRP: ./definitions/apache_module.rb:1
FC015: Consider converting definition to a LWRP: ./definitions/apache_site.rb:1
FC015: Consider converting definition to a LWRP: ./definitions/web_app.rb:1
Tried to use the COOK-3900 branch to test a workaround for #161 and ran into this. This was running CentOS 7 with the apache version attribute set to 2.4.
================================================================================
Error executing action `create` on resource 'template[/etc/sysconfig/httpd]'
================================================================================
Chef::Mixin::Template::TemplateError
------------------------------------
undefined method `each' for nil:NilClass
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb
141: template '/etc/sysconfig/httpd' do
142: source 'etc-sysconfig-httpd.erb'
143: owner 'root'
144: group node['apache']['root_group']
145: mode '0644'
146: notifies :restart, 'service[apache2]'
147: only_if { platform_family?('rhel', 'fedora') }
148: end
149:
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb:141:in `from_file'
template("/etc/sysconfig/httpd") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
guard_interpreter :default
path "/etc/sysconfig/httpd"
backup 5
atomic_update true
source "etc-sysconfig-httpd.erb"
cookbook_name :apache2
recipe_name "default"
mode "0644"
owner "root"
group "root"
only_if { #code block }
end
Template Context:
-----------------
on line #33
31: PIDFILE=<%= node['apache']['pid_file'] %>
32:
33: <% node['apache']['sysconfig_additional_params'].each do |k,v| %>
34: <%= "#{k}=#{v}" %>
35: <% end %>
To get around this I set ['apache']['sysconfig_additional_params']
to an empty hash {}
.
When I look at the template file for headers I see nothing to even create this file. Was this simply missed or was this by design? I see a similar issue with rewrite, but because of the headers issue I never get that far.
Make sure we document this and verify it works.
[Mon Aug 04 22:52:32.123685 2014] [core:warn] pid 5449No such file or directory: AH00075: Failed to enable the 'httpready' Accept Filter
When installing apache2.4 mod_ssl enable socache, but that module is not enabled by default. Thus resulting in apache2 start errors.
AH00526: Syntax error on line 42 of /etc/apache2/mods-enabled/ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).
Currently the security.conf file is created in the apachedir/conf.d/security.conf.
This creates an issue because on 2.4 the conf files are loaded from apachedir/conf-enabled/security.conf, where a default exists that will override the apachedir/conf.d/security.conf.
This is an inconsistency that is fixed on this branch. We will want to make that this is documented in the CHANGELOG, hence this issue.
In 2.4 mode, apache.proxy.order
, apache.proxy.deny_from
, apache.proxy.allow_from
are ignored, as the attributes can not be supported in a backwards compatible way. We will want to setup a different way to approach it.
I get this error :
Error executing action run
on resource 'execute[a2enmod authz_default]'
See #151 and #150 for some background.
Related to https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/689454
Chef reverted changing the default service provider to Upstart for >= 13.10 during regression; as this broke many packages without upstart scripts. See chef/chef#1587
Please add support for Ubuntu 14.04 LTS. Thanks!
Our apache2_test cookbook outputs this failure when converging Centos 7.0
Jul 31 00:36:15 working.computers.biz httpd[4417]: AH00526: Syntax error on line 10 of /etc/httpd/sites-enabled/ssl.conf:
Jul 31 00:36:15 working.computers.biz httpd[4417]: SSLCertificateFile: file '/home/apache2/server.crt' does not exist or is empty
Inside the box, the server.crt
and server.key
are both in /home/apache2
where we expect them, and they are not empty. Permissions are root:root 644
.
Hi,
I got the following intermittently on my CentOS machine. I googled around and couldn't find anything, has anyone seen this before? Thanks!
Recipe: apache2::default
* service[apache2] action reload
================================================================================
Error executing action `reload` on resource 'service[apache2]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '6'
---- Begin output of /sbin/service httpd reload && sleep 1 ----
STDOUT: Reloading httpd: not reloading due to configuration syntax error
[FAILED]
STDERR:
---- End output of /sbin/service httpd reload && sleep 1 ----
Ran /sbin/service httpd reload && sleep 1 returned 6
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/apache2/recipes/default.rb
188: service 'apache2' do
189: case node['platform_family']
190: when 'rhel', 'fedora', 'suse'
191: service_name 'httpd'
192: # If restarted/reloaded too quickly httpd has a habit of failing.
193: # This may happen with multiple recipes notifying apache to restart - like
194: # during the initial bootstrap.
195: restart_command '/sbin/service httpd restart && sleep 1'
196: reload_command '/sbin/service httpd reload && sleep 1'
197: when 'debian'
198: service_name 'apache2'
199: restart_command '/usr/sbin/invoke-rc.d apache2 restart && sleep 1'
200: reload_command '/usr/sbin/invoke-rc.d apache2 reload && sleep 1'
201: when 'arch'
202: service_name 'httpd'
203: when 'freebsd'
204: service_name 'apache22'
205: end
206: supports [:restart, :reload, :status]
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:188:in `from_file'
service("apache2") do
action [:enable, :start]
supports {:restart=>true, :reload=>true, :status=>true}
retries 0
retry_delay 2
guard_interpreter :default
service_name "httpd"
enabled true
running true
pattern "apache2"
restart_command "/sbin/service httpd restart && sleep 1"
reload_command "/sbin/service httpd reload && sleep 1"
cookbook_name "apache2"
recipe_name "default"
end
Note that this test was made against the COOK-3900 branch of the cookbook.
Consider the following recipe. It stops apache2 to simulate a manual halt,
then it installs apache2, inserts a broken conf file, enables it and tries to start. Naturally starting the service after enabling the broken conf will fail.
The problem is that if apache2 stops (simulated here by a stop in the recipe) then apache2 will try to start it in the recipe which will fail because of our broken conf file,
before we reach the template and have a chance to correct it.
If apache2 isn't stopped then this problem is avoided (or rather delayed until apache2 stops for some reason) since the service is :reload
-ed instead of :start
-ed. The :reload
fails but the service is still running which I assume is as it should be.
# Simulate that the service has stopped for some reason, like a reboot.
service 'apache2' do
action :stop
end
include_recipe 'apache2'
# This is a broken apache config.
# After running this recipe a few
# times, you can't even get to this point and
# get a chance to correct the broken template
file '/etc/apache2/sites-available/broken_apache.conf' do
content '<'
owner 'root'
group 'root'
notifies :reload, 'service[apache2]'
end
# Enable our broken site.
apache_site 'broken_apache' do
enable true
end
# Enable our broken site.
service 'apache2' do
action :start
end
This patch solves this particular problem but can probably be done in a much better way.
# At the bottom of apache2/recipes/default.rb
#service 'apache2' do
# action :start
#end
ruby_block "service_apache2_startsignal" do
block do
# Dummy block that always executes
end
notifies :start, 'service[apache2]'
end
on Ubuntu 14.04
[Thu Jul 24 22:13:38.728204 2014] [proxy_balancer:emerg] [pid 7404] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
$ kitchen login default-ubuntu-1404
vagrant@working:~$ sudo -i
root@working:~#
root@working:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
root@working:~# APACHE_LOG_DIR=/var/log/apache2 /usr/sbin/apache2 -S
VirtualHost configuration:
*:443 computers.biz (/etc/apache2/sites-enabled/ssl.conf:1)
*:80 is a NameVirtualHost
default server working.computers.biz (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost working.computers.biz (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost working (/etc/apache2/sites-enabled/basic_webapp.conf:1)
alias working.computers.biz
port 80 namevhost working (/etc/apache2/sites-enabled/working.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33
root@working:~#
Some of the default attributes, like default_modules
include modules that are no longer present in Apache 2.4. Additionally, directives like LockFile
, RewriteLock
, etc have been deprecated and removed in 2.4 in favor of the single Mutex
directive. Any immediate plans to support Apache 2.4?
This is the default apache version in Ubuntu 14.04, so using latest recipe fails when trying to enable authz_default
Example default Apache2 install on Ubuntu 14.04
# ls -l /etc/apache2/sites-available/
total 12
-rw-r--r-- 1 root root 1332 Jan 7 08:23 000-default.conf
-rw-r--r-- 1 root root 6437 Jan 7 08:23 default-ssl.conf
a2ensite now looks for files with ".conf" suffixes. a2ensite fails with "ERROR: Site xyz does not exist!" for available-sites that don't have the .conf suffix.
Removed from apache2.conf.erb. (https://httpd.apache.org/docs/trunk/upgrading.html)
Not so much an issue in this cookbook, as its not been tested on apache 2.4 and ubuntu > 12.04.
Quick fix for anyone looking to install apache 2.4 on ubuntu > 12.04 using this cookbook is to remove the LockFile directive from the templates/default/apache2.conf.erb file.
Would be great.
Replaced with Mutex syntax outlined here. http://httpd.apache.org/docs/2.4/upgrading.html
I had success setting up a prototype Gerrit site on CentOS using the Gerrit cookbook(https://github.com/TYPO3-cookbooks/gerrit), which references apache2. Now I am in attempting to setup the production site on a SuSE VM.
The first issue that I ran up against with the apache2 cookbook is the default attributes, specifically the apache/dir. The apache2 default recipe is attempting to create sites-available, sites-enabled, mods-available, and mods-enabled and fails, because the target directory('/etc/httpd') does not exist.
The default attributes for 'suse' are lumped together with 'redhat', 'centos', etc. During my chef-client run, apache2 package is installed, not httpd. So, the value for apache/dir is incorrect.
Is this something that needs to be addressed in the default attributes, maybe by creating a separate 'suse' case? Or, do I just need to override this particular attribute?
Then I wonder how many of the other defaults will be incorrect as well. Maybe we need to just move 'suse' to the 'debian' case.
000-default.conf still exists in sites-enabled
at the beginning of the chef run for apache i see
file[/etc/apache2/sites-enabled/000-default] action delete [2014-07-29T12:42:37+00:00] INFO: Processing file[/etc/apache2/sites-enabled/000-default] action delete (apache2::default line 67)
(up to date)
anyone else have this?
using
[FYI: This was done using the latest from the COOK-3900 branch ]
I am using SuSE 11 SP3. The testing that has been done on 13 SP3(I think) has uncovered some basic differences in the layout/config of the initial apache2 installation. Certain assumptions are being made by the default recipe as to what is present and/or needed in the file system. I repeatedly stopped/started apache2 and attempted to address each error. These are the manual steps that I performed in order to get my Gerrit installation working:
Created and/or modified files:
Ones that httpd.conf is trying to load, but where missing.
Deleted by ../cookbooks/apache2/recipes/default.rb:131
[ Created using touch ]...
/etc/apache2/uid.conf
/etc/apache2/listen.conf
/etc/apache2/mod_log_config.conf
/etc/apache2/mod_status.conf
/etc/apache2/mod_info.conf
/etc/apache2/mod_usertrack.conf
/etc/apache2/mod_autoindex-defaults.conf
/etc/apache2/errors.conf
Existing files edited...
/etc/apache2/ports.conf
/etc/apache2/default-server.conf
???(forgot what I changed if anything...)
Created dirs:
/etc/apache2/mods-available
/etc/apache2/mods-enabled
/etc/apache2/vhosts.d
/var/run/httpd
New files edited:
/etc/apache2/mods-enabled/authz_default.load
LoadModule authz_core_module /usr/lib64/apache2/mod_authz_core.so
How can this be addressed? Do we need version specific templates for SuSE?
ubuntu1204 converges properly as does centos510 ... ubuntu 1404 fails because of this:
root@working:/home/vagrant# apachectl configtest
AH00526: Syntax error on line 11 of /etc/apache2/apache2.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
I'm using the COOK-3900 branch on a freshly installed VM. For some reason the init.d-script fails to start the service:
* service[apache2] action restart
================================================================================
Error executing action `restart` on resource 'service[apache2]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/invoke-rc.d apache2 restart && sleep 1 ----
STDOUT: * Restarting web server apache2
...fail!
STDERR: invoke-rc.d: initscript apache2, action "restart" failed.
---- End output of /usr/sbin/invoke-rc.d apache2 restart && sleep 1 ----
Ran /usr/sbin/invoke-rc.d apache2 restart && sleep 1 returned 1
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/apache2/recipes/default.rb
225: service 'apache2' do
226: action :start
227: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/apache2/recipes/default.rb:225:in `from_file'
service("apache2") do
action [:start]
updated true
supports {:restart=>true, :reload=>true, :status=>true}
retries 0
retry_delay 2
guard_interpreter :default
service_name "apache2"
enabled true
running true
pattern "apache2"
restart_command "/usr/sbin/invoke-rc.d apache2 restart && sleep 1"
reload_command "/usr/sbin/invoke-rc.d apache2 reload && sleep 1"
cookbook_name "apache2"
recipe_name "default"
end
Running handlers:
[2014-06-16T15:50:20+02:00] ERROR: Running exception handlers
Running handlers complete
[2014-06-16T15:50:20+02:00] ERROR: Exception handlers complete
[2014-06-16T15:50:20+02:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 27 resources updated in 78.125563312 seconds
[2014-06-16T15:50:20+02:00] ERROR: Chef::Exceptions::MultipleFailures
[2014-06-16T15:50:20+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
I'm using
apache2 - 2.4.7-1ubuntu4 - amd64
The stacktrace:
# less /var/chef/cache/chef-stacktrace.out
Generated at 2014-06-16 16:00:40 +0200
Chef::Exceptions::MultipleFailures: Chef::Exceptions::MultipleFailures
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.4.0/lib/mixlib/shellout.rb:257:in `invalid!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.4.0/lib/mixlib/shellout.rb:244:in `error!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/shell_out.rb:43:in `shell_out!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/execute.rb:60:in `block in action_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:155:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/execute.rb:59:in `action_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider.rb:120:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource.rb:637:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:345:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:431:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:217:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:328:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'
Error log (CEST):
# less /var/log/apache2/error.log
[Mon Jun 16 15:59:36.593942 2014] [mpm_event:notice] [pid 1349:tid 140006565214080] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Jun 16 15:59:36.594070 2014] [core:notice] [pid 1349:tid 140006565214080] AH00094: Command line: '/usr/sbin/apache2'
When I install the package by hand the service is starting...
Any clue where to look?
The next version of Chef will use Chef::Provider::Service::Upstart by default in Ubuntu 13.10+ (Changelog, CHEF-5276), because Ubuntu stopped shipping compatibility links in /etc/init.d/: see this bug and the wiki.
At the same time, the apache2 package for Ubuntu doesn't provide an Upstart script. This will cause a problem for the service definition here. It does override the reload_command and restart_command, but the final calls to action :enable and :start will end up calling Upstart.
This relates to the .conf
changes in apache 2.4 as seen in #158, etc.
Note that CentOS7 is not listed as a supported platform at this time for the apache2 cookbook, so I didn't expect things to go smoothly:
================================================================================
Error executing action `start` on resource 'service[apache2]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service httpd start ----
STDOUT:
STDERR: Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
---- End output of /sbin/service httpd start ----
Ran /sbin/service httpd start returned 1
Hi,
I've been trying to use the apache2 default recipe in a Fedora 20 box and I've found a couple of issues that make Apache fail to restart.
In the apache2.conf.erb includes the following line:
LockFile logs/accept.lock
which causes the error:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
I think it's also missing the modules configuration, thus I think the following line would need to be added:
Include conf.modules.d/*.conf
I was depending on the COOK-3900 branch and when that got pulled int I started seeing
cannot load such file -- chef/provider/package/freebsd
running the default apache2 recipe on Ubuntu 14.04.
This may be related to #197
It looks like 37629fb in the COOK-3900 branch added ".conf" to the only_if for enabling a site. When web_app calls apache_site it appends .conf itself so the end result is a check for a file called sitename.conf.conf
in that check which always fails.
Make sure we document and verify this change works.
There was some talk about this before #24
Setting node['apache']['default_site_enabled'] = false
does not actually disable the default site on Ubuntu 14.04. (This is on COOK-3900 branch.)
The a2dissite
and a2ensite
scripts do not correctly add the 000-
priority prefix when default
is given (even though it seems this functionality is intended).
I am running Ruby 2.1.2 and Vagrant 1.6.3-1 on Arch Linux.
To reproduce:
$ git clone https://gist.github.com/e795303129cc8a5563fa.git
$ cd e795303129cc8a5563fa
$ git checkout ca61368b814fe4f0a79d7c45986021ee17d09c9d
$ bundle
$ kitchen converge
$ kitchen login
Then on the VM:
vagrant@default-ubuntu-1404:/etc/apache2$ ls -l sites-available/
total 16
-rw-r--r-- 1 root root 1332 Jan 7 13:23 000-default.conf
-rw-r--r-- 1 root root 1337 Jun 22 18:22 default
-rw-r--r-- 1 root root 6437 Jan 7 13:23 default-ssl.conf
vagrant@default-ubuntu-1404:/etc/apache2$ ls -l sites-enabled/
total 0
lrwxrwxrwx 1 root root 35 Jun 22 18:22 000-default.conf -> ../sites-available/000-default.conf
vagrant@default-ubuntu-1404:/etc/apache2$ sudo a2dissite default
ERROR: Site default does not exist!
vagrant@default-ubuntu-1404:/etc/apache2$ sudo a2ensite default
ERROR: Site default does not exist!
vagrant@default-ubuntu-1404:/etc/apache2$ sudo a2dissite 000-default
Site 000-default disabled.
To activate the new configuration, you need to run:
service apache2 reload
vagrant@default-ubuntu-1404:/etc/apache2$ ls sites-enabled/
vagrant@default-ubuntu-1404:/etc/apache2$
In general it will be nice to have graceful option in apache2 service provided by this cookbook which can be used by consumers.
Specific issue seen:
While doing some testing I have found that using service reload have some downtime on RHEL 6.5 httpd service. Whenever there are changes in configuration using web_app definition we would like it to call service graceful instead of reload so that we have no server downtime.
If it is not possible to add graceful option instead of reload in web_app https://github.com/onehealth-cookbooks/apache2/blob/master/definitions/web_app.rb#L40 at least provide a way to configure the action so that user can skip this action by setting it to none and then handle the reload/graceful on their end.
In general it will be nice to use graceful instead of reload if possible. Or at the least provide a way to ovrride or configure that option by consumer cookbooks if needed
on ubuntu 14.04 ubuntu is not started only reloaded
and before it can reload it needs to be started :)
there are 2 start/restart commands but these are not satisfied due to a not if
see
https://github.com/onehealth-cookbooks/apache2/blob/COOK-3900/recipes/default.rb#L51
https://github.com/onehealth-cookbooks/apache2/blob/COOK-3900/recipes/default.rb#L157
anyone else has had this error with ubuntu 14.04?
or is it just me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.