[Mono-list] Apache restarts required to avoid whitescreens

Robert Jordan robertj at gmx.net
Tue Feb 19 17:16:43 EST 2008


Hi,

dugaldcurtis wrote:
> However, I have to gracefully restart Apache between morning and lunch or
> else (on busier days) lunchtime web pages start to just whitescreen (and
> load after a minute or so).  Button presses which are supposed to action
> database inserts appear to work but the inserts don't happen. With the
> restart at 11.30 this never happens.  However, users get logged out and the
> root of the problem isn't getting sorted.

You should make your application restartable first. Then you can
examine/log/trace your app w/out being under pressure.

Users are logged out because the view and session states are lost
when mono is going down. To prevent this, add the following settings
to web.config under <system.web>:

1. Preset validation keys for the view state:

<machineKey 
validationKey="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
decryptionKey="0123456789abcdef0123456789abcdef0123456789abcdef"
validation="SHA1"
/>

The keys must be randomly chosen, of course.

2.1 Setup persistent session state (ASP.NET 1.1)

You need this only if your application is using the "Session" object.

<sessionState
   cookieless="false"
   mode="SQLServer"
   sqlConnectionString="database connection string"
   timeout="20"
/>

sqlConnectionString must be a valid DB connection string.

The database must provide a table containing these fields (MySQL
DDL dialect):

CREATE TABLE `ASPStateTempSessions` (
   `SessionId`           char(32) NOT NULL,
   `AppPath`             char(128) NOT NULL,
   `Created`             datetime NOT NULL,
   `Expires`             datetime NOT NULL,
   `Timeout`             int NOT NULL,
   `StaticObjectsData`   mediumblob,
   `SessionData`         mediumblob,
   PRIMARY KEY  (`SessionId`)
);

Additionally to the <sessionState> settings, you have to setup
the session state module. This is Mono specific, as MS does not
support other providers than MS SQL:

<appSettings>
<!-- tell SqlSessionStateModule which DB provider to use -->
<!-- Adjust the assembly name according to your
      MySQL Connector version! -->

<add key="StateDBProviderAssembly" value="MySql.Data, 
Version=1.0.7.30073, Culture=neutral, PublicKeyToken=8e323390df8d9ed4" />

<!-- the connection type of the provider -->
<add key="StateDBConnectionType" 
value="MySql.Data.MySqlClient.MySqlConnection" />

<!-- parameter placeholder/prefix (MySQL: "?") -->
<add key="StateDBParamPrefix" value="?" />
</appSettings>


2.2 Setup persistent session state (ASP.NET 2.0)

Unfortunately I don't know if the session state module
for Mono's ASP.NET 2.0 is complete/working. I'll have a look
at its state if nobody else will reply.


Robert



More information about the Mono-list mailing list