<div dir="ltr">That sounds like a bug - It's probably worth reporting it as such.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 10:36 PM, SirNoSkill <span dir="ltr"><<a href="mailto:quandary82@hailmail.net" target="_blank">quandary82@hailmail.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I downloaded the sources for XSP from git.<br>
And it seems Mono.WebServer.FastCgi has been under quite a bit of<br>
change.<br>
First I wanted to thank the person(s) responsible for it, seems like the<br>
fastcgi server is finally stable, or at least stable enough that it<br>
hasn't crashed once in the last 2 weeks, including a performance load<br>
test.<br>
Keep up the good work.<br>
<br>
One thing though:<br>
It worked fine with TCP, but when I tried with unix sockets, I got this<br>
error:<br>
Error parsing permissions "". Use octal."<br>
<br>
In file<br>
/xsp/src/Mono.WebServer.FastCgi/main.cs<br>
in function public static bool TryCreateUnixSocket (string path, out<br>
Socket socket, string perm = null)<br>
<br>
there is this code:<br>
if (perm == null) {<br>
    socket = new UnixSocket (realPath);<br>
    Logger.Write (LogLevel.Debug, "Listening on file {0} with default<br>
    permissions", realPath);<br>
} else {<br>
    ushort uperm;<br>
    if (!UInt16.TryParse (perm, out uperm)) {<br>
        Logger.Write (LogLevel.Error, "Error parsing permissions<br>
        \"{0}\". Use octal.", perm);<br>
        return false;<br>
    }<br>
<br>
<br>
that should probably be<br>
if(string.IsNullOrEmpty(perm)){<br>
because UInt16.TryParse will fail if perm is string.Empty.<br>
<br>
If I fix this, fastcgi-server starts, but I get a HTTP 502.<br>
Since the config works fine if I use TCP, I guess this is a<br>
fastcgi-server bug.<br>
Just thought I let you know.<br>
<br>
It's unlikely it's a permission bug, since I let fastcgi-mono-server4<br>
run as root.<br>
Just in case, here my configuration settings:<br>
<br>
This is my fastcgi-start script<br>
<br>
#!/bin/sh<br>
<br>
### BEGIN INIT INFO<br>
# Provides:          monoserve.sh<br>
# Required-Start:    $local_fs $syslog $remote_fs<br>
# Required-Stop:     $local_fs $syslog $remote_fs<br>
# Default-Start:     2 3 4 5<br>
# Default-Stop:      0 1 6<br>
# Short-Description: Start fastcgi mono server with hosts<br>
### END INIT INFO<br>
<br>
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br>
DAEMON=/usr/bin/mono<br>
NAME=monoserver<br>
DESC=monoserver<br>
<br>
MONOSERVER=$(which fastcgi-mono-server4)<br>
MONOSERVER_PID=$(ps auxf | grep fastcgi-mono-server4.exe | grep -v grep<br>
| awk '{print $2}')<br>
<br>
WEBAPPS="www.example.com:/:/root/VS2010/SqlWebAdmin/SqlWebAdmin/,example.com:/:/root/VS2010/SqlWebAdmin/SqlWebAdmin/"<br>
#WEBAPPS="www.domain1.xyz:/:/var/www/domain1.xyz/,www.domain2.xyz:/:/var/www/domain2.xyz/"<br>
<br>
case "$1" in<br>
        start)<br>
                if [ -z "${MONOSERVER_PID}" ]; then<br>
                        echo "starting mono server"<br>
<br>
<br>
                        # ${MONOSERVER} /applications=${WEBAPPS}<br>
                        /socket=unix:/tmp/fastcgi.socket &<br>
                        # ${MONOSERVER} /applications=${WEBAPPS}<br>
                        /socket=tcp:<a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a> &<br>
                        ${MONOSERVER} /applications=${WEBAPPS}<br>
                        /socket=unix:/var/run/mono3-fcgi.sock &<br>
                        echo "mono server started"<br>
                else<br>
                        echo ${WEBAPPS}<br>
                        echo "mono server is running"<br>
                fi<br>
        ;;<br>
        stop)<br>
                if [ -n "${MONOSERVER_PID}" ]; then<br>
                        kill ${MONOSERVER_PID}<br>
                        echo "mono server stopped"<br>
                else<br>
                        echo "mono server is not running"<br>
                fi<br>
        ;;<br>
        *) echo "You have provided no or an invalid command line<br>
        argument."<br>
        ;;<br>
esac<br>
<br>
exit 0<br>
<br>
<br>
<br>
and this the nginx configuration<br>
<br>
<br>
##<br>
# You should look at the following URL's in order to grasp a solid<br>
understanding<br>
# of Nginx configuration files in order to fully unleash the power of<br>
Nginx.<br>
# <a href="http://wiki.nginx.org/Pitfalls" target="_blank">http://wiki.nginx.org/Pitfalls</a><br>
# <a href="http://wiki.nginx.org/QuickStart" target="_blank">http://wiki.nginx.org/QuickStart</a><br>
# <a href="http://wiki.nginx.org/Configuration" target="_blank">http://wiki.nginx.org/Configuration</a><br>
#<br>
# Generally, you will want to move this file somewhere, and start with a<br>
clean<br>
# file but keep this around for reference. Or just disable in<br>
sites-enabled.<br>
#<br>
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed<br>
examples.<br>
##<br>
<br>
<br>
 server {<br>
         listen   80;<br>
         server_name <a href="http://www.example.com" target="_blank">www.example.com</a> <a href="http://example.com" target="_blank">example.com</a>;<br>
         access_log   /var/log/nginx/your.domain1.xyz.access.log;<br>
<br>
         location / {<br>
                 root /root/VS2010/SqlWebAdmin/SqlWebAdmin;<br>
                 #index index.html index.htm default.aspx Default.aspx;<br>
                 #fastcgi_index Default.aspx;<br>
                 #fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
                 fastcgi_pass unix:/var/run/mono3-fcgi.sock;<br>
                 include /etc/nginx/fastcgi_params;<br>
         }<br>
<br>
<br>
<br>
<br>
        location /doc {<br>
                root /usr/share;<br>
                autoindex on;<br>
                allow 127.0.0.1;<br>
                deny all;<br>
        }<br>
<br>
        location /shared_images {<br>
                root /usr/share;<br>
                autoindex off;<br>
        }<br>
<br>
        error_page 404 /CustomErrors/404.htm;<br>
<br>
        # redirect server error pages to the static page /50x.html<br>
        #<br>
        #error_page 500 502 503 504 /50x.html;<br>
        #location = /50x.html {<br>
        #       root /usr/share/nginx/www;<br>
        #}<br>
<br>
}<br>
<br>
<br>
/etc/hosts entries:<br>
127.0.0.1       <a href="http://example.com" target="_blank">example.com</a><br>
127.0.0.1 <a href="http://www.example.com" target="_blank">www.example.com</a><br>
<br>
<br>
Kind regards<br>
<br>
NoSkillz<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<a href="http://www.fastmail.fm" target="_blank">http://www.fastmail.fm</a> - IMAP accessible web-mail<br>
<br>
_______________________________________________<br>
Mono-devel-list mailing list<br>
<a href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
</font></span></blockquote></div><br></div>