This project is read-only.

more than one blog

Oct 23, 2007 at 12:12 AM
I've been trying to figure out if I can have more than one instance of blogengine running on my web server. I want to host several different blogs but I am running into a lot of issues. Here's what I've done so far:

I started with a clean copy of BlogEngine 1.2. I placed the contents in a folder called C:\website\blog on my laptop. Using IIS 5.1 I created a virtual directory to test my blog. I ended up editing customizing one theme and getting rid of the others. I tested out everything locally http:\\localcomputer\blog and was able to do everything normally (add users, delete users, add pages, delete pages, etc..). I wanted to use this as my tempalte if anyone requested their own blog.

I moved on to the my web server running IIS 6.0. I created a new website called I created several name folders in the directory containing my blog website(mjones, csmith, etc..), and I copied the contents of the blog folder from my laptop into each name folder. I made each name folder an application hoping to get people to have their own blogs like I can see the blog just fine in each instance, if this is what is considered an instance, but there are issues with each blog. In one blog I can't add users, in another I can't add blog entries, and in another I can't delete blog entries (or a combination of all three). I get a lame run time error that doesn't tell me anything.

I never messed around with the Web.config file and I even tried to create an exact duplicate of the the blog running locally on my laptop onto my web server (instead of http:\\laptopname\blog it became http:\\\blog\). Everything seemed fine until I tried to delete a post, then it didn't work. The setting on my IIS6 server are identical to that of my local IIS 5.1 setting. The AppData folder has write access, the local ASPNET user is configured to have read access (write to the AppData folder) in both cases.

Why does everything work great on my local computer but when I try to migrate it to my server it breaks down? I tired searching for "multiple blogs" and this is the only thing I could dig up:
The article has suggestions similar to what I tried to do. I'm a complete newbie to everything web related so any help would be greatly appreciated.
Oct 23, 2007 at 5:16 PM
I have planned to do the same. I remember it worked when different blogs were placed into subdirectories of wwwroot and each subdirectory was an application in the same application pool. Now I want to have one blog directly in a webroot and then one or two blogs (instances) in subdirectories. I did not play with web.config in a root dir too.
Oct 23, 2007 at 10:26 PM
What's the runtime error that you get?

Also, did you set each of the virtual directories as an "Application Root"?
Oct 24, 2007 at 12:00 AM
This is what I did to each blog directory:

On the Directory tab, in the Application Settings section, click Create.

In the Application name text box, type the name of the application, and then click OK.

As for the run time error, I wasn't getting any good message back because it wouldn't give me any details on a remote computer. Once I figured this out I went on to the web server and used IE6 to browse to my blog. I tried to delete a blog entry and got this:

UnauthorizedAccessException: Access to the path 'D:\(my blog site folder)\blog\app_data\posts\4da056d8-ef45-4b98-beb8-915793cbac21.xml' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1971539
System.IO.File.Delete(String path) +157
BlogEngine.Core.Providers.XmlBlogProvider.DeletePost(Post post) +283
BlogEngine.Core.Providers.BlogService.DeletePost(Post post) +36
BlogEngine.Core.Post.DataDelete() +29
BlogEngine.Core.BusinessBase`2.Update() +153
BlogEngine.Core.BusinessBase`2.Save() +324
BlogEngine.Core.Web.Controls.BlogBasePage.OnPreInit(EventArgs e) +452
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +521

The thing is that in some folders (different blogs) I can't add a user because I'm denied access to users.xml

I know, I'm going to get a lot of this is a permissions issue feedback, but I've changed the permissions so many times it's not even funny. Which user am I supposed to be giving rights to? On my laptop I gave read access to ASPNET and write access to ASPNET in the AppData folder. I tried to do the same on the server but it didn't work. I even gave ASPNET full access to the AppData folder but it still didn't work.

Oct 24, 2007 at 8:15 AM
IIS6 uses Application Pools. Each Application Pools contains one or more applications. Each Application Pool uses some identity - default is Network Service. Look at your server and give this account at least RX rights to your blog root directory (and subdirs) and add Write right to your AppData folder. Run "iisreset" after this and test your instances.

One Application Pool can contain only "one level" .NET framework. You cannot mix ASP.NET 1.1 and ASP.NET 2.0 applications in one pool. BE.NET is .NET FW 2.0 application.
Oct 24, 2007 at 10:19 AM
@rdolezel - Good point! Maybe to clarify for people: while an application pool can host either .net 1.1 or .net 2.0 it can contain 1.1 and 2.0 applications as long as the 2.0 CLR is loaded (because 2.0 can run 1.1 code) but if you leave it to IIS and load a 1.1 application then your 2.0 application will die.

Personally I configure each virtual directory/application to have it's own application pool so that it can not adversely affect anything else running on the machine and so there is no confusion about what is loaded into it. I also set the level of .net explicitly.

Oct 24, 2007 at 4:20 PM

I created a new application pool as the Default was set to use 1.1. For some reason I could not give access to The Network Services user as I tried this from the begining. Everytime I'd search for Network Services to give the account permission the server wouldn't find the local account. I have no idea who configured the server, but anyway, I just set ASPNET to use the BLOGNET application pool I created. So far I can delete posts now. I'll try some more later.

Thanks for your help everyone.
Oct 24, 2007 at 8:34 PM
Well I tested out everything and it looks like I can add/delete posts and add/delete users. I had to enable Modify and not just Write permissions in the App_Data folder in order to delete posts. This is odd since I didn't have to do this on my copy running locally. Well it works.

Let's see if anything else arises from trying to host multiple blogs.
Oct 24, 2007 at 9:38 PM
Sorry, Write should be replaced by Modify, it was early morning...

To delegate rights to Network Service, simply type "Network Service" into proper field and click on Check Names button. You wrote "Network Services" twice, there is a owerflowing "s".

Network Service should be member of IIS_WPG local group by default, do not change it.
Oct 26, 2007 at 6:09 PM
You are correct I kept putting that extra "s" and that is why I could not add that user to my folder security. Thanks for your help.