將域名解析至主機 IP,推薦使用 DNSPod 管理監控。
需 PHP 5.3+。安裝 Nginx、PHP-FPM,確保環境正常運行。
server {
listen 80;
server_name yourdomain.com;
root /data/vhosts/yourdomain.com;
index index.html index.htm index.php;
location ~ \.(jpg|png|gif|js|css|swf|flv|ico)$ {
expires 12h;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~* ^/(doc|logs|app|sys)/ {
return 403;
}
location ~ .*\.(php|php5)?$ {
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
修改 server_name、root、fastcgi_pass 為實際值。
Gitblog 需寫入 app/cache 目錄,確保 PHP 進程用戶擁有寫入權限(通常將目錄擁有者改為 CGI 運行賬戶)。
PHP 5.2.4+
posts 目錄即可發布