Blogengine.net as a subdir to my website? - asp.net

I already have a website running on my server and now I wanted to install Blogengine.net and have it running as a subdirectory to my website. I need it to be a subdirectory so I can check for authorization and use other stuff from my website that is already running.
I get this error if I not create a virtual directory for my blog:
"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."
How can I have BE running as a subdirectory without making it a virtual directory? How can I use the stuff like sessions, masterpages from my already running website?
Hope you understand what I'm talking about, my english is not the best. Sorry! :-)
Thanks!

Just go to Contents>IIS Settings then mark the folder that is mapped to your subdomain as virtual directory.
Hope this helps

I've done something similar, but I did it via my hosting company (GoDaddy.com) as a "shared hosting" solution.
Basically, I have a primary domain (scottmarlowe.com) and, in a sub-folder off that main site, another site (itscodingtime.com) with its own domain but which exists as a sub-folder beneath the scottmarlowe.com root.
So, I have:
root
root \ itscodingtime
where "itscodingtime" is a whole other BlogEngine.NET blog.
I don't know if that answers your question or not, but it's how I did it.

Related

Same virtual (global) directory for multiple websites

I am working on multiple websites in asp.net mvc. Some websites are top level domains and some are subdomain but all these websites are hosted on same server.
www.foo.com
subfoo.foo.com
www.abc.com
a.abc.com
I want all these websites should access same directory for save and retrieve some files in this way i can manage files efficiently.
www.foo.com/assets
subfoo.foo.com/assets
Currently every website is handling data its own wwwroot directory so when i need these files on different website then i have to do lot of work for retrieval.
For this purpose i have created folder out side the websites directory and point out as virtual directory in one websites. I tried to repeat same process for other websites but can 't do this because hosting server does not permit me to point out virtual directory on same folder.
So my question is this limitation of IIS. Is there any other technique to do this task in better way?
Virtual directory is the only way I know of to do what you ask. It sounds odd that you have a limitation of one virtual directory pointing to the same folder, maybe you need a new host.
EDIT: Just realized how old this question was. Well maybe this will still be of help to someone.....
We run IIS with Approx 5 different web sites. These websites each have their own root directory. We don't typically access things from the other websites, but if we were to do this I would think we would setup another directory on the server for those files to live in. This is assuming that the files you are trying to access are static files.
To Clarify...
C:\inetpub\WebSite1Root
C:\inetpub\WebSite2Root
C:\inetpub\WebSite3Root
Then place the static files in
C:\StaticFiles
So to access those static files Website1 (or 2 or 3) would simply look in that shared directory.
I'm not sure if this helps but I would be happy to answer questions if you have any.

what is a root directory in IIS 6 and How do I make one of my subfolder in ASP.NET website the root directory?

I need to integrate a third party plugin in my asp.net website. To install the plugin, they have mentioned this sentence, "Create an application through your IIS control panel with root directory at -(some path from my website folder)?".
I am not much aware with IIS and rarely worked with it. Though I tried every possible way I could do in IIS, I am not able to work it out. After installation, there is a test page provided by plugin which I have to run to check but when I run it, it shows this error.
"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."
I searched this error too and found that it is because the two Web.Config file, one from the main project and another from plugin folder. The only way to work with this, is to make the plugin folder they specified as a root directory in IIS. Someone kindly tell me some easy steps to do this.
What I was doing is, in IIS6, I added New website with the main folder of my asp.net website, then I right click>add application and choose the given path, thought it would become root directory but it is not.
Help would be appreciated. Also note that, I have to put the plugin folder in my main website folder only. So, there are two web.config. I tried to rename one of them too, it solved the above error but gave another errors but I think main problem is of root directory. P.S they show me above error on web.config file of plugin folder on this sentence-
"Line 51:
< authentication mode="Windows" />"
Most of the times the root directory is C:\inetpub\wwwroot folder and "Default Web Site" on IIS Manager.
Open IIS Manager and under Sites there should be IIS websites and under it you will probably see Default website. You can see the root directory with Right click/Settings.
Copy your website files under this root directory.
And after copying folder to root folder you will see this folder under Default websites on IIS.
Right click your directory name on IIS and "Create Application", select correct .net framework.
It should be work. Good luck, if you need more help please give more details on your server IIS.

