Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue 14 #37

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
- include: web/deploy.yml
- include: web/git.yml
- include: web/ruby.yml
- include: web/php.yml
- include: web/fastcgi.yml
- include: web/php-fastcgi.yml
7 changes: 7 additions & 0 deletions web/fastcgi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- name: Install fastcgi packages
apt: name={{ item }} update_cache=yes
with_items:
- spawn-fcgi
- psmisc
12 changes: 12 additions & 0 deletions web/php-fastcgi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

- name: Create script for php-fastcgi
copy: src=web/php-fastcgi/php-fastcgi
dest=/usr/local/bin/php-fastcgi mode=0751

- name: Create php-fastcgi configuration
copy: src=web/php-fastcgi/php-fastcgi.conf
dest=/etc/init/php-fastcgi.conf

- name: Ensure that php-fastcgi service is enabled and running
service: name=php-fastcgi state=running enabled=yes
11 changes: 11 additions & 0 deletions web/php-fastcgi/php-fastcgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

FASTCGI_USER=deploy
FASTCGI_GROUP=deploy
ADDRESS=127.0.0.1
PORT=9000
PIDFILE=/var/run/php-fastcgi.pid
CHILDREN=6
PHP5=/usr/bin/php5-cgi

/usr/bin/spawn-fcgi -a $ADDRESS -p $PORT -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5
9 changes: 9 additions & 0 deletions web/php-fastcgi/php-fastcgi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description "PHP Fastcgi daemon"

start on (local-filesystems and net-device-up)
stop on runlevel [!2345]

expect daemon
respawn

exec /usr/local/bin/php-fastcgi
8 changes: 8 additions & 0 deletions web/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- name: Install PHP core packages
apt: name={{ item }} update_cache=yes
with_items:
- php5-cli
- php5-cgi
- php5-dev