Author |
Topic  |
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 13 October 2002 : 04:28:39
|
Anyone has a script that will remove all the forum applications from a site? I mean, I am working with 2 forums and both are now messed up because I renamed the folders to the other and vice-versa.
I want to just remove all the application variables then let setup.asp just load a fresh copy of variables.
Or is this only achieved by restarting IIS? |
Support Snitz Forums
|
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 13 October 2002 : 04:33:13
|
try this:
Application.Contents.RemoveAll() |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 13 October 2002 : 05:16:06
|
quote:
Application.Contents.RemoveAll()
I don't think that works on all versions of IIS.
Sometimes restarting IIS is the only way.
Quickest way to reset everything during development is to create a .bat file with the following commands:
net stop w3svc net start w3svc
Whenever you screw up, doubleclick the file.   |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 13 October 2002 : 11:33:21
|
Workmule, unfortunately if it was on my local server I would do that. But this is on hosted server, with 121hosting.
Looks like the only way to do this, would be to upgrade the forum within the same folder, so it won't create new application variables.
The forum is loading old 3.3 files that I had. But that can't be possible since there are no 3.3 files in the folder. It might be caching on the server side. Tried placing "no-cache" code and "Expires=0" into the header, but that still shows up 3.3 files.
I had tried the RemoveAll() code, but there doesn't seem to be any change concerning the problems I have with the forum. So I don't know if it worked or not. |
Support Snitz Forums
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 13 October 2002 : 12:02:51
|
Ok, this is really funny. I renamed my forum folder from forum/ to forum2/ so there is no forum/ folder now. But I can still access my forum when I go to forum/ on my site. Now how is it accessing these files when there is no forum/ folder that exists?
It must be cached or something. How can application variables do that sort of thing? lol |
Support Snitz Forums
|
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 13 October 2002 : 14:37:07
|
It kind of sounds like an IIS4 server. I've seen similar apparent server caching of asp pages and never could figure out what was going on. WMII suggestion of stopping and restarting the web server was the only cure I ever found. I don't think the folder renaming is an application variable related issue, I suspect it's an IIS caching issue.
I don't think there is a way to remove application variables from IIS4 other than restarting the web server. But doesn't rerunning setup from your new configurations reset the existing application variables to the new values even though the old values were never removed first?
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 13 October 2002 : 14:48:09
|
quote: But doesn't rerunning setup from your new configurations reset the existing application variables to the new values even though the old values were never removed first?
I guess it should. It probably does. But since this is looking more like a caching problem, then the application variables wouldn't help too much, since I am seeing the 3.3 files still.
I actually deleted my forum folder, but I am still able to access my forum in my forum folder which no longer exists. It will give me a 404 error when trying to post a topic or submit a form, things that aren't cached I suppose.
But I never had such a problem before with caching. Really strange. I have emailed support. Will see what they say about it. |
Support Snitz Forums
|
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 13 October 2002 : 17:30:00
|
Very strange. I hope they get it straightened out for you.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 13 October 2002 : 17:36:04
|
I've heard of caching problems like that for static html pages and some ISP's that offer space for homepages, but not for asp hosts. How odd. Just don't ever put up anything that you might have to bring down right away .
I always found it lame that in the old versions of IIS, I couldn't get rid of the application variables without restarting the server. I could have 2 or more virtual servers (sites) and stop/start a specific one, but the application variables still persisted. The only way to get rid of them is to restart IIS.
Anyways... 
Aside from a restart, the only alternative (for older versions of IIS) is to run the following code and set all application variables to null. It doesn't get rid of them, but at least all the variables are set to null. This of course only works within the scope of the application directory it's executed against.
If request.querystring("action") = "reset" Then
Application.Lock
For Each Item in Application.Contents()
Application.Contents(Item) = NULL
Next
Application.UnLock
End If
|
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 13 October 2002 : 19:34:39
|
quote: I've heard of caching problems like that for static html pages and some ISP's that offer space for homepages, but not for asp hosts. How odd. Just don't ever put up anything that you might have to bring down right away .
I remember this from older NT4.0 IIS, but I don't recall ever seeing this on sp6a servers. But once I spent a day long ago with a problem just like David's where I renamed folders but the renaming appeared to vanish to la-la land until the web server was restarted. My recollection is merely stopping and restarting the web leaving the service running didn't make the problem go away.
There may be some other proxy caching or something getting in the way, maybe it's not the same problem just the same symptoms. 
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 13 October 2002 : 19:58:19
|
Well, they say they don't have any caching enabled.
It amazes me how I can access files in a folder that I know, no longer exists on my server. I have suggested to them if they could restart the server. Hopefully they will be able to do it and it will fix it. |
Support Snitz Forums
|
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 13 October 2002 : 22:48:50
|
May have nothing to do with them, in all likelyhood your ISP runs transparent proxys which may be caching the files. Check your IIS Logs at 121host are there 404 errors ? |
Kiwihosting.Net - The Forum Hosting Specialists
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 14 October 2002 : 01:43:04
|
Yes, there are 404 errors. I have a site statistics program and the 404 error section is climbing steadily.
What can I do if it is a proxy problem? They seem to not know what to do either. I probably might create a virtual folder to temporarily fix this problem. |
Support Snitz Forums
|
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 14 October 2002 : 02:04:44
|
Try accesing one of the pages and place a ? or something at the end of it to trick the proxy into thinking its getting a different page.
ie myhost/folder/default.asp? |
Kiwihosting.Net - The Forum Hosting Specialists
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 14 October 2002 : 02:09:34
|
It still loaded the page (which doesn't exist) normally. I also tried default.asp?mode=test just for testing sake. It still loads the page as normal. |
Support Snitz Forums
|
Edited by - Davio on 14 October 2002 02:10:34 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 14 October 2002 : 02:33:33
|
For now, I have created a virtual directory named forum to my 3.4 forum which is in a folder called /v34/. It works ok, for now. |
Support Snitz Forums
|
 |
|
Topic  |
|