I have an IIS installation with three websites. I'm using Zend PHP -- each site is being directed to it's own PHP.ini file. My problem is this -- whenever I go into IIS to make a change, or restart IIS, the server, or mess with any configuration settings at all, IIS is saving my changes to the:
C:\Windows\System32\inetsrv\config\applicationHost.config file.
...but then it's is pulling an earlier configuration and IIS it referencing it as the config. This blows up the sites, tells me each site is trying to use the same configuration and gives an IIS error. I found that this file it's overwriting everything with is in the C:\InetPub\Temp\appPools[somename].tmp
This file is locked -- I can view it in a text editor, but can't make a change to it. It's taking the config in this file, then pushing it to another folder:
C:\InetPub\Temp\appPools[SiteFolder][site].config
I can take the config from applicationHost.config, and shove it into the site.config, and it fixes my problem -- but only until the next change is made...then that file gets overwritten again. I have many other servers with sites set up like this, and any changed made within IIS is written to applicationHost.config and properly referenced by IIS.
In IIS, if I view "CONFIGURATION: SEARCH CONFIGURATION", I pull up the applicationHost.config file and it shows this 'default configuration, and the path shows:
C:\Windows\System32\inetsrv\config\applicationHost.config
But what it shows in IIS doesn't actually match what is actually in that file. If it wouldn't then everything would work. I'm sure this is confusing -- but if anyone can help lead me in the right direction, I'll really appreciate it :)
Related
As for IIS, I have a PHP app, and I am using web.config for configuration.
When I change settings in web.config, shall I restart the server? or just refresh my webpage and expect settings to take place?
You don't need to explicitly restart server. Web.config is special file, any changes in it are watched FileWatcher and app pool is restarted automatically when you do changes in this file. So your app pool restarts on following things.
Any changes in web.config
Any changes in machine.config
Any changes in global.asax
Anything changes in bin directory or it's sub-directories
A few months ago, I was making changes to this web application for a client. It's a JSP web application with tomcat as the web server. I've made the changes, tested it (of course), and left the application to the client's hands. They have come back to me and mentioned that a specific area of the website is not working. I go in and check the area, indeed it wasn't working but it was working a few months ago when I made the changes.
The issue encountering a very unusual. Every page in the directory in question (/tomcat/webapps/website/english/login) throws a java.lang.ClassNotFoundException.
To troubleshoot the issue, I've tried creating a blank JSP with "hello world" and no coding and still throws a java.lang.ClassNotFoundException. I create the same JSP page outside of this directory and it is fine
Steps taken to replicate this issue:
I enter into the directory in question (tomcat/webapps/website/english/login)
Create a JSP page called test.jsp that literally has "hello world" only (no coding)
On the browser, I navigate to test.jsp. It throws a java.lang.ClassNotFoundException
I enter into the directory one up from login (tomcat/webapps/website/english)
Create a JSP page called test2.jsp that literally has "hello world" only (no coding)
On the browser, I navigate to the test2.jsp page. It works
I've done other test but could not find the issue. See below for some methods performed
Moved the web application into a different directory (tomcat/webapps/website2). Everything, including the /english/login directory, works
Deleted the web application directory and recreated the directory path, still giving me the exception
Checked permissions. The directory in question has the same permissions as everything else in the web application (including the files)
With the results from the tests, I believe the issue is the directory itself (/tomcat/webapps/english/login). Everytime I move the directory, everything works.
Mind you that I was making changes to the web application using a text editor (notepad++) not on eclipse, building the application using TeamCity (which compiled fine), the server runs under linux and I have no access to the build script but I believe ANT is used as the builder
So my question is, what is causing this issue? To have all the files in a specific directory to look for a class?
Any clues/help is much appreciated. I've been working on this problem for a few days. It's mind boggling
Cheers!
I would check the class path being used with PS -ef and look for the process. The error logs should point to a specific class. Those two clues can help determine if is config or war issue.
A possibility that I have seen is that in a tomcat config file, the paths allowed are explicitly defined. Also, a config file could map a specific path to a java class.
Found the answer to my own problem. The issue originates in Tomcat. The web server converts the JSP file into a .java file then compiles it. For some odd reason, Tomcat was not doing this for all my files in a specific folder.
Solution is to go into Tomcat's work folder, drill down until you see your webapp's name and delete the folder. This will force Tomcat to rebuild all the visited pages.
A safer way (which didn't work for me. Did not delete the webapp in the work folder) is to log into Tomcat and undeploy the webapp all together. This should delete the webapp folder in the work folder of tomcat.
Hope this helps for those experiencing similar issues
I'm using multiple computers for development and I want to be able to store my files in my dropbox folder. I went to change the physical path in IIS from c:\inetpup\wwwroot to the dropbox folder but I get this error:
The requested page cannot be accessed
because the related configuration data
for the page is invalid.
I couldn't find the config file so I was wondering if anyone had done this before or whether there a better way to sync everything nicely across several PCs?
I tried it (IIS 7.5, Win 7) and it should work just fine to let your physical path of your web look at your dropfox folder. I would guess your web.config file generally contains malformed XML (see KB942055).
I'd suggest, try to map it to an empty folder just with an index.html file and see if this error still occurs.
As a workaround, I guess you can put Dropbox in your wwwroot folder and set up a virtual directory that points to Dropbox. However, there are some security issues that may hinder you from doing so. I come across a nice tutorial on how to set up Dropbox to IIS as FTP Publishing. Hope it helps.
Hodgin's guide on using Dropbox as FTP publishing.
AFAIK IIS restarts, whenever any of the web.config files is changed.
I've created my own configuration files (my.config, with slightly different hierarchy). Is there any possibility to have IIS automatically (automagically :)) restarted, whenever any of these are changed, too?
EDIT: I've considered filesystem watchers, but I'm not sure where to put them.
You mean to say that whenever you change my.config iis has to be restarted automatically.
Maybe you can write a batch file to perform your iisreset functinality alone if you dont want the user to manually restart IIS. But even if you give a batch file the user still needs to execute.
quick and ugly fix would be put config files in bin directory.
btw. I don't believe I am writing this ;)
these changes restarts web app:
* web.config
* machine.config
* global.asax
* Anything in the bin directory or it's sub-directories
copy/pasted from here Common reasons why your application pool may unexpectedly recycle
Use SomeAssemly.dll.config which will be put into ~/Bin, automatic be read on app (re)start and cause app restart on edit.
Note that App.config in project becomes $(OutputAssembly).config on build
Okay, so I'm at a temporary office and they've given me a machine with XP to do dev on. Awesome.
I've set the site up in IIS and I need it to serve shtml files.
Problem is, when I browse to the shtml file, the browser tries to download the file, rather than display it properly.
I've tried a few things that I've found on other site to no avail, and now I'm just getting frustrated.
Any help?!?!
-Ev
are you serving it with the correct mime type?
shtml simply use the text/html mime type but your IIS might not be configured to match that file extension with that mime type
See http://technet.microsoft.com/en-us/library/cc725608(WS.10).aspx for details on adding mime types (you didn't specify the version of IIS... those docs are for IIS 7)
IIS might be configured for .SHTM / .STM file extension. You can either change the extension in the iIS control panel, or rename your files.
Update: I never got this sorted. I suspect the CMS I was using did something odd. So After ****ing around with it for about a day I decided I'd wasted enough time on it and installed Apache to view the SSI files - still use IIs 5.1 for the actual site.
On the production/dev/test/stage environments, with a newer version of IIS it works fine. it was just my local machine I was having problems on.
So not solved, but I'm not losing anymore sleep/time over it!