Dokuwiki has been extracted to E:\www\dokuwiki.
This is an example for dokuwiki entry in nginx.conf running on Windows:
location ~ ^/dokuwiki/.*\.php { root E:/www; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME E:/www$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; include fastcgi_params; } # serve static files location ~ ^/dokuwiki/lib/ { root E:/www; expires 30d; } location ~ ^/dokuwiki/conf/ { deny all; } location ~ ^/dokuwiki/data/ { deny all; } location ~ /\.ht { deny all; }
FastCGI and nginx have been started using this batch file:
ECHO Starting PHP FastCGI... RunHiddenConsole.exe E:\appl\php-5.2.9-2-Win32\php-cgi.exe -b 127.0.0.1:9000 ECHO Starting nginx... cd /d D:\nginx-0.8.39 && start nginx.exe
This configuration was tested on Ubuntu 10.04. It uses Upstart to start fastcgi. Make sure the following packages are installed:
Edit /etc/nginx/nginx.conf:
user www-data www-data; #(...) http { #(...) server{ #listen 80; index index.html index.php doku.php; #make sure a global root is defined here #(...) location ~ ^/dokuwiki/.*\.php { root /usr/share/dokuwiki #adapt if needed include fastcgi_params; fastcgi_pass unix:/tmp/php-fastcgi.socket; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # serve static files location ~ ^/dokuwiki/lib/ { root /usr/share/dokuwiki/lib #adapt if needed expires 30d; } location ~ ^/dokuwiki/conf/ { deny all; } location ~ ^/dokuwiki/data/ { deny all; } location ~ /\.ht { deny all; } } }
To launch fastcgi, we create the file php-fastcgi.conf (sudo gedit /etc/init/php-fastcgi.conf) with the following content:
description "php-fastcgi - keep up php-fastcgi" start on runlevel [2345] stop on runlevel [!2345] respawn exec /usr/bin/sudo -u www-data PHP_FCGI_CHILDREN=2 PHP_FCGI_MAX_REQUESTS=125 /usr/bin/php-cgi -q -b /tmp/php-fastcgi.socket
We can either reboot (→fastcgi and nginx should run automatically), or use the following commands for manual testing:
Note: If you see the error “No input file specified”, this may be a permissions issue. Make sure fastcgi and nginx run as the same user (above: www-data). Make sure file permissions are OK.