Reply to topic
Straight answer on Global.asa
mdleichty


Joined: 04 Jan 2005
Posts: 3
Reply with quote
Alright... I have a subdirectory in my domain, and in that directory I have an ASP application. I'm looking into setting Application-level variables (such as incrementing and decrementing the usercount with Session_OnStart and Session_OnEnd).

The first HostMySite tech says: "Nothing needs to be changed. Simply put global.asa in the directory with your application."
I say: "Can I have separate applications with separate global.asa's on my site?"
Response: "Yes."

I set up global.asa with no results. I can set application-level variables in my ASP pages, but cannot set them from global.asa.

The second HostMySite tech says: "Yes, something needs to be changed first. We need to set up the directories as applications."
I say: "Can I have separate applications with separate global.asa's on my site?"
Response: "Yes. I can set each directory up as an application."

I copy a global.asa file to each directory. Same results. Nothing.

I read elsewhere on the web that the "application" is synonomous with "web site" and global.asa must exist in the root of the web site and in the root only. Implying I can only have one application.

1) What is the truth?
2) If this is true, it's not what I want. I don't want to count visitors to the public site, only to a private site which only employees use (the application that exists in a subdirectory of the site).
3) If global.asa can only exist in the root, it's not working there either.

My global.asa file is rather basic. There are examples like it all over the web:


Code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
   Application("Active") = 0
End Sub

Sub Application_OnEnd
   Application("Active") = 0
End Sub

Sub Session_OnStart
   Application.Lock
   Application("Active") = Application("Active") + 1
   Application.Unlock
End Sub

Sub Session_OnEnd
   Application.Lock
   Application("Active") = Application("Active") - 1
   Application.Unlock
End Sub
</SCRIPT>


And in my testglobal.asp file:

Code:
Response.Write("Active Variable:" & Application("Active"))


What is the solution? Why can't I find one definitive answer? Is there one?
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
Well both answers are correct.

By default when an IIS site is setup an application is created at the root directory. So in terms of the global.asa in the root dir, all you should need to do is put the file there. It is possible that the application in the root needs to be recreated. Ocassionally our automated setups will create the root app, but doesn't take for one reason or another in IIS, even though it says so (thanks Bill).

Then you can also have any directory/subdirectory be it's own application, by adding a global.asa in the sub directory and in IIS creating a new application in the subdirectory.

If we have created applications in IIS for your sub directories, it may still be related to the root app problem I noted above. I would have CS recreate the root directory app. It's a 2 second procedure in IIS, click remove, click create. It may also be good to verify, that there are script mappings in IIS for .asa files. CS can verify this as well. If that fails, they can create a seperate application pool for all of your applications and put your directory applications into that application pool. Perhaps it's some strange conflict with another site preventing things from working.

I've always been under the impression that create app needed to be done in IIS for sub applications. CF does need anything like that, it just searches up the directory structure for an application.cfm file.
Straight answer on Global.asa
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic