Skip to content

Commit

Permalink
remove mod fastcgi and replace with mod php
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Arickx committed Oct 24, 2015
1 parent 6c3a5eb commit 6ec94ce
Show file tree
Hide file tree
Showing 24 changed files with 126 additions and 74 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ download-chef-cookbooks:

vagrant-up:
ifeq "$(wildcard chef-repo/cookbooks/apache2)" ""
make install
@echo "Please run make install."
endif
ssh-add -K ~/.ssh/id_rsa ; vagrant up
ssh-add -K ~/.ssh/id_rsa ; vagrant up ; vagrant rsync-auto

vagrant-provision:
@if make .prompt-yesno message="Do you want to continue?" 2> /dev/null; then \
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions bin/guest/inosync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
SRC=/vagrant/drupal/sites/all
DST=/vagrant_nfs/drupal/sites/

inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' -e create,move,delete,modify ${SRC} | while read file
do
rsync -av --no-o --no-g --delete --progress ${SRC} ${DST}
done
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion chef-repo/cookbooks/build-essential/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RSpec::Core::RakeTask.new(:spec)
require 'kitchen'
namespace :integration do
desc 'Run Test Kitchen with Vagrant'
task :vagrant do
task :guest do
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each do |instance|
instance.test(:always)
Expand Down
2 changes: 1 addition & 1 deletion chef-repo/cookbooks/composer/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace :integration do
require 'kitchen'

desc 'Run Test Kitchen integration tests with Vagrant'
task :vagrant do
task :guest do
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each do |instance|
instance.test(:always)
Expand Down
3 changes: 2 additions & 1 deletion chef-repo/site-cookbooks/system/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
recipe 'system::zsh', 'Zsh'
recipe 'system::java', 'Java'
recipe 'system::java_repo', 'Java repo'
recipe 'system::ruby', 'Ruby'
recipe 'system::ruby', 'Ruby'
recipe 'system::inosync', 'Inosync'
6 changes: 3 additions & 3 deletions chef-repo/site-cookbooks/system/recipes/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
mode '0666'
notifies :run, "execute[apt-mark-hold]", :immediately
notifies :run, "execute[apt-update]", :immediately
# notifies :run, "execute[apt-upgrade]", :immediately
# notifies :run, "execute[apt-cleanup]", :immediately
end
notifies :run, "execute[apt-upgrade]", :immediately
notifies :run, "execute[apt-cleanup]", :immediately
end
2 changes: 2 additions & 0 deletions chef-repo/site-cookbooks/system/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
include_recipe "system::ruby"

include_recipe "system::cachefilesd"

include_recipe "system::inosync"
8 changes: 8 additions & 0 deletions chef-repo/site-cookbooks/system/recipes/inosync.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Cookbook Name::system
# Recipe::inotify-tools
#

package "inotify-tools" do
action :install
end
15 changes: 8 additions & 7 deletions chef-repo/site-cookbooks/system/recipes/zsh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@

bash "install-zsh" do
code <<-EOH
(chown -R vagrant:vagrant /home/vagrant/.oh-my-zsh)
(cp /home/vagrant/.oh-my-zsh/templates/zshrc.zsh-template /home/vagrant/.zshrc)
(chown -R vagrant:vagrant /home/vagrant/.oh-my-zsh)
(chown vagrant:vagrant /home/vagrant/.zshrc)
EOH
not_if { File.exists?("/home/vagrant/.zshrc") }
end

#bash "set-zsh" do
# code <<-EOH
# (chsh --shell /bin/zsh vagrant)
# EOH
# only_if { File.exists?("/home/vagrant/.zshrc") }
#end
bash "set-zsh" do
code <<-EOH
(chsh --shell /bin/zsh vagrant)
EOH
only_if { File.exists?("/home/vagrant/.zshrc") }
end
13 changes: 2 additions & 11 deletions chef-repo/site-cookbooks/web-httpd/recipes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
action [:enable, :start]
end

#
package "libapache2-mod-fastcgi" do
action :install
end

#
execute "Enabling necessary apache2 modules" do
Expand All @@ -39,14 +35,9 @@
action :run
end

#
execute "Enabling necessary apache2 modules" do
command 'a2enmod fastcgi'
action :run
end

#

#
apache_module "ssl" do
enable true
end
Expand All @@ -57,4 +48,4 @@
group 'root'
mode '0755'
action :create
end
end
2 changes: 1 addition & 1 deletion chef-repo/site-cookbooks/web-httpd/recipes/apache_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
apt_preference "ondrej-apache2" do
glob '*'
pin 'origin http://ppa.launchpad.net/ondrej/apache2/ubuntu'
pin_priority '700'
pin_priority '999'
notifies :run, "execute[apt-get update]", :immediately
end
32 changes: 1 addition & 31 deletions chef-repo/site-cookbooks/web-php5/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,14 @@
# Recipe:: default
#

execute "apt-update-php5" do
command "apt-get update"
action :nothing
ignore_failure true
only_if { apt_installed? }
end

node.override['php5']["version"] = node['config']['php']['php_version']
node['php']['version'] = node['config']['php']['php_version']

if node["php5"]["version"] == "5.3"

#
include_recipe 'php5::php5_53'

elsif node["php5"]["version"] == "5.4"

#
include_recipe 'php5::php5_54'

elsif node["php5"]["version"] == "5.5"

#
include_recipe 'php5::php5_55'

elsif node["php5"]["version"] == "5.6"

#
include_recipe 'php5::php5_56'

end

#
#We have to disable apache2::mod_php5 because it'll interfere with the PHP-FPM module.
#
#include_recipe 'apache2::mod_php5'

include_recipe 'web-php5::php_fpm'

include_recipe 'web-php5::packages'


10 changes: 1 addition & 9 deletions chef-repo/site-cookbooks/web-php5/recipes/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@
node['config']['php_packages'].each do |php_package, install_php_package|

if install_php_package

package php_package do
action :install
notifies :reload, 'service[php-fpm]', :delayed
end

end

end
Expand All @@ -56,10 +53,6 @@
action :create
end

link "/etc/php5/mods-available/xdebug.ini" do
to "/etc/php5/fpm/conf.d/xdebug.ini"
end

end

#
Expand All @@ -77,8 +70,7 @@
group "root"
action :create
notifies :restart, 'service[apache2]', :delayed
notifies :reload, 'service[php-fpm]', :delayed
only_if { !File.exists?("/etc/php5/mods-available/uprofiler.ini") }
end

end
end
26 changes: 25 additions & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php5_53.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
#
node.override['config']['php']['php_version'] = '5.3'

#
include_recipe 'php'
include_recipe 'web-php5::php_fpm'

#
package "libapache2-mod-php5" do
action :install
end

include_recipe 'apache2::mod_php5'
include_recipe 'web-php5::packages'

file "/etc/php5/mods-available/php-tweaks.ini" do
action :delete
end

template "/etc/php5/mods-available/php-tweaks.ini" do
source "php.tweaks.ini"
mode 0644
owner "root"
group "root"
action :create
end

execute "tweak php" do
command 'php5enmod php.tweaks'
action :run
end
25 changes: 24 additions & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php5_54.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,28 @@

#
include_recipe 'php'
include_recipe 'web-php5::php_fpm'

#
package "libapache2-mod-php5" do
action :install
end

include_recipe 'apache2::mod_php5'
include_recipe 'web-php5::packages'

file "/etc/php5/mods-available/php-tweaks.ini" do
action :delete
end

template "/etc/php5/mods-available/php-tweaks.ini" do
source "php.tweaks.ini"
mode 0644
owner "root"
group "root"
action :create
end

execute "tweak php" do
command 'php5enmod php.tweaks'
action :run
end
2 changes: 1 addition & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php5_54_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
apt_preference "ondrej-old-php-pin" do
glob '*'
pin 'origin http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu'
pin_priority '700'
pin_priority '999'
notifies :run, "execute[apt-get update]", :immediately
end

25 changes: 24 additions & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php5_55.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,28 @@

#
include_recipe 'php'
include_recipe 'web-php5::php_fpm'

#
package "libapache2-mod-php5" do
action :install
end

include_recipe 'apache2::mod_php5'
include_recipe 'web-php5::packages'

file "/etc/php5/mods-available/php-tweaks.ini" do
action :delete
end

template "/etc/php5/mods-available/php-tweaks.ini" do
source "php.tweaks.ini"
mode 0644
owner "root"
group "root"
action :create
end

execute "tweak php" do
command 'php5enmod php-tweaks'
action :run
end
2 changes: 1 addition & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php5_55_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
apt_preference "ondrej-php-pin" do
glob '*'
pin 'origin http://ppa.launchpad.net/ondrej/php5/ubuntu'
pin_priority '700'
pin_priority '999'
notifies :run, "execute[apt-get update]", :immediately
end

Expand Down
1 change: 0 additions & 1 deletion chef-repo/site-cookbooks/web-php5/recipes/php_fpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
not_if { File.symlink?("/etc/apache2/conf-enabled/php-fpm.conf") }
end


bash "fastcgi-permissions" do
code <<-EOH
(chmod -R 777 /var/lib/apache2/fastcgi)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
log_errors = on
memory_limit = 512M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = on
post_max_size = 64M
upload_max_filesize = 64M
realpath_cache_size = 64M
realpath_cache_ttl = 3600
4 changes: 3 additions & 1 deletion example.vagrant.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"error_reporting": "E_ALL & ~E_DEPRECATED",
"display_errors": "On",
"post_max_size": "64M",
"upload_max_filesize": "64M"
"upload_max_filesize": "64M",
"realpath_cache_size": "64M",
"realpath_cache_ttl": "3600"
}
}
},
Expand Down

0 comments on commit 6ec94ce

Please sign in to comment.