[Mono-aspnet-list] FastCgi Mono Server and Apache
loopedcode
bdkid39 at hotmail.com
Sun Sep 13 13:56:48 EDT 2009
I have been trying to setup the fastcgi-mono-server2 with Apache without any
success. I can run xsp fine and it serves aps.net pages perfectly.
Is there any definitive guide on how to setup fastcgi mono server with
apache? I could only find sparse info on how to set it up. I would
appreciate if anyone can point to right setup steps or guide.
Here are my setup:
mono and xsp was installed with prefix /usr/local.
Apache version is: 1.3
My CGI file:
#!/bin/bash
/home/user1/bin/mono-fcgi &
exec /usr/local/bin/cgi-fcgi \
-bind -connect /home/user1/tmp/mono-fcgi.sock
Here is the mono-fcgi file:
#!/bin/sh
SOCKET="/home/user1/tmp/mono-fcgi.sock"
PIDFILE="/home/user1/tmp/mono-fcgi.pid"
function log()
{
echo "[log:] $@" >> /home/user1/bin/mono-fcgi.err
}
function spawn()
{
umask 0077
chmod 0777 /home/user1/tmp/mono-fcgi.sock
echo $$ > $PIDFILE
export PREFIX="/usr/local"
export LDFLAGS="-Wl,--rpath -Wl,$PREFIX"
export LD_LIBRARY_PATH="$PREFIX/lib"
export LD_RUN_PATH="$PREFIX/lib"
export PATH="$PREFIX/bin:$PATH"
export
MONO_GAC_PREFIX="$PREFIX/lib/mono:$PREFIX/lib/mono/gac:$MONO_GAC_PREFIX"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export TMP="/home/user1/tmp"
export MONO_SHARED_DIR="/home/user1/tmp"
# stdin is the socket handle
exec env \
/usr/local/bin/fastcgi-mono-server2 \
/socket=unix:$SOCKET \
/root=/home/user1/www/aspnet \
/applications=/:/home/user1/www/aspnet \
/logfile=/home/user1/bin/mono-fcgi.log \
/loglevels=All \
2>> /home/user1/bin/mono-fcgi.err
echo -1 > $PIDFILE
}
function startIfNotRunning()
{
touch $PIDFILE
PID="$(cat $PIDFILE)"
if ps $PID >& /dev/null; then
exit 0
else
spawn
fi
}
startIfNotRunning
--
View this message in context: http://www.nabble.com/FastCgi-Mono-Server-and-Apache-tp25420953p25420953.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
More information about the Mono-aspnet-list
mailing list