|
Editing web.config |
| Now let us go over the configuration file,
web.config. This file contains every piece of information Lasto
needs to run outside of the database and theme files.
<system.web> <compilation defaultLanguage="vb" debug="false" />This line should be set to debug="false". Setting debugging to true will reduce performance and increase memory usage as debugging symbols must be created and loaded. The garbage collector is also not as performance sensitive when it debugging mode. <customErrors mode="Off" /> Set this to "Off" to display normal ASP.NET errors to clients with details on the error presented. Set to "On" to hide these detailed error messages from the clients for increased security. You can also set it to "RemoteOnly" so that clients do not see detailed messages but you can terminal into the webserver and see the errors locally. <authentication mode="Windows" /> ASP.Net's built-in authentication modes are not used. Leave this set to "Windows". <authorization> <allow users="*" /> </authorization> ASP.Net's built-in authorization features are not typically used, so leave this set to users="*". You may choose to further restrict who has access to your forums using these settings, but such a configuration is not supported or tested. <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" /> The Lasto forums do not currently provide trace debugging facilities so leave this set to enabled="false". <sessionState mode="InProc" cookieless="false" timeout="20" /> Lasto uses session state to handle caching of user permissions and settings. You cannot use the "Off" mode or Lasto will NOT function! The modes you can use are "InProc", "StateServer", and "SQLServer".
This sets the encoding type used by the forums. Typically leave it set to utf-8. </system.web>
That ends the system settings and now we will look at application settings. If you are using a web farm with two or more web servers, you should keep all of these values set the same (and keep the theme files synchronized), lest your users experience errors. <appSettings> <add key="sqlConnectionString" value="Data Source=127.0.0.1;Initial Catalog=Lasto;Integrated Security=SSPI" />sqlConnectionString sets the connect string (or DSN if you prefer) that Lasto will use to connect to the database. It should specify: <add
key="DefaultTheme"
value="simplegrey\"
/>
<add
key="ThemeAbsPath"
value="f:\lasto\themes\"
/>
<add
key="URLPath"
value="http://www.stuff.com/forums/"
/>
<add
key="ErrorLogFilename"
value="f:\lastologs\error.log"
/>
<add
key="MailServer"
value="192.168.0.150"
/>
<add
key="Themes"
value="simplegrey`Simple
Grey;easyblue`Easy Blue;notsogrey`Not So Grey;ancientblue`Ancient
Blue;pocketpc`PocketPC or Text Only;"
/> The first field is the folder name (without any slashes or path) where the theme resides under Themes\. The second field is the display name. <add
key="MaxImgSize"
value="60000"
/>
<add
key="MaxImgCount"
value="5"
/> These settings are just the global restrictions; you may grant or deny the ability to upload images on a per-user and per-group basis to further control the use. <add
key="ExpireImgDays"
value="30"
/> Note that this is not a promise that an image WILL be deleted when it reaches this age, merely that an image can be assured of reaching this age without being deleted. This is because image deletes are run when someone uploads a new image to the database. So in theory, if an image were uploaded and passed this setting and no one else ever uploaded a new image, the delete job would never run. <add
key="RequireImgRef"
value="1"
/> You can use this to prevent image leeching from other sites which would waste your bandwidth. However if you wish to provide image hosting as a premium service you may choose to turn this off and let users post their uploaded images anywhere. <add
key="enckey"
value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
/>
<add
key="enciv"
value="BBBBBBBBBBB="
/>
</appSettings>
If the web.config file is incorrect or contains errors, you should get an ASP.NET error message telling you what is wrong with it. However if you are on shared hosting and the service provide has turned off client reporting of errors for the whole machine, you will need to contact them or get a local logon to examine the error in more detail. |