xsp(1)

πŸ“¦ version 4.2, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– xsp(1) β€” User Commands πŸ’–

okay bestie, gather round, because we're about to talk about xsp and honestly? she's iconic. this is the manual page for the XSP family of ASP.NET hosts and there's a lot going on, so let's get into it. πŸŽ€


✨ NAME ✨

XSP β€” Mono ASP.NET Web Server (xsp and xsp2) πŸ¦‹


✨ SYNOPSIS ✨

xsp [options]

or

mod-mono-server4 [options]

or

fastcgi-mono-server4 [options]

✨ DESCRIPTION ✨

so <cyan>XSP</cyan>, <cyan>mod-mono-server4</cyan> and <cyan>fastcgi-mono-server4</cyan> are all hosts for ASP.NET-based applications. literally what they do. πŸ’…

if you run it as xsp, the process spins up a minimalistic web server that hosts the ASP.NET runtime, and it's perfect for testing and debugging web apps that use the System.Web facilities in Mono. she's most convenient for testing and running small sites β€” but no cap, she does not offer everything a production web server offers. so like, vibe check before you ship her to prod, okay? 🫢

mod-mono-server4 and fastcgi-mono-server4 are both ASP.NET runtime hosts that can talk to another web server (at the time of this writing, Apache 1.3-2.2 were supported through mod_mono, and several other web servers through FastCGI). this mechanism is better used for high-traffic servers or production systems, because it can integrate with the main HTTP server and leverage all of the optimizations and extensions of an existing server, while still providing the ASP.NET runtime. ✨

you can choose the communication channel used between mod_mono and mod-mono-server4. if you provide a --filename option, a unix socket is used; otherwise you can give --port to use a TCP socket. choose your fighter bestie πŸ’–


✨ OPTIONS ✨

  • --address addr β€” sets the IP address to listen on. by default it's <yellow>0.0.0.0</yellow> for xsp and <yellow>127.0.0.1</yellow> for mod-mono-server4. AppSettings key name: MonoServerAddress
  • --port PORT β€” changes the default port where the XSP server will listen to requests. by default XSP listens on port <yellow>8080</yellow> and mod-mono-server4 has no default. AppSettings key name: MonoServerPort
  • --backlog N β€” the backlog of connections to set on the listener socket. by default the value is set to <yellow>500</yellow>.
  • --minThreads N β€” the minimum number of threads the threadpool allocates. increase this value to better handle the sudden arrival of connections (the group chat getting busy, essentially πŸ“±). the default value is determined by the mono runtime.
  • --filename file (mod-mono-server4 and fastcgi-mono-server4) β€” the unix socket file name to listen on. default value: /tmp/mod_mono_server (fastcgi-mono-server4: /tmp/fastcgi-mono-server4). AppSettings key name: UnixSocketFileName (fastcgi-mono-server4: MonoUnixSocket)
  • --root PATH β€” the root directory for XSP. the default is the directory where XSP is executed. the current directory will be changed to this one before creating any application. AppSettings key name: MonoServerRootDir
  • --appconfigfile FILENAME β€” adds application definitions from the XML configuration file. see the sample configuration file that comes with the server (sample.webapp) and the WEBAPP FILE FORMAT section below. AppSettings key name: MonoApplicationsConfigFile
  • --appconfigdir DIR β€” adds application definitions from all XML files found in the specified directory DIR. files must have a '.webapp' extension. AppSettings key name: MonoApplicationsConfigDir
  • --applications APPS β€” a comma separated list of virtual directory and real directory for all the applications we want to manage with this server. the virtual and real dirs are separated by a colon. the default value is '/:.'.

some examples, bestie:

  • '/:.' β€” the virtual / is mapped to the current directory.
  • '/blog:../myblog' β€” the virtual /blog is mapped to ../myblog
  • '/:.,/blog:../myblog' β€” two applications like the above ones are handled.
  • myhost.someprovider.net:/blog:../myblog β€” the virtual /blog at myhost.someprovider.net is mapped to ../myblog.
  • --master β€” this instance will be used to by mod_mono to create ASP.NET applications on demand. if this option is provided, there is no need to provide a list of applications to start. this applies only to mod-mono-server4.exe.
  • --nonstop β€” by default xsp/mod-mono-server4 will stop processing requests when the return key is pressed. use this to avoid this behavior. (no more accidental shutdowns mid-demo πŸ™ˆ)
  • --no-hidden β€” do not protect hidden files/directories from being accessed by clients. hidden files/directories are those with the Hidden attribute on Windows and whose name starts with a dot on Unix. any file/directory below a hidden directory is inaccessible. this option turns the default behavior of protecting such locations off. if your application does not contain any hidden files/directories, you might want to use this option as the checking process has a per-request cost. AppSettings key name: MonoServerCheckHiddenFiles (a boolean accepting 'true' or 'false')
  • --https β€” enables HTTPS support on the server. you must supply an X.509 certificate and a private key with either the --cert/--pkfile options or with the --p12file (which combines both the certificate and the private key into a single file).

to use it you must first create an X.509 certificate for your server, for example:

$ makecert -r -eku 1.3.6.1.5.5.7.3.1 -n "CN=server" -p12 server.p12 s3kr3t
Mono MakeCert - version 1.1.9.0
X.509 Certificate Builder
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2005 Novell. BSD licensed.

Success

then you must pass the following flags to xsp:

$ xsp --https --p12file server.p12 --pkpwd s3kr3t
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --https-client-accept β€” like --https this enables HTTPS support on the server. however this option also sends an "invitation" to clients to provide client-certificates to authenticate themselves. clients are free to provide, or not, a client certificate. the web application can detect if a client certificate is used and react accordingly. most web browsers will not send a client certificate unless they have been explicitly requested to do so.
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --https-client-require β€” like --https this enables HTTPS support on the server. however this option also requires clients to use client-certificates to authenticate themselves. clients who do not provide client certificates will receive an error. note that a client may send an empty certificate structure so the web application should check the certificate content. πŸ‘‘
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --p12file FILENAME β€” used to specify the PKCS#12 file to use. this file includes both the X.509 certificate and the private key required to encrypt the HTTP traffic.
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --cert FILENAME β€” used to specify the server X.509 certificate file. this is normally used with the --pkfile.
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --pkfile FILENAME β€” used to specify the path to the private keyfile. the PVK format isn't very secure and you should use the PKCS#12 format (--p12file option) to store new private keys. fr fr, protect your keys. πŸ”
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --pkpwd PASSWORD β€” if your private key is password protected, PASSWORD is the password used to decode the private key. this option works for both PVK and PKCS#12 formats.
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --protocol PROTOCOL β€” specifies which protocols are available for encrypting the communications. the possible values are Default, Tls and Ssl3. Ssl2 isn't supported. the default value is "Default" which auto-detects the client protocol and adjusts the server protocol accordingly.
this option is only valid for XSP. for mod_mono you should configure Apache for SSL/TLS.
  • --terminate (mod-mono-server4 only) β€” gracefully terminates a running mod-mono-server4 instance. all other options but --filename or --address and --port are ignored if this option is provided.
  • --version β€” displays version information and exits. bye bestie πŸ‘‹
  • --help β€” shows the list of options and exits.
  • --verbose β€” prints extra messages. useful for debugging. (the "tell me everything" mode πŸ—£οΈ)
  • --pidfile FILE β€” writes the xsp PID to the specified file.

✨ MONO RUNTIME OPTIONS ✨

xsp and xsp2 are scripts that call mono. if you want to pass options to mono (for example, options to get line numbers in stack traces), you can use the MONO_OPTIONS environment variable when invoking xsp or xsp2.

for example:

$ MONO_OPTIONS=--debug xsp2

✨ DEFAULT INDEX FILES ✨

you can choose which files are considered as index using xsp.exe.config configuration file like this:

<appSettings>
<add key="MonoServerDefaultIndexFiles"
     value="index.aspx" />
</appSettings>

by default, it has index.aspx, Default.aspx, default.aspx, index.html and index.htm. the order matters. 🌈


✨ WEBAPP FILE FORMAT ✨

the format of the .webapp files used for --appconfigfile and --appconfigdir is:

<apps>
<web-application>
        <name>{appname}</name>
        <vhost>{virtual host for application}</vhost>
        <vport>{port for the application}</vport>
        <vpath>{virtual directory in apache}</vpath>
        <path>{physical path to aspx files}</path>
        <!-- <enabled> is true by default -->
        <enabled>{true|false}</enabled>
</web-application>
</apps>

you can include any number of <web-application> nodes, one per ASP.NET application to run.

there's a sample.webapp file in the XSP samples directory. go look, it's cute. πŸŽ€


✨ AUTHORS ✨

the Mono XSP server was written by Gonzalo Paniagua Javier (gonzalo@ximian.com). Fastcgi-mono-server4 was written by Brian Nickel <http://kerrick.wordpress.com>. legends, honestly. πŸ‘‘


✨ ENVIRONMENT VARIABLES ✨

  • MONO_ASPNET_NODELETE β€” if set to any value, temporary source files generated by ASP.NET support classes will not be removed. they will be kept in the user's temporary directory.

✨ FILES ✨

  • Web.config, web.config β€” ASP.NET applications are configured through these files, the configuration is done on a per-directory basis. for more information on this subject see the http://www.mono-project.com/Config_system.web page.

🌈 SEE ALSO ✨

okay bestie, when you're done with this page and you're like "wait who else do I need to know", here's the squad πŸ’…

  • mono(1) β€” the runtime that makes the whole thing go, obviously
  • dbsessmgr(1) β€” the session storage manager bestie
  • asp-state(1) β€” session state, keeping your vibes consistent
  • mod_mono(8) β€” the Apache module era, we love a crossover
  • makecert(1) β€” for when you need certificates, very secure of you πŸ”

and if you wanna get into creating certificates specifically, there's a whole writeup waiting for you at:

http://pages.infinit.net/ctech/20050701-1048.html

also the namespaces you'll be living in:

  • System.Web
  • System.Web.Hosting

and http://www.asp.net is Microsoft's official site for ASP.NET, no cap, that's literally the source πŸ‘‘


πŸ’– MORE INFORMATION πŸŽ€

The Mono project (http://www.go-mono.com) is a collaborative effort led by Novell (http://www.novell.com) to implement an open source version of the .NET Framework. it's giving community, it's giving open source excellence, it's giving "we did it ourselves and it slayed" 🫢


πŸ¦‹ MAILING LISTS 🌸

Mailing lists are listed at http://www.mono-project.com/Mailing_Lists β€” go find your people, bestie, there's a list for every hyperfixation πŸ’Œ


and that's the whole page, you made it to the end like the main character you are πŸ’œ this was xsp version 4.2, dated 21 Nov 2004, and yeah the date is older than most of us but the vibes are timeless ✨ periodt πŸ’…

πŸ“¦ where this page comes from