我是使用的是abp.core.
1.准备好应用程序,在Program.cs中配置一个端口
例如:
站点1 的配置为
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://*:8082")
.Build();
}
站点2 的配置为
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://*:8081")
.Build();
}
2.发布这两个站点,发布完之后放到centos对应的目录下
例如:我目录下放置的两个应用程序
3.配置jexus配置文件
打开hk
配置网站1
$ vi theatre
port=/ /wwwroot/theatre
hosts=www.域名1.com:
AppHost=={cmd=dotnet /wwwroot/theatre/Badger.test2.Web.Host.dll; root=/wwwroot/theatre; port=8082}
配置网站2
$ vi hk
port=/ /wwwroot/hk
hosts=www.域名2.com:
AppHost=={cmd=dotnet /wwwroot/hk/Badger.test1.Web.Host.dll; root=/wwwroot/hk; port=8081}
最后一步,重启jexus服务
$/usr/jexus/jws restart
大功告成,这样只要有域名,默认端口都可以设置成80端口了!!!