准备:
PostgreSQL RDBMS version 8.2 或更高 (推荐8.4)
tasksel install postgresql-server
Mono 2.10.1
目前的Ubuntu默认安装最高支持到mono 2.6.7,所以要上2.10.1可以自已编译,参见:
http://mono-project.com/Compiling_Mono
编译 mod_mono,可在这里下载源码:
http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.10.tar.bz2
Apache 2
apt-get install apache2
添加主机别名:
sudo -i
echo "127.0.0.1 orchard-demo" >> /etc/hosts
数据库设置:
1. 确保PostgreSQL安装并运行:
ps ax|grep postgres
结果近似如下:
1275 ? Ss 0:00 postgres: logger process
1277 ? Ss 0:00 postgres: writer process
1278 ? Ss 0:00 postgres: wal writer process
1279 ? Ss 0:00 postgres: autovacuum launcher process
1280 ? Ss 0:00 postgres: stats collector process
2. 创建用户及数据库:
sudo -i
su - postgres
createuser -l -D -R -S -P orchard
根据提示输入密码,并创建名为orchard的数据库:
createdb -E UTF8 -O orchard orchard
3. 配置Apache 2 和 mod_mono:
1. 添加网站配置文件:
vim /etc/apache2/sites-available/orchard-demo.conf
<VirtualHost *:80>
ServerAdmin webmaster@orchard-demo
ServerName orchard-demo
# Change the path below to suit your configuration
DocumentRoot /srv/www/vhosts/orchard-demo
# The paths used here should be common for all Linux distributions
ErrorLog /var/log/apache2/orchard-demo_error.log
CustomLog /var/log/apache2/orchard-demo_access.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
# Make ABSOLUTELY sure that the path in double quotes ends with a slash!
Alias / "/srv/www/vhosts/orchard-demo/"
LoadModule mono_module /usr/lib/apache2/modules/mod_mono.so
AddMonoApplications OrchardDemo "/:/srv/www/vhosts/orchard-demo"
# Orchard is a .NET 4.0 application. If your Mono was installed in a different prefix, replace /usr/bin/ with that prefix below.
MonoServerPath OrchardDemo /usr/local/bin/mod-mono-server4
# Helps when you get stack traces
MonoDebug OrchardDemo True
# Orchard assumes a case-insensitive filesystem
MonoIOMAP OrchardDemo all
<Directory "/srv/www/vhosts/orchard-demo">
SetHandler mono
MonoSetServerAlias OrchardDemo
</Directory>
</VirtualHost>
应用配置文件:
cd /etc/apache2/sites-enabled/
ln -s ../sites-available/orchard-demo.conf
rm 000-default
2. 安装Orchard运行文件:
sudo -i
mkdir -p /srv/www/vhosts/orchard-demo
cd /tmp
wget http://dl.dropbox.com/u/22037511/orchard/orchard-1.0.20-mono_bin.zip
cd /srv/www/vhosts/orchard-demo
unzip /tmp/orchard-1.0.20-mono_bin.zip
service apache2 restart
成果展示:
编辑页面:
参考:http://www.orchardproject.net/docs/Running-Orchard-on-Mono.ashx