Nginx blocks file upload to static page: 405 Not Allowed - file-upload

I'm having a problem with my Nginx server. I installed a new server and thought I put up the same installation as on my old one. However, since then, I cannot upload files to static pages. I had an upload function in an index.php. It still works when I explicitly call index.php, but when I just call /, it gives me a 405 error.
I have seen numerous discussions on the internet where it all comes down to nginx not allowing POST requests to static files. However, my installation accepts POST requests to static files, but no file uploads. To clarify, this is my current situation:
+----------------------+-------------+------------------+
| | Common POST | With file upload |
+----------------------+-------------+------------------+
| Request to / | Allowed | Allowed |
| Request to index.php | Allowed | 405 Not Allowed |
+----------------------+-------------+------------------+
It probably doesn't add anything, but for the sake of completeness: I'm running a WordPress site on this server as well, and since migrating the server I have not been able to upload new media.
The logfiles (/var/log/nginx/error.log, /var/log/php5-fpm.log, /var/log/syslog) don't give any information. Later, I enabled logging for the FastCGI pool as well, and there in the access log, there is no record of the POST requests to the static page. So nginx must block them before they get to FastCGI.
The relevant PHP ini settings:
enable_post_data_reading On
file_uploads On
max_file_uploads 20
upload_max_filesize 20M
upload_tmp_dir no value
How can I make it work again?
Additional information
There are some differences between my old server and the new server (maybe more, but I'm not aware):
In nginx, before, I had to use fastcgi_pass 127.0.0.1:9000; - now, this doesn't work anymore, but I'm using fastcgi_pass unix:/var/run/php5-fpm.sock;. I'm not sure why this is or if it matters
I built nginx from source. Here are the different installations, first the old one:
$ nginx -V
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-16ubuntu6)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module
And the new one:
$ nginx -V
nginx version: nginx/1.6.0
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/home/camilstaps/nginx-modules/nginx-auth-pam --add-module=/home/camilstaps/nginx-modules/nginx-dav-ext-module --add-module=/home/camilstaps/nginx-modules/ngx_http_substitutions_filter_module --with-http_mp4_module --with-http_flv_module
The old PHP version:
$ php5 -v
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
And the new one:
$ php5 -v
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Lastly, I still have access to my old installation. So if you'd like to see the content of some file or the output of some command that's possible.

The problem turned out to be that I had put directives from the http_mp4_module in the location / block:
location / {
...
mp4;
}
Apparently, this gives a conflict somehow.
I removed the directives from this block and put them in a location ~ \.mp4 block.

Related

/etc/apache2/modules/mod_mpm_prefork.so not found in docker image

