https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/には、FCGIのセットアップの詳細が記載されていますが、Apache構成ファイルの資料はありますが、FCGIは省略されています。
127.0.0.1にバインドされた同じサーバーで実行され、ポート1234でリッスンしているデーモン化されたfastcgiプロセスのsite.fcgiファイルを作成するにはどうすればよいですか?
- 編集 -
httpd.confに次のものがあります。
FastCGIExternalServer /home/jonathan/store/deploy/store.fcgi -host 127.0.0.1:1234
<VirtualHost *:80>
ServerName steampunk.stornge.com
DocumentRoot /home/jonathan/store/
Alias /media /home/jonathan/store/media
RewriteEngine On
RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
RewriteCond %(REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /store.fcgi/$1 [QSA,L]
</VirtualHost>
/home/jonathan/store/deploy/store.fcgiにあります:
import os
import sys
from os.path import abspath, dirname, join
from site import addsitedir
sys.path.insert(0, abspath(join(dirname(__file__), "../")))
from django.conf import settings
os.environ["DJANGO_SETTINGS_MODULE"] = "store.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="true")
そして、私も走っています
python manage.py runfcgi method=threaded host=127.0.0.1 port=1234
http:// [hostname]をプルアップすると、次のようになります。
Not Found
The requested URL / was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.22 (Ubuntu) Server at [hostname] Port 80
http:// [hostname] / mediaは、入力されたインデックスをプルアップします。
このFCGIの使用で何が改善されるか、または問題を引き起こす可能性がありますか?store.cgiは、DjangoまたはFCGIドキュメントでSatchmoのモデルFCGIファイルが見つからなかった後に使用したいくつかの.fcgiファイルに基づいていました。私はそれをそれほど信用していません。私はただもっと良いものをグーグルで検索していません。
助言がありますか?