配置先
開発ユーザー: sta、配置先: /opt/mono/www/ntropy とした場合$ sudo mkdir -p /opt/mono/www/ntropy $ sudo chown sta /opt/mono/www/ntropy
Web 配置設定
MonoDevelop メニューから プロジェクト > オプション > 配置 > Web配置ターゲット を選択し、追加 ボタンを押下。配置先情報を入力する。
「App_Data」ディレクトリを配置する場合、そこに何かファイルが含まれる必要がある。

「aspnetdb.sqlite」は、Membership で使用する SQLite DB ファイル(NTropy では使用していないが)。
ちなみに、プロパティ > 配置 > include in deploy にチェックを入れると、「aspnetdb.sqlite」は「bin」ディレクトリ配下に配置された。
Web 配置実行
プロジェクト > Webに配置... を選択し、配置 ボタン押下。

グループ、権限の変更:
$ sudo chown -R :www-data /opt/mono/www/ntropy $ sudo chmod -R g+w /opt/mono/www/ntropy/App_Data
Apache 設定
/etc/apache2/sites-available/ntropy:- <VirtualHost *:80>
- Include ./sites-available/include/ntropy
- </VirtualHost>
- ServerName www.ntropy.home
- ServerAdmin web-admin@www.ntropy.home
- DocumentRoot /opt/mono/www/ntropy
- # MonoServerPath can be changed to specify which version of ASP.NET is hosted
- # mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0
- # For SUSE Linux Enterprise Mono Extension, uncomment the line below:
- # MonoServerPath www.ntropy.home "/opt/novell/mono/bin/mod-mono-server2"
- # For Mono on openSUSE, uncomment the line below instead:
- MonoServerPath www.ntropy.home "${MONO_HOME}/bin/mod-mono-server2"
- # To obtain line numbers in stack traces you need to do two things:
- # 1) Enable Debug code generation in your page by using the Debug="true"
- # page directive, or by setting <compilation debug="true" /> in the
- # application's Web.config
- # 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging
- MonoDebug www.ntropy.home true
- # The MONO_IOMAP environment variable can be configured to provide platform abstraction
- # for file access in Linux. Valid values for MONO_IOMAP are:
- # case
- # drive
- # all
- # Uncomment the line below to alter file access behavior for the configured application
- #MonoSetEnv www.ntropy.home MONO_IOMAP=all
- #
- # Additional environtment variables can be set for this server instance using
- # the MonoSetEnv directive. MonoSetEnv takes a string of 'name=value' pairs
- # separated by semicolons. For instance, to enable platform abstraction *and*
- # use Mono's old regular expression interpreter (which is slower, but has a
- # shorter setup time), uncomment the line below instead:
- # MonoSetEnv www.ntropy.home MONO_IOMAP=all;MONO_OLD_RX=1
- MonoApplications www.ntropy.home "/:/opt/mono/www/ntropy"
- <Location "/">
- MonoSetServerAlias www.ntropy.home
- SetHandler mono
- SetOutputFilter DEFLATE
- SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
- </Location>
- <IfModule mod_deflate.c>
- AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
- </IfModule>
- CustomLog /var/log/apache2/access.log combined
設定の有効化:
$ sudo a2ensite ntropy
「/etc/hosts」に追加:
- # added for monodemo, ntropy
- 192.168.1.x www.monodemo.home www.ntropy.home
Apache 再起動:
$ sudo /etc/init.d/apache2 restart
確認:

再配置
「Web 配置実行」後、mod_mono Control Panel より www.ntropy.home > Restart Server を選択。
ローカルで試す分には、大体、こんなところか。
0 件のコメント:
コメントを投稿