Mod mono serves different web application instance over SSH

99封情书 提交于 2019-12-11 10:58:50

问题


I have one asp.net application running on latest Mod mono When I access it through url

1. http://myServer.com/App 

or

2. http://localhost:81/App

I get different instances for each address. How do I know there are different? Through examining Application_Start which actually fires twice and asp.net Application variables which have different values.

I use the second address only when I want to connect to my server through SSH, and I use local port forwarding so that each request that is sent from my computer on port 81 is actualy forwarded to port 80 on my server.

Both addresses point to the same phisycal location and I don't understand why there are actually two different instances behind each one?

Thanks

EDIT

Specific example:

this is how I store time of the application start event in Global.asax.cs

    public static string AppStartTime;

    protected void Application_Start(object sender, EventArgs e)
    {
        AppStartTime = DateTime.Now.ToString();
    }

This are the parameters for plink.exe used for remote port forwarding to remote Apache server:

    -L :7787:localhost:80

If I use plink 3 times with 3 different ports, 3 different time values are displayed when I visit the same web application through different url.

    http://localhost:7787/ => value of AppStartTime = time1

    http://localhost:7788/ => value of AppStartTime = time2

    http://localhost:7789/ => value of AppStartTime = time3

回答1:


This question concerns a web server configuration issue, and is unrelated to Mono. It seems as though you have two virtual servers / websites configured in Apache, rather than a single virtual server with two different bindings.

Change your configuration so you have a single virtual server with both bindings set up and you will have a single instance in-memory.



来源:https://stackoverflow.com/questions/13241425/mod-mono-serves-different-web-application-instance-over-ssh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!