|
我們知道Mono 2.8對(duì)ASP.NET MVC 2的完全支持,下面我們就來(lái)測(cè)試下在Mono 2.8上部署ASP.NET MVC 2應(yīng)用程序。我的環(huán)境是Opensuse 11.3,通過(guò)以下命令部署好Mono 2.8的開(kāi)發(fā)環(huán)境,之所以說(shuō)是開(kāi)發(fā)環(huán)境是同時(shí)會(huì)更新MonoDevelop,支持Mono2.8的程序開(kāi)發(fā):
zypper addrepo http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.3 mono-stable
zypper refresh --repo mono-stable
zypper dist-upgrade --repo mono-stable
然后啟動(dòng)MonoDevelop生成一個(gè)ASP.NET MVC 2應(yīng)用程序TestMvc2。
我們使用Apache2 + mod_mono進(jìn)行部署,設(shè)置一個(gè)虛擬主機(jī):
<VirtualHost *:80>
ServerAdmin webmaster@dotNETting.com
ServerName www.dotNETting.com
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
DocumentRoot /srv/www/vhosts/dotNETting/public_html
# if not specified, the global error log is used
ErrorLog /srv/www/vhosts/dotNETting/logs/error.log
CustomLog /srv/www/vhosts/dotNETting/logs/access_log combined
# don't loose time with IP address lookups
HostnameLookups Off
# needed for named virtual hosts
UseCanonicalName Off
# configures the footer on server-generated documents
ServerSignature On
# Optionally, include *.conf files from /etc/apache2/conf.d/
# For example, to allow execution of php scripts:
Include /etc/apache2/conf.d/mod_mono.conf
MonoServerPath www.dotNETting.com "/usr/bin/mod-mono-server4"
MonoDebug www.dotNETting.com true
MonoSetEnv www.dotNETting.com MONO_IOMAP=all
MonoApplications www.dotNETting.com "/:/srv/www/vhosts/dotNETting/public_html"
<Location "/">
Allow from all
Order allow,deny
MonoSetServerAlias www.dotNETting.com
SetHandler mono
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "/.(?:gif|jpg?g|png)$" no-gzip dont-vary
</Location>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/Javascript
</IfModule>
</VirtualHost>
NET技術(shù):在Mono 2.8上部署ASP.NET MVC 2,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。