When starting apache I get an error of AH00534: apache2: Configuration error: No MPM loaded
So I added the module:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
/etc/apache2/modules/mod_mpm_prefork.so: cannot open shared object file: No such file or directory
apachectl -V | grep -i mp
returns:
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Server MPM: prefork
Server compiled with....
How am I meant to load the module? Is the path different perhaps (I'm using the docker image of php:5.6-apache-stretch.
I needed to include:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
before loading the modules

Apache Traffic Server forward proxy basic authentication

I'm trying to set up a forward proxy server with basic proxy authentication using Apache Traffic Server (ATS) on CentOS 6. I've already successfully deployed both SQUID and Apache httpd mod_proxy forward proxies with basic proxy authentication, and want to do the same with ATS to compare performance.
I'm trying to use the basic-auth plugin example provided by ATS, with multiple issues.
I add the latest epel repo for CentOS 6 and install both trafficserver and trafficserver-devel (required to use the ATS compiler, tsxs) packages. I copy the basic-auth.c file from source to my user directory and attempt to compile:
# tsxs -v -o /root/basic-auth.so -c /root/basic-auth.c
Whereupon I get errors for files not found - ts/ink_defs.h
This file is generated by running autoconfig -if and configure on the source code - so I went ahead and cloned the trafficserver git repo and ran through the steps to make the few hundred files in /opt/ts/. I copied these to the directory that tsxs looks at - /usr/include/ts/ (which is here because it is the default location when installed using trafficserver-devel (when I previously only had installed traffic server from source, tsxs would not run).
With the files now in place, I ran the compiler again on basic-auth.cc. This time I receive errors in ts.h, because of an sdk_version parameter:
# tsxs -v -o basic-auth.so basic-auth.c
compiling basic-auth.c -> basic-auth.lo
cc -I/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -feliminate-unused-debug-symbols -fno-strict-aliasing -mcx16 -fpic -c basic-auth.c -o basic-auth.lo
In file included from basic-auth.c:30:
/usr/include/ts/ts.h:158: error: expected ‘)’ before ‘sdk_version’
In file included from /usr/include/ts/ink_defs.h:28,
from basic-auth.c:31:
/usr/include/ts/ink_config.h:41:26: error: ink_autoconf.h: No such file or directory
basic-auth.c: In function ‘TSPluginInit’:
basic-auth.c:222: warning: implicit declaration of function ‘TSPluginRegister’
tsxs: compilation failed: cc -I/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -feliminate-unused-debug-symbols -fno-strict-aliasing -mcx16 -fpic -c basic-auth.c -o basic-auth.lo
I investigated the code for ts.h and compared it with the latest source. You can see that line 156 changes:
trafficserver-devel:
tsapi TSReturnCode TSPluginRegister(TSSDKVersion sdk_version, TSPluginRegistrationInfo plugin_info);
source:
tsapi TSReturnCode TSPluginRegister(TSPluginRegistrationInfo *plugin_info);
Hence I'm assuming there's some issue with the versioning. I replaced my version of ts.h with the latest source and attempted the compile again: it works!
I copy the .so file to the plugins directory and modify plugins.config and records.config accordingly. Alas, when I try to start up trafficserver, it fails with a segmentation fault:
# /usr/bin/traffic_server
traffic_server: using root directory '/usr'
[Jul 15 16:19:21.224] Server {0x7fd9458ba7e0} DEBUG: (dns) ink_dns_init: called with init_called = 0
[Jul 15 16:19:21.227] Server {0x7fd9458ba7e0} DEBUG: (dns) localhost=vmProxy1
[Jul 15 16:19:21.227] Server {0x7fd9458ba7e0} DEBUG: (dns) Round-robin nameservers = 1
traffic_server: Segmentation fault (Signal sent by the kernel [(nil)])traffic_server - STACK TRACE:
/usr/bin/traffic_server(_Z19crash_logger_invokeiP7siginfoPv+0x99)[0x4a5209]
/lib64/libpthread.so.0[0x35b600f710]
/lib64/libc.so.6[0x35b5d3362f]
/usr/lib64/trafficserver/libtsutil.so.5(_xstrdup+0x6d)[0x7fd945f2b6cd]
/usr/bin/traffic_server(TSPluginRegister+0x7c)[0x4bcb6c]
/usr/lib64/trafficserver/plugins/basic-auth.so(TSPluginInit+0x2f)[0x7fd942334e1f]
/usr/bin/traffic_server(_Z11plugin_initb+0x322)[0x4dab22]
/usr/bin/traffic_server(main+0x1424)[0x4d2754]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x35b5c1ed5d]
/usr/bin/traffic_server[0x4942a9]
Segmentation fault (core dumped)
I tried to use gdb to get a better debug log, but I don't see anything useful. There's another mention of sdk_version - but I'm starting to think that hopping around files and replacing them isn't how it's meant to work...
Starting program: /usr/bin/traffic_server
[Thread debugging using libthread_db enabled]
traffic_server: using root directory '/usr'
[New Thread 0x7ffff7704700 (LWP 19967)]
[Jul 15 16:18:28.841] Server {0x7ffff77777e0} DEBUG: (dns) ink_dns_init: called with init_called = 0
[New Thread 0x7ffff68ff700 (LWP 19968)]
[New Thread 0x7ffff67fe700 (LWP 19969)]
[Jul 15 16:18:28.844] Server {0x7ffff77777e0} DEBUG: (dns) localhost=vmProxy1
[Jul 15 16:18:28.844] Server {0x7ffff77777e0} DEBUG: (dns) Round-robin nameservers = 1
[New Thread 0x7ffff46f5700 (LWP 19970)]
[New Thread 0x7ffff44f3700 (LWP 19971)]
Program received signal SIGSEGV, Segmentation fault.
__strlen_sse42 () at ../sysdeps/x86_64/multiarch/strlen-sse4.S:32
32 pcmpeqb (%rdi), %xmm1
Missing separate debuginfos, use: debuginfo-install tcl-8.5.7-6.el6.x86_64
(gdb) bt
#0 __strlen_sse42 () at ../sysdeps/x86_64/multiarch/strlen-sse4.S:32
#1 0x00007ffff7de86cd in _xstrdup (str=0xd46e3934ae7d6389 <Address 0xd46e3934ae7d6389 out of bounds>, length=-1)
at ink_memory.cc:231
#2 0x00000000004bcb6c in TSPluginRegister (sdk_version=<value optimized out>, plugin_info=0x7fffffffcc50)
at InkAPI.cc:1803
#3 0x00007ffff41f1e1f in TSPluginInit (argc=<value optimized out>, argv=<value optimized out>) at /root/basic-auth.c:222
#4 0x00000000004dab22 in plugin_load (validateOnly=false) at Plugin.cc:114
#5 plugin_init (validateOnly=false) at Plugin.cc:265
#6 0x00000000004d2754 in main (argv=<value optimized out>) at Main.cc:1714
Any hints or tips on what I might be doing wrong are very much appreciated.
Yeah, this is somewhat unfortunate, but the examples in the source tree is not intended to be compiled with tsxs. You would need to make a few changes in the code to make it work. For example, see this git commit I made to the version.c example:
diff --git a/example/version/version.c b/example/version/version.c
index f5c8126..4020a0c 100644
--- a/example/version/version.c
+++ b/example/version/version.c
## -24,10 +24,9 ##
#include <stdio.h>
#include "ts/ts.h"
-#include "ts/ink_defs.h"
void
-TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
+TSPluginInit(int argc , const char *argv[])
{
TSPluginRegistrationInfo info;
As for the Version information, this was removed for ATS v6.0.0, which means older plugins also need to be modified to remove it. This also makes previously built binaries are not compatible. There are probably better tools to use than tsxs as well, including the pkgconfig support, and traffic_layout.

configure: error: APR-util version 1.2.0 or later is required

I find the following error when I installed httpd-2.2.21:
checking for APR-util version 1.2.0 or later... no
configure: error: APR-util version 1.2.0 or later is required
I've installed apr-1.4.5, apr-util-1.3.12.
then i do configure:
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
I don't know why.
I don't see this error in old apache httpd version, the new apache package has included apr source code under folder srclib, so if you see this error, just add with ./configure
--with-apr=$APACHE_SOURCE/srclib --with-apr-util=$APACHE_SOURCE/srclib --with-included-apr
When you download Apache (httpd 2.4), there is a directory which is called /srclib.
cd into that directory with cd /srclib. Open your browser and go to http://apr.apache.org/download.cgi and download the .apr files into the directory.
wget <link>
Unzip and extract it into srclib directory. After extracting, make sure you rename it just "apr"; example:
mv apr.1.5.1 apr
Now, it should read the .apr files from that folder. After that it will ask for apr-utils too; make sure you follow the same procedure.
PS: The apr files in /usr/local are files which are already built. so they won't work.
you need to install apr-util-1.5.4
Download it from archive.apache.org
./configure --prefix=/usr/local/src/httpd-2.4.17/srclib/apr-util/ --with-apr=/usr/local/src/httpd-2.4.17/srclib/apr/
Looking at the documentation it appears the you should be giving the top level directory as the argument for the with-apr and with-apr-util options.
Try this:
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
If you have bundled apr and apu installed (make sure you libapr1-dev and libaprutil1-dev installed), don't pass any argument for apr.
./configure --prefix=/usr/local/apache --enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
If you want to use the apr and apu included in srcdir, --with-included-apr will be enough to add as argument. Externally compiled apr/apu currently buggy. Update your source code and re-compile if you want to have up to date version.
I found I experienced this problem under Solaris 11 with httpd-2.2.22. My config.log showed that the program testing the apr-util version produced a compile error because apu_version.h includes apr_version.h, but the test program did not include a -I directive for the apr include directory. I worked around this problem by providing the apr include directive explicitly in CPPFLAGS. Adapted to your example it would look like this:
CPPFLAGS="-I/usr/local/apr/include" ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
Note that I have also modified your --with-apr and --with-apr-util clauses. I think these should both point to the top-level directory and not to the config program. YMMV.
Finally i found a solution to resolve this issue. 
Please configure apr-util using as below
Download apr and apr-util from apache.org and untar it and compile apr first.
Go to extracted apr path and compile apr.
Ex:
./configure --prefix=/usr/apache/apache.2.4.55/apr
make
make test
make install
Next complile apr util using apr
./configure --with-apr=/usr/apache/apache.2.4.55/apr/bin/apr-1-config
and use the same apr path at final installation aswell Ex:
./configure --prefix=/usr/apache/apache.2.4.55 --with-apr-util=/usr/apache/apache.2.4.55/apr-util/ --with-apr=/usr/apache/apache.2.4.55/apr/bin/apr-1-config  --enable-so --enable-mods-shared=all --enable-proxy --enable-rewrite --disable-deflate --with-ldap-include=/usr/apache/apache.2.4.55/ldap/include --with-ldap-lib=/usr/apache/apache.2.4.55/ldap/lib --with-ldap --enable-ldap --with-ldap-sasl --with-pcre=/usr/apache/apache.2.4.55/pcre/bin/pcre-config --with-ssl=/usr/apache/apache.2.4.55/ssl --enable-ssl --enable-so

g++ 4.4 "error while loading shared libraries"

I'm following the C++ Cookbook tutorial on static and dynamic library linking with g++. I can build the binary fine, but when I run it I get the error
./hellobeatles: error while loading shared libraries: libjohnpaul.so: cannot open shared object file: No such file or directory
I used the command
: g++ -o hellobeatles hellobeatles.cpp -L ../johnpaul/ -L ../georgeringo/ -ljohnpaul -lgeorgeringo
The program builds and runs fine if I explicitly list the path like
: g++ -o hellobeatles hellobeatles.cpp ../johnpaul/libjohnpaul.so ../georgeringo/libgeorgeringo.so
Am I linking to the libaries incorrectly in the first command? Or is there some configuration setting I need to muck with?
I'm running an Ubuntu 9.10 guest vm in VirtualBox if that matters, and here's the -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
The dynamic linker expects to find shared libraries in /usr/lib, /lib, /usr/local/lib, and possibly a few other places. It will certainly not look for them in ../johnpaul/.
If the libraries are intended to be installed into a global location, then just install them there.
Otherwise, you must tell the dynamic linker where to find them.
A better approach is to add them to RPATH encoded into the executable:
g++ -o hellobeatles hellobeatles.cpp \
-L ../johnpaul/ -L ../georgeringo/ -ljohnpaul -lgeorgeringo \
-Wl,-rpath=/path/to/johnpaul:/path/to/georgeringo
Alternative (and less preferred) approach is to:
export LD_LIBRARY_PATH=/path/to/johnpaul:/path/to/georgeringo

Mono (mod_mono) & Apache (httpd) on Fedora 10: failing to start correctly

It seems I am one of the few trying to get Mono's mod_mono to run on httpd on Fedora 10.
Mono is installed and the httpd is configured to use mod_mono.conf
But when I do this:
service httpd start
I get this error:
Starting httpd: [crit] (13)Permission denied:
Failed to attach to existing dashboard,
and removing dashboard file '/var/run/mod_mono_dashboard_XXGLOBAL_1' failed
(Permission denied).
When I do this:
xsp
I get this error:
At System.OutOfMemoryException:.ctor (string), offset 0x18
Addr: 0x7f8e73d6e150
Callee: System.SystemException:.ctor (string)
**
ERROR:tramp-amd64.c:99:mono_arch_patch_callsite: code should not be reached
Stacktrace:
at System.OutOfMemoryException..ctor (string) <0xffffffff>
at System.OutOfMemoryException..ctor (string) <0x00018>
at (wrapper runtime-invoke) System.Object.runtime_invoke_void__this___string (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/lib64/libmono.so.0 [0x34f1a76812]
/lib64/libpthread.so.0 [0x315180f0f0]
/lib64/libc.so.6(gsignal+0x35) [0x3150c32f05]
/lib64/libc.so.6(abort+0x183) [0x3150c34a73]
/lib64/libglib-2.0.so.0(g_assertion_message+0x113) [0x34f125d7f3]
/usr/lib64/libmono.so.0 [0x34f1a9e7a8]
/usr/lib64/libmono.so.0 [0x34f1a7d080]
[0x7f8e741d016e]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted
Linux version:
Fedora release 10 (Cambridge)
Apache (httpd) version:
Server version: Apache/2.2.11 (Unix)
Server built: Mar 6 2009 09:12:52
Server's Module Magic Number: 20051115:21
Server loaded: APR 1.3.3, APR-Util 1.3.4
Compiled using: APR 1.3.3, APR-Util 1.3.4
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Mono version is 2.4 and Mono -V gives me this:
Mono JIT compiler version 2.0.1 (tarball)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Please help?
Thanks.
The first error you're getting is a known issue that shouldn't affect you. See this post.
As for the second error, shouldn't you be using "xsp2" instead of just "xsp"?
If that doesn't work, I would suggest you rather just try and install the latest Mono build from source. There are instructions here for Ubuntu, but it should be similar enough for you to follow.
I have tried to install again mono, mod_mono, xsp form distribution, then
from source using 2.2, 2.4 and svn.
The problem is with the kernel 2.6.24-23-xen present on both servers. It
has a bug that has been fixed in the following versions . The problem is
the 64bit XEN kernel does not honour the MAP_32BIT flag.
And to add insult to injury, i cannot upgrade the kernels because it's a
VPS and i cannot install kernels.