Foswiki no Nginx

De MochilaWiki
Revisão de 00h52min de 2 de janeiro de 2012 por Banto Palmarino (discussão | contribs) (Criou página com 'roda <source lang="bash"> wget -c http://technotes.1000lines.net/fastcgi-wrapper.pl /usr/bin/spawn-fcgi -f /usr/bin/php5-cgi -s /var/run/php5-cgi.socket -P /var/run/spawn-fcgi.pi...')
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para navegaçãoIr para pesquisar

roda

wget -c http://technotes.1000lines.net/fastcgi-wrapper.pl
/usr/bin/spawn-fcgi -f /usr/bin/php5-cgi -s /var/run/php5-cgi.socket -P /var/run/spawn-fcgi.pid -C 5 -u www-data -g www-data
cd /var/www/Foswiki/bin; sudo -u www-data ./foswiki.fcgi -n 5 -l /var/run/nginx/foswiki.sock -p /var/run/foswiki.pid -d
        set $foswiki_root "/var/www/foswiki";
        location /foswiki {
                root /var/www/foswiki;
                index index.html; # should be changed after installation
        }
        location /foswiki/bin/configure {
                allow 127.0.0.1; # localhost, you may want to omit due to security considerations.
                allow 192.168.12.12; # you management host if you have one
                deny all;
                gzip off;
                fastcgi_pass   unix:/var/run/nginx/perl-cgi.sock;
                fastcgi_split_path_info ^/foswiki(/bin/configure)(?:\.pl)?(.*);
                fastcgi_param  SCRIPT_FILENAME  $foswiki_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
        }
        location /foswiki/bin/ {
                gzip off;
                fastcgi_pass   unix:/var/run/nginx/foswiki.sock;
                fastcgi_split_path_info ^(\w+)(?:\.pl)?(.*);
                fastcgi_param  SCRIPT_FILENAME  $foswiki_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO $fastcgi_path_info;
                fastcgi_param  SCRIPT_NAME  $fastcgi_script_name;
                fastcgi_param  PATH_TRANSLATED $foswiki_root$fastcgi_path_info;
                include fastcgi_params;
        }
        location ~ (^/lib|^/data|^/locale|^/templates|^/tools|^/work) {
                deny all;
        }
        if ($http_user_agent ~ ^SiteSucker|^iGetter|^larbin|^LeechGet|^RealDownload|^Teleport|^Webwhacker|^WebDevil|^Webzip|^Attache|^SiteSnagger|^WX_mail|^EmailCollector|^WhoWhere|^Roverbot|^ActiveAgent|^EmailSiphon|^CrownPeak-HttpAgent|^$) {
                rewrite .* /404.html break;
        }

add a redirect to the Main web:

rewrite ^/foswiki/?$ http://yousite.com/foswiki/bin/view.pl/Main permanent;

referência: