centos基于mono+apache搭建asp环境

1.添加mod_mono的源

rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo

2.安装apache,mono

yum install httpd mod_mono mono-web -y

3.安装xsp

yum install xsp -y
#如果报以下错,请用下面的命令安装
#500 Internal Server Error
#System.InvalidOperationException: mod_mono and xsp have different versions.
#yum install --enablerepo=rawhide xsp

4.关闭selinux

#如果报下面错,关闭selinux,不报错,可以跳过
#503 Service Temporarily Unavailable
#[error] Failed to connect to mod-mono-server after several attempts to spawn the process.
setenforce 0

 5.编写代码

cd /var/www/html/
vim index.aspx
<html>
<body bgcolor="yellow">
<center>
<h2>Hello RUNOOB.COM!</h2>
<p><%="My first ASP script!"%></p>
</center>
</body>
</html>

6.重启apache

systemctl restart httpd

7.测试

原文地址:https://www.cnblogs.com/navysummer/p/12930593.html