尝试使用 Mono 在 Apache 上使用 FastCGI 运行 ASP.NET MVC 应用程序

尝试使用 Mono 在 Apache 上使用 FastCGI 运行 ASP.NET MVC 应用程序

我有一个 DreamHost 托管帐户,我想使用同一个帐户来运行 ASP.NET 应用程序。我在子域中部署了一个应用程序,即一个带有如下处理程序的 .htaccess:

# Define the FastCGI Mono launcher as an Apache handler and let
# it manage this web-application (its files and subdirectories)
SetHandler monoWrapper
Action monoWrapper /home/arienh4/<domain>/cgi-bin/mono.fcgi virtual

我的 mono.fcgi 设置如下:

#!/bin/sh
#umask 0077
exec >>/home/arienh4/tmp/mono-fcgi.log
exec 2>>/home/arienh4/tmp/mono-fcgi.err

echo $(date +"[%F %T]") Starting fastcgi-mono-server2

cd /
chmod 0700 /home/arienh4/tmp/mono-fcgi.sock
echo $$>/home/arienh4/tmp/mono-fcgi.pid
# stdin is the socket handle
export PATH="/home/arienh4/mono/bin:$PATH"
export LD_LIBRARY_PATH="/home/arienh4/mono/lib:$LD_LIBRARY_PATH"
export TMP="/home/arienh4/tmp"
export MONO_SHARED_DIR="/home/arienh4/tmp"
exec /home/arienh4/mono/bin/mono /home/arienh4/mono/lib/mono/2.0/fastcgi-mono-server2.exe \
/logfile=/home/arienh4/logs/fastcgi-mono-web.log /loglevels=All \
/applications=/:/home/arienh4/<domain>

我从 Mono 网站上为 CGI 摘录了此代码。但我不确定我是否做得正确。此代码导致此错误:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

我不知道是什么原因造成的。据我所知,Mono 甚至没有受到影响(没有创建日志文件)。

答案1

您是否正在运行任何 ModRewrite 脚本?通常,不正确的 ModRewrite 会导致无限循环,从而导致这种情况。

您可能需要打开 mod_cgi“ScriptLog”指令,它将记录您的 CGI 脚本的执行情况。

相关内容