2013-04-28 29 views
12

i đã biên dịch uwsgi với công cụ và nó được thực hiện thành công, và bây giờ tôi quyết định chạy trang django1.5 của tôi với python3.3. Tôi đã kiểm tra cho doc (http://projects.unbit.it/uwsgi/wiki/Guide4Packagers) và thiết lập tiêu đề phát triển python3.3 qua apt-get và sau đó biên dịch các plugin bởi:plugin python3 uwsgi không hoạt động

python3.3 uwsgiconfig.py --plugin plugins/gói python python33

sau đó nó nói:

using profile: buildconf/package.ini 
detected include path: ['/usr/lib/gcc/i686-linux-gnu/4.7/include', '/usr/local/include','/usr/lib/gcc/i686-linux-gnu/4.7/include-fixed', '/usr/include/i386-linux-gnu', '/usr/include'] 
*** uWSGI building and linking plugin plugins/python *** 
[i686-linux-gnu-gcc -pthread] /usr/lib/uwsgi/python33_plugin.so 
*** python33 plugin built and available in /usr/lib/uwsgi/python33_plugin.so *** 

có vẻ như tất cả cũng được thực hiện và tôi làm tìm python33_plugin.so trong dir đó. nginx đang chạy và là ok, bây giờ tập tin ini uwsgi của tôi là như thế này:

[uwsgi] 
socket=0.0.0.0:8000 
listen=20 
master=true 
pidfile=/usr/local/nginx/uwsgi.pid 
processes=2 
plugins=python33 
module=django_wsgi 
pythonpath= 
profiler=true 
memory-report=true 
enable-threads=true 
logdate=true 
limit-as=6048 

và khi tôi chạy "sudo ./uwsgi uwsgi.ini",

[uWSGI] getting INI configuration from uwsgi.ini 
open("./python33_plugin.so"): No such file or directory [core/utils.c line 3347] 
!!! UNABLE to load uWSGI plugin: ./python33_plugin.so: cannot open shared object file: No such file or directory !!! 

nó không tìm thấy các .so file.anyway sau đó tôi copy file .so với uwsgi dir, và chạy lại,

[uWSGI] getting INI configuration from uwsgi.ini 
Sun Apr 28 22:54:40 2013 - *** Starting uWSGI 1.9.8 (32bit) on [Sun Apr 28 22:54:40 2013] *** 
Sun Apr 28 22:54:40 2013 - compiled with version: 4.7.3 on 28 April 2013 21:25:27 
Sun Apr 28 22:54:40 2013 - os: Linux-3.8.0-19-generiC#29-Ubuntu SMP Wed Apr 17 18:19:42 UTC 2013 
Sun Apr 28 22:54:40 2013 - nodename: bill-Rev-1-0 
Sun Apr 28 22:54:40 2013 - machine: i686 
Sun Apr 28 22:54:40 2013 - clock source: unix 
Sun Apr 28 22:54:40 2013 - pcre jit disabled 
Sun Apr 28 22:54:40 2013 - detected number of CPU cores: 4 
Sun Apr 28 22:54:40 2013 - current working directory: /media/bill/cloud/cloud/program/kkblog/kkblog 
Sun Apr 28 22:54:40 2013 - writing pidfile to /usr/local/nginx/uwsgi.pid 
Sun Apr 28 22:54:40 2013 - detected binary path: /usr/sbin/uwsgi 
Sun Apr 28 22:54:40 2013 - uWSGI running as root, you can use --uid/--gid/--chroot options 
Sun Apr 28 22:54:40 2013 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
Sun Apr 28 22:54:40 2013 - your processes number limit is 31552 
Sun Apr 28 22:54:40 2013 - limiting address space of processes... 
Sun Apr 28 22:54:40 2013 - your process address space limit is 2046820352 bytes (1952 MB) 
Sun Apr 28 22:54:40 2013 - your memory page size is 4096 bytes 
Sun Apr 28 22:54:40 2013 - detected max file descriptor number: 1024 
Sun Apr 28 22:54:40 2013 - lock engine: pthread robust mutexes 
Sun Apr 28 22:54:40 2013 - uwsgi socket 0 bound to TCP address 0.0.0.0:8000 fd 3 
Sun Apr 28 22:54:40 2013 - Python version: 2.7.4 (default, Apr 19 2013, 18:35:44) [GCC 4.7.3] 
Sun Apr 28 22:54:40 2013 - Python main interpreter initialized at 0x973e2d0 
Sun Apr 28 22:54:40 2013 - python threads support enabled 

tôi đang sử dụng ubuntu 13.04 và python2.7 và python3.3 được cài đặt sẵn.

I THIẾT LẬP PYTHON33 PLUGIN NHƯNG UWSGI VẪN VUI LÒNG PYTHON2.7, tại sao?

bất kỳ ai từng gặp vấn đề này? và bằng cách này tôi không muốn thiết lập uwsgi và plugin thông qua apt-get, bởi vì nó sẽ không hoạt động ở bất kỳ PaaS nào.

cảm ơn!

Trả lời

11

Bạn đã xây dựng một nhị phân uWSGI nguyên khối với python 2.7 được nhúng để một plugin không thể ghi đè vùng nhớ đó. Bạn có thể xây dựng một nhị phân python3 nguyên khối đơn giản sử dụng:

python3 uwsgiconfig.py --build 

hoặc sử dụng pip cho python3

Nếu không, bạn có thể xây dựng một hệ thống đầy đủ mô-đun với:

python uwsgiconfig.py --build core 
python uwsgiconfig.py --plugin plugins/python core python27 
python3 uwsgiconfig.py --plugin plugins/python core python33