阿帕奇和Cutelyst

Apache and Cutelyst

阿帕奇和Cutelyst

Buschmann edited this page on Jul 12, 2017 · 2 revisions

Buschmann于2017年7月12日编辑本页

Beside running Cutelyst apps with cutelyst-wsgi as standalone web server you can run Cutelyst applications behind an Apache web server using Apache's mod_proxy and mod_proxy_http or mod_proxy_fcgi.

​除了使用Cutelyst wsgi作为独立web服务器运行Cutelyst应用程序外,还可以在Apache web服务器后面使用Apache的mod_proxy和mod_proxy_http或mod_proxy_fcgi运行Cutelyst应用程序。

We will make the following assumptions for paths and users/groups. These might be different on your distribution/operating system:

我们将对路径和用户/组进行以下假设。这些在您的发行版/操作系统上可能有所不同:

  • Apache user: wwwrun
  • Apache group: www
  • Cutelyst FastCGI socket path: /run/mycutelystapp.sock
  • HTTP/1.1 TCP socket: 127.0.0.1:3000
  • Cutelyst app file path: /usr/lib64/cutelyst-apps/mycutelystapp.so
  • Cutelyst app user: myuser
  • Cutelyst app group: mygroup
  • Cutelyst app static files path: /usr/share/mycutelystapp/templates/default/static

Cutelyst, FastCGI and mod_proxy_fcgi

Up to Cutelyst 1.6.0 there are some issues in Cutelyst (#37) and Qt (#38) that prevent the usage of Cutelyst together with Apache via FastCGI. So you should use Cutelyst 1.7.0 or newer.

​在Cutelyst 1.6.0之前,Cutelyst(#37)和Qt(#38)中存在一些问题,阻止通过FastCGI与Apache一起使用Cutelyst。所以你应该使用Cutelyst 1.7.0或更新版本。

For this approach you need to have mod_proxy and mod_proxy_fcgi enabled in your Apache web server.

对于这种方法,您需要在Apache web服务器中启用mod_proxy和mod_proxy_fcgi。

a2enmod proxy
a2enmod proxy_fcgi

Apache virtual host configuration with unix domain socket

使用unix域套接字配置Apache虚拟主机

This needs Apach 2.4.9 or newer.

这需要Apach2.4.9或更新版本。

<VirtualHost *:80>
    ServerName example.com

    ProxyPass / unix:/run/mycutelystapp.sock|fcgi://mycutelystapp/

    # optionally you can serve your static files directly with Apache instead of Cutelyst
    # for this you need to have mod_alias to be enabled
    Alias /static /usr/share/mycutelystapp/templates/default/static
    <Location /static>
        ProxyPass !
        Require all granted
    </Location>
</VirtualHost>

cutelyst-wsgi command line parameters for this:

cutelyst wsgi命令行参数:

cutelyst-wsgi -a /usr/lib64/cutelyst-apps/mycutelystapp.so -uid myuser --gid mygroup --fastcgi-socket /run/mycutelystap

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值