这是安装Mono 3.0.1的完整指南。
对于不知道如何在Ubuntu 12.04上获取新的Mono 3.0.1版本的初学者(因为我也是一个初学者,在让它工作之前已经花了3天时间)
获取root访问权限以安装和配置Mono 3.0.1
sudo -s
***type your root password***
安装vim编辑器
apt-get install vim
安装apache2
apt-get install apache2
安装编译Mono所需的工具
apt-get install autoconf automake libtool g++ gettext libglib2.0-dev libpng12-dev libfontconfig1-dev
apt-get install mono-gmcs
apt-get install git
安装apache2-threaded-dev(编译mod_mono所需)*
apt-get install apache2-threaded-dev
稍后我们将回到apache2的配置
创建我们需要获取源代码所需的结构
cd /opt
mkdir mono-3.0
在获取源代码之前,先进入那个新文件夹
cd /opt/mono-3.0
从 GitHub 获取源代码
git clone git://github.com/mono/mono.git
git clone git://github.com/mono/xsp.git
git clone git://github.com/mono/libgdiplus.git
git clone git://github.com/mono/mod_mono.git
编译libgdiplus
cd /opt/mono-3.0/libgdiplus
./autogen.sh --prefix=/usr (the prefix is very important for Ubuntu 12.04)
make
make install
编译 Mono
cd /opt/mono-3.0/mono/
make clean
./autogen.sh --prefix=/usr (the prefix is very important for Ubuntu 12.04)
make
make install
编译xsp
cd /opt/mono-3.0/xsp
./autogen.sh --prefix=/usr (the prefix is very important for Ubuntu 12.04)
make
make install
编译 mod_mono
cd /opt/mono-3.0/mod_mono
./autogen.sh --prefix=/usr (the prefix is very important for Ubuntu 12.04)
make
make install
安装mod_mono后,文件mod_mono.conf被添加到您的apache2文件夹(/etc/apache2)中。
配置apache2
配置apache的默认站点 ###(可选*)**
vim /etc/apache2/sites-available/default
Modify the line "DocumentRoot /var/www" by "DocumentRoot /var/www/YourFolder" (YourFolder is the folder where you publishing your website!)
配置 YourFolder 的权限(可选*)**
cd /var/www/YourFolder
sudo chown -R root:www-data .
sudo chmod -R 774 .
sudo usermod -a -G www-data <yourusername>
在apache2.conf文件中添加mod_mono模块的引用
vim /etc/apache2/apache2.conf
Add "Include /etc/apache2/mod_mono.conf" at the end of the file (without quotes!)
将指针添加到mod_mono.conf中的ASP .NET 4.0
vim /etc/apache2/mod_mono.conf
Add "MonoServerPath /usr/bin/mod-mono-server4" (without quotes!) under the "If Modules condition"
重启apache2服务器
/etc/init.d/apache2 restart