Posted by: Lac - Thursday, 26 February 2009 00:26:48
When i run two forums in one application i found the foliwing error.
The situation:
*) One App
*) Forum at /Forum/
*) Forum at /Projects/
*) Every three directory has in own web.config - one in / directory with connection string etc, and two in folders with app settings like BoardId and BaseUrl.
Parameter BaseUrl from config was cached incorrectly: it was mined on forum what first started and remembered for all instances. If i first start /Projects/ for example, all links in /Forum/ have /projects/ in path also, but this wrong.
i fix it by editing UrlBuilder.cs, change property get to
[code] static public string BaseUrl
{
get
{
return WebConfigurationManager.AppSettings["BaseUrl"];
}
}[/code]It works, but i think this wrong way becouse we lost cache and architecture when go away from YAF.Classes.Config.
After this change instances works fine.
Posted by: Mek - Thursday, 26 February 2009 03:36:47
Matt a.k.a MDDUBS is also having the same/similiar issue; not an easy one to answer from what we've all attempted to look at; so please post back any findings...
Posted by: mddubs - Thursday, 26 February 2009 05:44:24
Thanks for the post Lac, glad you got your issue resolved. I'm going to test out your fix and hopefully it'll work for me too!!
Posted by: Lac - Thursday, 26 February 2009 08:19:57
I think one true architectural way is to separate cache storage for instances in one application. But this is hardway.
Posted by: Mek - Thursday, 26 February 2009 09:13:22
Agreed, and its not a pleasent job.
Posted by: mddubs - Sunday, 1 March 2009 18:28:51
Woohoo!!! Thank you very much for this post Lac, my multiboards are working well now!
The BaseUrl now retrieves its value using the WebConfigurationManager from a dictionary cache using the HttpContext.Current.Request.FilePath as the key. I'm pretty sure all the existing functionality will remain the same, but going forward those who want to use multiboards from a single installation can do it like this:
[b]Using Multiple Boards With A Single Installation[/b]
1. Install YAF as usual where-ever you choose, let's just say ~/forum1/ for simplicity.
2. For each new board, copy the default.aspx page to a new directory such as ~/forum2/.
3. Change the BoardID of the YAF:Forum control.
4. Add a web.config file to that directory (~/forum2/) and specify the appropriate BaseUrl key like this:
[code]
[/code]
I've committed the changes, Revision 2277 and 2278, and I've pushed it out to my production environment. So far so good!
Posted by: mddubs - Sunday, 1 March 2009 19:26:33
Well... it fixed all the broken links in the admin page, but now the Post page is looking a little screwy.
Posted by: mddubs - Sunday, 14 June 2009 07:39:12
The final solution to using multiple boards is here:
http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-are-working.aspx
Posted by: skylineiz - Tuesday, 16 June 2009 18:16:40
[quote=mddubs]The final solution to using multiple boards is here:
http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-are-working.aspx [/quote]
im looking into multiboards too atm.
but i clicked on your link but it said i dont have access to view it :S
something i did wrong?
any chance i can see ?
Posted by: Jaben - Tuesday, 16 June 2009 18:29:33
[quote=skylineiz][quote=mddubs]The final solution to using multiple boards is here:
http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-are-working.aspx [/quote]
im looking into multiboards too atm.
but i clicked on your link but it said i dont have access to view it :S
something i did wrong?
any chance i can see ?[/quote]
Yeah, you don't have access to the forum developer section. mddubs -- could you repost in an accessible forum?
Posted by: mddubs - Wednesday, 17 June 2009 05:41:22
No problem.
http://forum.yetanotherforum.net/yaf_postsm35195_Multiple-Boards-Multiboards-Solution.aspx