default['ceph']['radosgw']['use_apache_fork'] = true
default['ceph']['radosgw']['init_style'] = node['ceph']['init_style']
+default['ceph']['radosgw']['path'] = '/var/www'
+
+if node['platform_family'] == 'suse'
+ default['ceph']['radosgw']['path'] = '/srv/www/ceph-radosgw'
+end
+
case node['platform_family']
when 'debian'
packages = ['radosgw']
case node['platform_family']
-when 'debian', 'suse'
+when 'debian'
default['ceph']['radosgw']['apache2']['packages'] = ['libapache2-mod-fastcgi']
+when 'suse'
+ default['ceph']['radosgw']['apache2']['packages'] = ['apache2-mod_fastcgi', 'apache2-worker']
when 'rhel', 'fedora'
default['ceph']['radosgw']['apache2']['packages'] = ['mod_fastcgi']
end
ceph_rgw_addr node['ceph']['radosgw']['rgw_addr']
end
-template '/var/www/s3gw.fcgi' do
+directory node['ceph']['radosgw']['path'] do
+ owner 'root'
+ group 'root'
+ mode '0755'
+ action :create
+end
+
+template "#{node['ceph']['radosgw']['path']}/s3gw.fcgi" do
source 's3gw.fcgi.erb'
owner 'root'
group 'root'
:ceph_rgw_client => "client.radosgw.#{node['hostname']}"
)
end
+
+if node['platform_family'] == 'suse'
+ bash 'Set MPM apache value' do
+ code 'sed -i s/^[[:space:]]*APACHE_MPM=.*/APACHE_MPM=\"worker\"/ /etc/sysconfig/apache2'
+ not_if 'grep -q "^[[:space:]]*APACHE_MPM=\"worker\"" /etc/sysconfig/apache2'
+ notifies :restart, 'service[apache2]'
+ end
+end
<% if node['ceph']['radosgw']['rgw_port'] -%>
-FastCgiExternalServer /var/www/s3gw.fcgi -host 127.0.0.1:<%= node['ceph']['radosgw']['rgw_port'] %>
+FastCgiExternalServer <%= node['ceph']['radosgw']['path'] %>/s3gw.fcgi -host 127.0.0.1:<%= node['ceph']['radosgw']['rgw_port'] %>
<% else -%>
-FastCgiExternalServer /var/www/s3gw.fcgi -socket /var/run/ceph/radosgw.<%= node['hostname'] %>
+FastCgiExternalServer <%= node['ceph']['radosgw']['path'] %>/s3gw.fcgi -socket /var/run/ceph/radosgw.<%= node['hostname'] %>
<% end -%>
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\"" proxy_combined
<% end -%>
<% end -%>
ServerAdmin <%= node["ceph"]["radosgw"]["admin_email"] %>
- DocumentRoot /var/www/
+ DocumentRoot <%= node['ceph']['radosgw']['path'] %>
RewriteEngine On
RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /s3gw.fcgi?page=$1¶ms=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
<IfModule mod_fastcgi.c>
- <Directory /var/www/>
+ <Directory <%= node['ceph']['radosgw']['path'] %>>
Options +ExecCGI
AllowOverride All
SetHandler fastcgi-script