---
title: "ubuntu+apache2+mono 配置 1"
author: "starnc"
date: "2012-07-03T10:04:58Z"
tags: []
categories: ["编程语言"]
slug: "ubuntu-apache2-mono-1"
draft: false
lastmod: "2012-07-03T10:04:36Z"
id: 1575249
url: "https://starnc.iteye.com/blog/1575249"
---

1.使用光盘或镜像安装 **ubuntu** 10.4 系统

 

2.更新 **ubuntu** 系统 命令： sudo apt-get update sudo apt-get upgrade

 

3.安装 **apache** 服务器 命令： sudo apt-get install apahce2

 

4.暂停 **apache** 服务 命令： sudo /etc/init.d/**apache** 2 stop

 

5.安装 **mono** 相关组件 命令： sudo apt-get install **mono** -**apache** -server2 libapache2-mod-**mono** libmono-i18n2.0-cil

 

6.打开并编辑/etc/**apache** 2/mods-available/mod\_**mono** .conf 配置文件 命令：

sudo vi /etc/**apache** 2/mods-available/mod\_**mono** .conf

 

7.使用 gedit 编辑器编辑配置文件 mod\_**mono** .conf 文件内容如下：

AddType application/x-asp-net .aspx .ashx .asmx .ascx .config .ascx .axd

DirectoryIndex Default.aspx

MonoAutoApplication enabled MonoServerPath “/usr/bin/mod-**mono** -server2”

Include /etc/**mono** -server2/**mono** -server2-hosts.conf

 

8.启动 **apache** 服务器 命令： sudo /etc/init.d/**apache** 2 start 至此 **apache** +**mono** 的环境已经配置完成 可以在 **apache** 默认目录/var/www/下放入 aspx 页面来测试配置是否成功。

 

如果报错，请看下篇http://starnc.iteye.com/blog/1574695，还有httpd.conf 需要配置

 

解决方案：1. 打开配置文件  sudo gedit  /etc/apache2/httpd.conf

                    2. ServerName      YourIpAddress:80

                    3. 重启apache sudo /etc/init.d/apache2 restart