How to access folder from install web service to the main website

In my IIS server I have a running website and a web service installed in the same website. The structure is something like this.
MainWebSite
Folder1
Folder2
+ WebService
Now how can I get the path of the Folder1? I want to use something like server.mapPath("Folder1")
Hope I've explained properly.
Using Server.MapPath("Folder1"), you cannot get out of your application root folder. If your "Folder1" is outside root folder of webservice, then you will not be able to access this folder.
Or you may have to explain your problem a bit more.

ASP.NET - Publishing a web site to IIS

What is the difference between publishing a website to {localdrive}\inetpub\wwwroot and anywhere else on the web server e.g. C:\Website.
I have noticed that I am always left with a directory and a website in the IIS console if I publish to {localdrive}\inetpub\wwwroot.
After reading articles on MSDN, I am still unclear of the difference. I realise that there is probably a simpe answer to this, but I cannot find it.
The web path / is already mapped to c:\inetpub\wwwroot, so /abc is mapped to c:\inetpub\wwwroot\abc automatically.
When you publish to c:\website, you need to set up a virtual path manually.
Nothing too much as your website path in IIS can point to any directory. However, that being said always double check your directory permissions and security settings. In addition, I guess if a hacker did compromised your webserver... the default c:\inetpub\wwwroot is well known.
And just for good measure in case you are having issues - check out the Aspnet_regiis.exe tool on MSDN as it usually solves a lot of issues for folks.
{localdrive}\inetpub\wwwroot is usually used for the default web site that comes with IIS.
Additional Microsoft products use the same directory and take advantage of the virtual directories that exist in the default site.
If this is your personal web site, or a web site you created from scratch, you can publish anywhere you want.
Before you publish, you need to make sure IIS knows where the directory will be, and you need to assign the correct permissions for that folder.
The default website in IIS is mapped to C:\inetpub\wwwroot by default, so publishing to wwwroot makes it easy to add applications as virtual directories.
However, you can publish wherever you like, and either point a virtual directory or new website at your publication location. You simply need to make sure user the App Pool is running as (usually IUSR under IIS7, IUSR_MachineName under previous versions) has read/execute permissions on the folder you are publishing to.
Although they say Virtual Directory created by default for your website in wwwroot and you don't have to configure it again. Many times I found we still have to go there and click on Remove and then click on Create button again :)
Thus it is almost no problem if you create your website outside wwwroot, only difference outside you have to give full path of VD and inside you have to click Remove and then Create button
The problem I had was different from all of the above. I was trying to publish in "C:\inetpub\wwwroot" and the publish failed every time. Than i changed the publish folder to another and it worked. When I launched visual studio as administrator I could copy to C:\inetpub\wwwroot also without problems

ASP.NET site inside a virtual directory

I am currently putting a new version of my site online. I would like to retain the old site (for purposes of read only access) and have been directed to place it within a subfolder inside the directory where the site use to live. e.g.
www.example.com needs to be moved to www.example.com/old and the new site needs to be moved to www.example.com
Unfortunately I get the classic ASP.NET error when attempting to piggy back sites that each have their own web config.
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.
How can I compeletly seperate off the new site and access it via. www.example.com/old without ASP.NET trying to trickle down through my directories and find the main sites web.config?
Thanks!
Giving the site its own AppPool should work.
You can do this by creating an AppPool and then on the virtual directory in IIS setting the app pool to your new one in the properties.
Make sure that the virtual directory is an application and not just a virtual directory.
You may try the following setting in the site contained in the virtual dir:
<location inheritInChildApplications="false">
Rick Strahl has the same problem and describes his experiences on his blog.
Didn't try it out myself, but found other blog articles which use it successfully with IIS6.
I've tried both creating a new App Pool on the site. That's didn't work -- same errors. I also added the inheritChildApplications attribute directive in my web.config. That didn't work either. The only way I have been able to achieve what I needed was to add a new subdomain in an entirely new folder and put a redirect to it in my www.example.com/old page to old.example.com.
It's not what I was looking to do, but it solved the issue.

Resources