1

Closed

Three blogs configured but only one displays.

description

from biztron:
 
I believe I configured everything correctly, but each new blog gets the same settings. I noticed a few issues with the template for creating a new blog, and made sure I follwed the steps cleanly a few times before I decided to ask for help. I finally configured a single "standard" blog with DbBlogProvider and made sure it was working correctly. Then I ran "DatabaseSchemaChanges.sql" and modified Web.config with SqlBlogProvider, LinqMembershipProvider, LinqRoleProvider and multiblog="true". Added Binaries to /bin folder and of course added a couple domains to the host header of my Web Site. Then I ran the "AddNewBlog.sql" after I cleaned up the template...
Some of the <p> strings look like template variables to Management Studio. I cleaned up the SQL directly as well if I needed, such as when several nulls messed up the initial blog post.
 
This is all running on Windows Server 2003 Enterprise x64 on IIS 6 in ASP.NET 32-bit mode. I'm even trying to debug with Visual Studio 2008.
 
Can I be missing something simple? If not, can you suggest where to start looking? Is there a more specific set of instructions for the "simple" taks of configuring a new "multiblog" installation?
 
I've been looking at this problem and solution for over a year now and just recently decided to take apart the SQL Schema to figure out what was needed to get multiple blogs on one SQL server instance, but not only have you figured it out and implemented it already, but also made sure to work out the single BE.NET instance. Anything I can do to help, just let me know.

file attachments

Closed May 6, 2009 at 10:53 PM by Proffitt
Happy to help out, glad we got to the bottom of it.

comments

Proffitt wrote Apr 25, 2009 at 7:58 AM

There's a couple things we can check. The AddNewBlog template "shouldn't" need to be tweaked, but there's likely a "works on my machine" issue with it. To help check, I de-templated the script and I'll attach that here. You'll probably want to change the be_Blogs host from "localhost". If you could review and/or see if you still have issues running the attached script I'd appreciate it.

There are a couple of potential fail points we can verify while we're at it. Make sure that you have the correct defaultProvider set on each of the three provider sections. If you want to make doubly sure, remove the extra providers. Also, make sure each blog is configured with some separate content. Since the initial scripts will make them all look the same, try editing an entry, or, my favorite, set a theme.

The key to which blog will display is in matching the request Url with the values in the be_Blogs table (Host and Path mostly, though Port is an option as well). If all your sites match, then it'll take the one with the longest Path. If it doesn't find any matches, it'll re-query to find one with IsDefault set to true (and again, if there are multiple matches, it'll take the one with the longest path). Indeed, one way to test is if you run it from a site that doesn't match any of the entries in be_Blogs and alter which one has IsDefault set.

BizTron wrote Apr 27, 2009 at 3:15 PM

I verified the Providers. I am using BlogEngine.NET 1.5.0.7 (Web, release) for these tests, but I also have the source in case I need to debug or modify anything. I don't know how all sites can "match" unless I use the same "host:port/path" combination. I'm using a separate host/domain name for each site, and no "localhost". All ports are 80, but I'll try to mix that up for testing as well.

Do I need a path for this to work? What if every host header is a domain? I'm using a the hosts file to create domains that are not real but all work as 127.0.0.1. I can try to use a path to see if that is the problem. Also, do you know if the domains and paths are case insensative for purposes of matching them.

BizTron wrote Apr 27, 2009 at 3:38 PM

Maybe I'm doing the wrong. My configuration has:
1 Web site
4 domains (now), configured as 4 separate host headers in IIS
1 local path that is mapped as a root folder, so path is either NULL or "/".

Each blog has a different name, and the identites in SQL are necessarily different, and match what was configured using the scripts. I can't see a reason to us a path unless I'm using the same path, perhaps when using xp or vista as my deve platform, or if I want separate blogs running in multiple paths, but using one SQL backend. Since I'm running and developing on Windows 2003 (virtual machine) I don't have the path limitations that I would on Vista.

I'm ready for the next round of testing or to qualify what I've already done. I can send my configuration and/or SQL DB backup. I'll try to setup another CLEAN instance right now, and leave the current one intact for comparrison.

BizTron wrote Apr 27, 2009 at 5:13 PM

This was fouled up in your non-templated version of "AddNewBlog-noTemplate.sql". It also looks this way when you execute the template changes using ctrl-shift-M with the templateed version. it must be due to the "Setup
it is time to setup some users.  Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change the username and password.
Write permissions
if you want to store attachments or images in the blog, you will want write permissions setup on the App_Data folder.
On the web
tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at  where the daily builds will be published for anyone to download.

Good luck and happy writing.


The BlogEngine.NET team
',
GETDATE(), 
'admin',
1);

Proffitt wrote Apr 27, 2009 at 5:38 PM

A couple of things

You shouldn't need to do anything to the script I uploaded--i.e. it isn't a template script and should simply be run more or less "as is" (the more or less being whether the host is changed from being 'localhost').

Path is a non-essential option to differentiate blogs. It's fine if left either null or an empty string. Multiple matches shouldn't be an issue if all the host entries are different.

If you can send a backup of your database and/or your configuration files, I'd be happy to test things out here so we can isolate whether it's a setup issue or something more subtle. Email me at Jacob@Proffitt.com or through the contact forms here.

BizTron wrote Apr 27, 2009 at 8:05 PM

Files Sent via e-mail.

BizTron wrote May 4, 2009 at 4:03 PM

Final Comment: Thanks for all the help. I'm glad we finally figured out what I was doing wrong with the installation. My assumption that I could run multiple blogs from a single Web Application was at fault. Once I corrected that, and created multiple apps, actually pointing at the same folder, it worked perfectly.

Thanks again.