如何使用uWSGI设置Perl Dancer环境(与nginx一起使用)

时间:2015-08-13 19:10:49

标签: nginx uwsgi dancer plack psgi

我试图在生产环境中启动Perl Dancer应用程序。

我按如下方式调用uWSGI:

==42296== Invalid free() / delete / delete[] / realloc()
==42296==    at 0x10000B957: free (vg_replace_malloc.c:480)
==42296==    by 0x100038594: std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::pbackfail(int) (in /opt/local/lib/libgcc/libstdc++.6.dylib)
==42296==    by 0x1048056C7: ???
==42296==    by 0x27: ???
==42296==    by 0x1048053E7: ???
==42296==    by 0x100038CA1: std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow(int) (in /opt/local/lib/libgcc/libstdc++.6.dylib)
==42296==    by 0x672A2E24: ???
==42296==    by 0x1000033E7: ??? (in ./a.out)
==42296==  Address 0x1000033d0 is in the Data segment of ./a.out
==42296==
(1,0) (0,0)
(0,0) (1,0)
==42296==
==42296== HEAP SUMMARY:
==42296==     in use at exit: 111,830 bytes in 436 blocks
==42296==   total heap usage: 523 allocs, 91 frees, 124,150 bytes allocated
==42296==
==42296== LEAK SUMMARY:
==42296==    definitely lost: 0 bytes in 0 blocks
==42296==    indirectly lost: 0 bytes in 0 blocks
==42296==      possibly lost: 0 bytes in 0 blocks
==42296==    still reachable: 76,948 bytes in 5 blocks
==42296==         suppressed: 34,882 bytes in 431 blocks

当应用程序加载并运行时,它充满了错误,因为根本没有设置环境(甚至没有设置默认开发环境)。

这些似乎不起作用:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl

仅供参考,这是有效的,使用plackup&amp;星人:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env production
uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl production

我已经读完了这个: http://uwsgi-docs.readthedocs.org/en/latest/Options.html但似乎并不是特定于Dancer的环境设置,例如Python版本。

思考? Thx提前!

1 个答案:

答案 0 :(得分:3)

好的,刚回答了我自己的问题。

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env PLACK_ENV=production

希望这对其他人有帮助。