「Xsp」の版間の差分

提供: MonoBook
ナビゲーションに移動 検索に移動
imported>Administrator
12行目: 12行目:
 
== 使い方 ==
 
== 使い方 ==
 
=== コマンドライン ===
 
=== コマンドライン ===
[[ASP.NET]]や[[APS.NET MVC]]で書いたWebアプリを格納したディレクトリに移動してxpsを立ち上げる。
+
[[ASP.NET]]や[[ASP.NET MVC]]で書いたWebアプリを格納したディレクトリに移動してxpsを立ち上げる。
ASP.NETのバージョンごとにxsp、xsp2、xsp4と別々のコマンドになっている。
+
Webアプリが使っている[[.NET Framework]]のバージョンごとにxsp、xsp2、xsp4と別々のコマンドになっている。
なお、.NET Framework 3.xは.NET Framework 2.xの拡張なので欠番である(xsp2)。
+
.NET Framework 3.xは.NET Framework 2.xのマイナーチェンジなので欠番である(xsp2を使う)。
 +
 
 +
なお、.NET Framework 2.x向けに作ったWebアプリをxsp4で動かしてもほぼ動く。
 +
 
 
<source lang="bash">
 
<source lang="bash">
$ cd /hoge/hage
+
$ cd /hoge/hage
$ /usr/local/bin/xsp4
+
$ /usr/local/bin/xsp4
</bash>
+
</source>
  
 
=== Apacheと連携 ===
 
=== Apacheと連携 ===

2012年5月10日 (木) 11:27時点における版

XSPとは、MonoプロジェクトおよびGNOMEプロジェクトによりオープンソースで開発が行われているWebサーバー用ソフトウェア(またはWebサーバーサービス)である。

概要

マイクロソフトがWindows向けに開発・提供しているWebアプリケーション・フレームワークであるASP.NETおよびASP.NET MVCを、LinuxやFreeBSD、Mac OS Xなどの様々なOS上で動かすことを主目的としている。

XSP自体は、MonoおよびC#を用いて開発されており、Monoが動作する環境であればOSを問わず動作する。なお、Windows上であればマイクロソフト製のランタイムライブラリ(.NET Framework)でも動作する。さらにUNIX拡張機能を用いることでWindows上では動作しなくなるが、UNIX系OS固有の機能を用いたWebシステムを構築することも可能となっている。

XSPは安定して動作するため単体のWebサーバーとして用いることも可能である。ただし、マイクロソフトのInternet Information ServicesほどWebサーバーとしての汎用性は追求していない。このため別途Webサーバーなどと連携させて動作させることができ、例えばApache HTTP Serverではmod_monoモジュールを用いて連携を行う。

MonoDevelopを用いてASP.NETおよびASP.NET MVCを用いたWebアプリケーションを開発する際に、バックグラウンドで一時的に起動するデバッグ用のWebサーバーとしても用いられている。

使い方

コマンドライン

ASP.NETASP.NET MVCで書いたWebアプリを格納したディレクトリに移動してxpsを立ち上げる。 Webアプリが使っている.NET Frameworkのバージョンごとにxsp、xsp2、xsp4と別々のコマンドになっている。 .NET Framework 3.xは.NET Framework 2.xのマイナーチェンジなので欠番である(xsp2を使う)。

なお、.NET Framework 2.x向けに作ったWebアプリをxsp4で動かしてもほぼ動く。

$ cd /hoge/hage
$ /usr/local/bin/xsp4

Apacheと連携

mod_mono#設定例の項目を参照。

コマンドライン

ASP.NETやASP.NET MVCのWebアプリを格納したディレクトリに移動して以下のコマンドを打つ。

$ xsp4

デフォルトではポート番号8080で起動するので、変更したい場合は以下のようにする。

$ xsp4 --port 80

usage

   --port N: n is the tcp port to listen on.
                   Default value: 8080
                   AppSettings key name: MonoServerPort
   --random-port: listen on a randomly assigned port. The port numer
                   will be reported to the caller via a text file.
   --address addr: addr is the ip address to listen on.
                   Default value: 0.0.0.0
                   AppSettings key name: MonoServerAddress
   --https:        enable SSL for the server
                   Default value: false.
                   AppSettings key name:
   --https-client-accept: enable SSL for the server with optional client certificates
                   Default value: false (non-ssl).
                   AppSettings key name:
   --https-client-require: enable SSL for the server with mandatory client certificates
                   Default value: false (non-ssl).
                   AppSettings key name:
   --cert FILENAME: path to X.509 certificate file (cer)
                   AppSettings key name:
   --pkfile FILENAME: path to private key file (pvk)
                   AppSettings key name:
   --p12file FILENAME: path to a PKCS#12 file containing the certificate and the private
                   AppSettings key name:
   --pkpwd PASSWORD: password to decrypt the private key
                   AppSettings key name:
   --protocol:     specify which protocols are available for SSL
                   Possible values: Default, Tls, Ssl2, Ssl3
                   Default value: Default (all)
                   AppSettings key name:
   --root rootdir: the server changes to this directory before
                   anything else.
                   Default value: current directory.
                   AppSettings key name: MonoServerRootDir
   --appconfigfile FILENAME: adds application definitions from the XML
                   configuration file. See sample configuration file that
                   comes with the server.
                   AppSettings key name: MonoApplicationsConfigFile
   --appconfigdir DIR: adds application definitions from all XML files
                   found in the specified directory DIR. Files must have
                   '.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. Optionally you may specify virtual host name
                   and a port.
                          [[hostname:]port:]VPath:realpath,...
                   Samples: /:.
                          the virtual / is mapped to the current directory.
                           /blog:../myblog
                          the virtual /blog is mapped to ../myblog
                           myhost.someprovider.net:/blog:../myblog
                          the virtual /blog at myhost.someprovider.net is mapped to ../myblog
                           /:.,/blog:../myblog
                          Two applications like the above ones are handled.
                   Default value: /:.
                   AppSettings key name: MonoApplications
   --nonstop: don't stop the server by pressing enter. Must be used
              when the server has no controlling terminal.
   --no-hidden: allow access to hidden files (see 'man xsp' for details)
   --version: displays version information and exits.
   --verbose: prints extra messages. Mainly useful for debugging.
   --pidfile file: write the process PID to the specified file.

関連項目