CentOS7: How to install Mono in the apache2

CentOS7 上面要支援 ASP / ASP.NET 有兩種方式
一種是本篇文章要介紹的 Mono
另外一種是 Microsoft 自己開發的 DotNET Core
兩種都有跨平台支援
網路上的教學安裝了太多的套件
我只想跑 ASP 而已
僅列出我需要的環境教學

我的環境是:
CentOS 7.5.1804 x86_64
Apache 2.4

安裝步驟

1. 匯入 Repo
$ rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
$ su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'

2. 安裝 mono 套件
$ yum install mod_mono

3. 修改 mod_mono.conf
$ vi /etc/httpd/conf.d/mod_mono.conf
將這段加到最下面
MonoServerPath /usr/bin/mod-mono-server4

如果要跑 asp 請加入這行
AddType application/x-asp-net .asp

如果要讓 index.asp 變為預設首頁請加入這行
DirectoryIndex index.asp

4. 重開 apache
$ systemctl restart httpd



Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

Howto use Postman test Cors