CentOS7 Apache+Mono Web站點部署

liuhelong發表於2017-08-06

安裝Mono

配置Yum源 參考

yum install yum-utils
rpm –import “http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
yum-config-manager –add-repo http://download.mono-project.com/repo/centos7/

安裝mono

yum install -y mono-devel

安裝httpd、mod_mono

yum install -y httpd apache2-mod_mono

配置mod_mono.conf

vi /etc/httpd/conf.d/mod_mono.conf

新增

MonoServerPath /usr/bin/mod-mono-server4

配置Web站點

新增Web目錄

mkdir /home/aspnet

新增站點配置檔案

vi /etc/httpd/conf.d/aspnet.conf

配置內容

Alias /aspnet "/home/aspnet"
MonoApplications "/aspnet:/home/aspnet"
<Location /aspnet>
    SetHandler mono
</Location>

<Directory /home/aspnet>
  AllowOverride Options
  Require all granted
</Directory>

啟動Web站點

啟動httpd

systemctl start httpd

新增到自動啟動

systemctl enable httpd

結果驗收,在瀏覽器中開啟

[域名/IP]/aspnet

相關文章