StupidBeauty
Read times:585Posted at:Wed Oct 26 18:07:30 2011
- no title specified

Wt维基文档翻译:在 Apache 上以FastCGI方式部署,FastCGI on Apache

原文:http://redmine.webtoolkit.eu/projects/1/wiki/Fastcgi_on_apache

Using mod_fastcgi

……

Using mod_fcgid

你需要先为Apache 启用mod_fcgid。在大多数情况下,可以这样做:将mods-available 中的配置文件fcgid.conf 链接到mods-enabled 中(可运行a2enmod 来做这件事)。

然后就要修改配置文件:

<IfModule mod_fcgid.c>

AddHandler fcgid-script .wt

SocketPath /var/lib/apache2/fcgid/sock

IdleTimeout -1

ProcessLifeTime -1

MaxProcessCount 10

DefaultMaxClassProcessCount 10

DefaultMinClassProcessCount 1

</IfModule>

再执行以下命令:

chown www-data:www-data /var/run/wt -R

在Apache中启用 CGI

然后,我们为Wt 程序创建一个新的“网站”配置文件:/etc/apache2/sites-available/wt,我们将它安装于/var/www/wt(必须位于你的docroot(站点文档根目录)中):

<Directory /var/www/wt/>

#Order Deny,Allow

Allow from all

#允许执行 CGIs

Options ExecCGI

</Directory>


然后,我们需要创建目录/var/run/wt,并且赋予Apache 服务器对那个目录的写权限。
然后,我启用这个网站,并且重新载入Apache 配置:

a2ensite wt

/etc/init.d/apache2 reload

如果这样还不行

你可能需要创建一个运行目录,并且给予正确的权限:

sudo mkdir /var/run/wt

sudo chown www-data:www-data /var/run/wt -R

确认一下你是否在/etc/wt/wt_config.xml中配置咯最少2个线程:

<num-threads>2</num-threads>

确认一下,你的wt 程序是与libwtfcgi 链接的,而不是与libwthttpd 链接的。例如,在你的CMakeLists.txt 文件中,这样写

target_link_libraries(hello.wt wt wtfcgi .......)


或者,对于Wt 中包含的示例来说,将EXAMPLES_CONNECTOR 设置成wtfcgi:

cmake -DEXAMPLES_CONNECTOR="wtfcgi"

看看你的apache 错误日志中的错误信息。尤其是看看能不能找到wt 抱怨说'stat'和'docroot not being set',这就意味着你的程序是链接到wthttpd,而不是链接到wtfastcgi 的;这种情况下,你需要先解决链接器选项的问题。

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4