部署TaskBoard
- kiswa/TaskBoard: A Kanban-inspired app for keeping track of things that need to get done.
- 遇到问题:php fpm - Nginx 1 FastCGI sent in stderr: “Primary script unknown”
- 解决问题:503 error on nginx/php-fpm using your config · Issue #117 · kiswa/TaskBoard
快捷脚本(Debian系)
php+Nginx
cd /
sudo git clone https://github.com/kiswa/TaskBoard.git
cd TaskBoard
./build/composer.phar install
#sudo apt-get install openjdk-7-jre;cd /TaskBoard/build;./build-all
sudo chown -R www-data:www-data /TaskBoard
sudo apt-get install nginx
sudo apt-get install php5 php5-fpm php-apc php5-curl php5-cli php-pear php5-gd -y
sudo apt-get php5-sqlite sqlite3 -y
./build/composer.phar install
提示
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing firebase/php-jwt (1.0.0)
Downloading: 100%
- Installing gabordemooij/redbean (v4.2.0)
Downloading: 100%
- Installing ircmaxell/password-compat (v1.0.4)
Downloading: 100%
- Installing phpmailer/phpmailer (v5.2.14)
Downloading: 100%
- Installing slim/slim (2.6.1)
Downloading: 100%
phpmailer/phpmailer suggests installing league/oauth2-client (Needed for XOAUTH2 authentication)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Gmail XOAUTH2)
slim/slim suggests installing ext-mcrypt (Required for HTTP cookie encryption)
php-fpm sock路径:
/var/run/php5-fpm.sock;
查看php-fpm状态:
netstat -alnp | grep LISTEN | grep php
重启php-fpm:
sudo kill -USR2 `cat /run/php5-fpm.pid`
Nginx配置:
参考了 Issue #117 · kiswa/TaskBoard
server {
listen 8000 default_server;
root /TaskBoard/;
index index.php index.html;
# Make site accessible from http://localhost/
server_name localhost;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /api {
if (!-e $request_filename) {
rewrite ^(.*)$ /api/api.php last; break;
}
}
location /api/taskboard.db {
rewrite ^(.*)$ /api/api.php last; break;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi.conf;
}
}