特殊:Badtitle/NS100:ModMono:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第4行: | 第4行: | ||
== Configuring Mod_Mono on Ubuntu == | == Configuring Mod_Mono on Ubuntu == | ||
Ubuntu packages mod_mono very differently than the official distribution. | Ubuntu packages mod_mono very differently than the official distribution. | ||
This guide assumes that you have read the official | This guide assumes that you have read the official [https://help.ubuntu.com/ubuntu/serverguide/C/httpd.html Ubuntu Apache 2 Documentation] and understand how ubuntu manages modules and virtual hosts. | ||
'''1) Install packages''' | '''1) Install packages''' | ||
To begin, you can easily install mod_mono using apt: ''(universe package sources must be active in /etc/apt/sources.list, see for example | To begin, you can easily install mod_mono using apt: ''(universe package sources must be active in /etc/apt/sources.list, see for example [http://www.ubuntux.org/node/71 here])'' | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install libapache2-mod-mono | sudo apt-get install libapache2-mod-mono | ||
</nowiki></pre> | </nowiki></pre> | ||
Optionally, if you would like to use | Optionally, if you would like to use [http://quickstarts.asp.net/QuickStartv20/aspnet/doc/whatsnew.aspx ASP.NET 2.0], you need to install an additional package: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install mono-apache-server2 | sudo apt-get install mono-apache-server2 | ||
第33行: | 第33行: | ||
=== Example Configuration === | === Example Configuration === | ||
Say we have an apache vhost ''example.com'' and we would like the URL <code><nowiki>http://example.com/moo</nowiki></code> to be an ASP.net application. | Say we have an apache vhost ''example.com'' and we would like the URL <code><nowiki>http://example.com/moo</nowiki></code> to be an ASP.net application. | ||
First we declare the apache site configuration in <code><nowiki>/etc/apache2/sites-available/example.com</nowiki></code> and enable it. As mentioned earlier, this is explained in the | First we declare the apache site configuration in <code><nowiki>/etc/apache2/sites-available/example.com</nowiki></code> and enable it. As mentioned earlier, this is explained in the [https://help.ubuntu.com/ubuntu/serverguide/C/httpd.html official Ubuntu documentation]. | ||
<pre><nowiki> | <pre><nowiki> | ||
<VirtualHost 1.2.3.4:80> | <VirtualHost 1.2.3.4:80> | ||
第62行: | 第62行: | ||
Reload apache, and you should be done! | Reload apache, and you should be done! | ||
=== Additional Information === | === Additional Information === | ||
* | * [http://mono-project.com/Mod_mono Official Documentation] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2008年10月19日 (日) 16:14的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/ModMono }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/af | • {{#if: UbuntuHelp:ModMono|Afrikaans| [[::ModMono/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ar | • {{#if: UbuntuHelp:ModMono|العربية| [[::ModMono/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/az | • {{#if: UbuntuHelp:ModMono|azərbaycanca| [[::ModMono/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/bcc | • {{#if: UbuntuHelp:ModMono|جهلسری بلوچی| [[::ModMono/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/bg | • {{#if: UbuntuHelp:ModMono|български| [[::ModMono/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/br | • {{#if: UbuntuHelp:ModMono|brezhoneg| [[::ModMono/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ca | • {{#if: UbuntuHelp:ModMono|català| [[::ModMono/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/cs | • {{#if: UbuntuHelp:ModMono|čeština| [[::ModMono/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/de | • {{#if: UbuntuHelp:ModMono|Deutsch| [[::ModMono/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/el | • {{#if: UbuntuHelp:ModMono|Ελληνικά| [[::ModMono/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/es | • {{#if: UbuntuHelp:ModMono|español| [[::ModMono/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/fa | • {{#if: UbuntuHelp:ModMono|فارسی| [[::ModMono/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/fi | • {{#if: UbuntuHelp:ModMono|suomi| [[::ModMono/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/fr | • {{#if: UbuntuHelp:ModMono|français| [[::ModMono/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/gu | • {{#if: UbuntuHelp:ModMono|ગુજરાતી| [[::ModMono/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/he | • {{#if: UbuntuHelp:ModMono|עברית| [[::ModMono/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/hu | • {{#if: UbuntuHelp:ModMono|magyar| [[::ModMono/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/id | • {{#if: UbuntuHelp:ModMono|Bahasa Indonesia| [[::ModMono/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/it | • {{#if: UbuntuHelp:ModMono|italiano| [[::ModMono/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ja | • {{#if: UbuntuHelp:ModMono|日本語| [[::ModMono/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ko | • {{#if: UbuntuHelp:ModMono|한국어| [[::ModMono/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ksh | • {{#if: UbuntuHelp:ModMono|Ripoarisch| [[::ModMono/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/mr | • {{#if: UbuntuHelp:ModMono|मराठी| [[::ModMono/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ms | • {{#if: UbuntuHelp:ModMono|Bahasa Melayu| [[::ModMono/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/nl | • {{#if: UbuntuHelp:ModMono|Nederlands| [[::ModMono/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/no | • {{#if: UbuntuHelp:ModMono|norsk| [[::ModMono/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/oc | • {{#if: UbuntuHelp:ModMono|occitan| [[::ModMono/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/pl | • {{#if: UbuntuHelp:ModMono|polski| [[::ModMono/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/pt | • {{#if: UbuntuHelp:ModMono|português| [[::ModMono/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ro | • {{#if: UbuntuHelp:ModMono|română| [[::ModMono/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/ru | • {{#if: UbuntuHelp:ModMono|русский| [[::ModMono/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/si | • {{#if: UbuntuHelp:ModMono|සිංහල| [[::ModMono/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/sq | • {{#if: UbuntuHelp:ModMono|shqip| [[::ModMono/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/sr | • {{#if: UbuntuHelp:ModMono|српски / srpski| [[::ModMono/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/sv | • {{#if: UbuntuHelp:ModMono|svenska| [[::ModMono/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/th | • {{#if: UbuntuHelp:ModMono|ไทย| [[::ModMono/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/tr | • {{#if: UbuntuHelp:ModMono|Türkçe| [[::ModMono/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/vi | • {{#if: UbuntuHelp:ModMono|Tiếng Việt| [[::ModMono/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/yue | • {{#if: UbuntuHelp:ModMono|粵語| [[::ModMono/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/zh | • {{#if: UbuntuHelp:ModMono|中文| [[::ModMono/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/zh-hans | • {{#if: UbuntuHelp:ModMono|中文(简体)| [[::ModMono/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ModMono | UbuntuHelp:ModMono | {{#if: | :}}ModMono}}/zh-hant | • {{#if: UbuntuHelp:ModMono|中文(繁體)| [[::ModMono/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:ModMono|:ModMono|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :ModMono/zh | | {{#ifexist: ModMono/zh | | {{#ifeq: {{#titleparts:ModMono|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:ModMono|1|-1|}} | zh | | }}
Mod_Mono is an Apache 1.3/2.0/2.2 module that provides ASP.NET support for the web's favorite server, Apache (http://httpd.apache.org).
Configuring Mod_Mono on Ubuntu
Ubuntu packages mod_mono very differently than the official distribution. This guide assumes that you have read the official Ubuntu Apache 2 Documentation and understand how ubuntu manages modules and virtual hosts. 1) Install packages To begin, you can easily install mod_mono using apt: (universe package sources must be active in /etc/apt/sources.list, see for example here)
sudo apt-get install libapache2-mod-mono
Optionally, if you would like to use ASP.NET 2.0, you need to install an additional package:
sudo apt-get install mono-apache-server2
2) Activate the module:
sudo a2enmod mod_mono
3) Select the ASP.NET version
The /etc/apache2/mods-available/mod_mono.conf
file controls which version of ASP.NET is to be used. If you would like to use 2.0, and you installed the package as explained above, open this file in a text editor and follow the directions.
4) Configure your web applications
Applications are defined in .webapp files, located in either /etc/mono-server/
or /etc/mono-server2/
depending on which version of ASP.NET you are using.
The format of these files are explained in the xsp man page.
man xsp
5) Restart apache Restart apache so the new configuration is loaded.
sudo /etc/init.d/apache2 restart
Example Configuration
Say we have an apache vhost example.com and we would like the URL http://example.com/moo
to be an ASP.net application.
First we declare the apache site configuration in /etc/apache2/sites-available/example.com
and enable it. As mentioned earlier, this is explained in the official Ubuntu documentation.
<VirtualHost 1.2.3.4:80> ServerName example.com DocumentRoot /var/www/example.com/ <Directory /var/www/example.com/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all SetHandler mono DirectoryIndex index.aspx index.html </Directory> </VirtualHost>
With this configuration, our asp.net application (the aspx files, etc.) would be placed in /var/www/example.com/moo/
.
Next, you would create a corresponding webapp file. Let's pretend that we are using ASP.NET 1.x, so we are goint to create /etc/mono-server/example.com-moo.webapp
:
<apps> <web-application> <name>MOO!!</name> <vpath>/moo</vpath> <path>/var/www/example.com/moo</path> <vhost>example.com</vhost> </web-application> </apps>
Reload apache, and you should be done!