Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
UWSGIのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
UWSGI
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:ウェブサーバー]] [[en:Uwsgi]] Uwsgi は高速で自己回復機能のある、開発者とシステム管理人に優しいアプリケーションコンテナサーバーです。C だけで書かれています。 == インストール == [[公式リポジトリ]]の {{Pkg|uwsgi}} パッケージを[[インストール]]してください。パッケージをコンパクトにするために、プラグインは付属していません。外部プラグインは別にインストールする必要があります。C で書かれているためとても効率的なソフトウェアです。gunicorn など Python で書かれた代替も存在しますが、どうしても動作は遅くなってしまいます。 == サービスの起動 == {{Note|In the most simple configuration each application (i.e. python application) will get its own instance of uwsgi service. Before uwsgi service can be enabled/started a configuration file with the same name must be created within {{ic|/etc/uwsgi/}} When reading following lines assume that {{ic|/etc/uwsgi/helloworld.ini}} was created.}} {{Style|does not comply with [[Help:Style#systemd units operations]]}} スタートアップ時にデフォルトで uwsgi サービスを有効にするには、次を実行: # systemctl enable uwsgi@helloworld これで {{ic|/etc/uwsgi/helloworld.ini}} 設定されたアプリケーションのサービスが有効になります。また、以下のコマンドを使ってソケットインターフェイスで有効にすることも可能です: # systemctl enable uwsgi@helloworld.socket もしくは、[http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html Emperor モード] サービスを実行することができます。このモードを使うと uwsgi インスタンスで (emperor と呼ばれる) メインスーパーバイザーを使って様々なアプリ (vassal と呼ばれます) が動くようになります。有効にするには、次を入力: # systemctl enable emperor.uwsgi ソケットを使うこともできます: # systemctl enable emperor.uwsgi.socket Emperor の設定は {{ic|/etc/uwsgi/emperor.ini}} にあります。 == 設定 == {{Note|It seems /etc/uwsgi/archlinux.ini is not shipped with the standard install.}} {{ic|/etc/uwsgi/}} 内のファイルを編集することで設定ができます。パッケージに含まれているビルドファイルは {{ic|/etc/uwsgi/archlinux.ini}} に存在します。 詳しくは [http://uwsgi-docs.readthedocs.org/en/latest/ uwsgi のドキュメント] を見て下さい。 {{Note|Please refer to the following resource for the full list of all options: http://uwsgi-docs.readthedocs.org/en/latest/Options.html}} ===== アプリケーションの設定 ===== 以下は python をサポートするシンプルな例です。pacman で community リポジトリから uwsgi-plugin-python または uwsgi-plugin-python2 プラグインをインストールする必要があります。 [uwsgi] chdir = /srv/http/helloworld module = helloworld plugins = python 以下のような構文を使うことで uwsgi を別個に実行することも可能です: {{Note|It seems --wsgi-file option is not available from uwsgi installed through pacman. Official guides suggest building from sources (see http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html#installing-uwsgi-with-python-support).}} uwsgi --socket 127.0.0.1:3031 --plugin python2 --wsgi-file ~/foo.py --master --processes 4 --threads 2 --stats 127.0.0.1:9191 --uid --gid 上記のコマンドを root で実行するのは止めてください。 ==== Php applications ==== Install the php plugin for uwsgi: {{Pkg|uwsgi-plugin-php}} {{hc|/etc/uwsgi/mysite.ini|<nowiki> [uwsgi] ; maximum number of worker processes processes = 4 ; the user and group id of the process once it’s started uid = http gid = http socket = /run/uwsgi/%n.sock master = true chdir = /srv/http/%n ; php plugins = php ; jail our php environment php-docroot = /srv/http/%n php-index = index.php ; clear environment on exit vacuum = true </nowiki>}} ===== Nginx の設定 ===== location / { root /usr/share/nginx/html; index index.html index.htm; include uwsgi_params; # uwsgi_pass unix:/var/run/uwsgi/helloworld.sock; uwsgi_pass 127.0.0.1:3031; } == 参照 == * [http://uwsgi-docs.readthedocs.org/en/latest 公式ドキュメント] * [https://github.com/unbit/uwsgi-docs UWsgi Github] * [http://blog.kgriffs.com/ Fluffy White Stuff Benchmark] * [http://flask.pocoo.org/docs/deploying/uwsgi/ Flask uwsgi deploying] * [https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/ Django and uWSGI] * [http://www.youtube.com/watch?v=tD6UCfPCVLA Flask with uwsgi and nginx video] * [http://uwsgi-docs.readthedocs.org/en/latest/Apache.html Apache and uwsgi]
このページで使用されているテンプレート:
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Lowercase title
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
テンプレート:Tip
(
ソースを閲覧
)
UWSGI
に戻る。
検索
検索
UWSGIのソースを表示
話題を追加