Entries Tagged as 'Windows 2008 Server'

Change binding order of multiple network cards to resolve DNS issues

Windows 2008 Server 1 Comment »

I have had this problem a few times where a server with 2 network cards, 1 for local network and one for internet access, will use the local NIC for DNS lookup by default. If your local NIC uses a DNS server which does not perform recursive lookup, then you will have issues making outgoing connections. this may affect all outgoing connections, such as web browsing, or may affect only certain types of connections such as SMTP or applications (such as ColdFusion) trying to make connections to external sites.

In my case I have had this issue with SMTP, more specifically the Microsoft SMTP service that comes with IIS, it simply would not send mail, and I have had this on a few servers.
If you open command prompt and try to do an nslookup of type=mx then it should tell you which name server it is trying to perform the lookup against, and thus why it is failing.

The solution is actually pretty simple, you just need to change the order in which your network cards are used by the system for dns lookups, so that the external nic with the external dns servers is used first.

To do this, simply open your network connection settings "Control Panel\Network and Internet\Network Connections", and press the ALT button to bring up the file menu (this is the bit you probably didn't know about either), then choose advanced –> advanced settings.
Now in the connections list, just move the external nic to the top.

Restart any services which are having issues and bobs your uncle things should be working again.

Here is a video to show you how to change the settings if you are still confused.
http://screencast.com/t/KBJIwrTzX

Per application servlet mappings for Railo

Railo , Windows 2008 Server No Comments »

Another of the big annoyances with Railo is that it won't handle SEO friendly URL's out of the box, you need to get into the application servers servlet mappings to add url filters for each of your SEO URL formats.

e.g. each of these would require a separate servlet mappings url-filter.

mysite.com/index.cfm/something
mysite.com/sub1/index.cfm/something
mysite.com/muraCMS/index.cfm/something

If you are on a shared server then this can be a big problem as you do not have the ability to do this, plus making changes may also break other sites.

Thankfully there is a solution that allows you to apply these url filters on a per site basis, at least for Jetty anyway, I have not tested on any of the other servlet containers such as Tomcat, but the same solution is likely possible.

in your web root you will have a "web-inf" folder which is created automatically and contains your Railo context, inside this folder create a web.xml file and paste in the below contents. 
This will allow the most common SEO URL  "index.cfm/something" to work, I have also included the required filters for MangoBlog. Now you just need to modify this file within each of your sites and add any required url-filters.
The only caveat is that you need to restart your app server in order for the settings to take affect, if you are using the Helicon Zoo module that I blogged about previously then you simply need to recycle your application pool. This can be achieved by editing your web.config as any change to this file forces IIS to recycle the application pool.

 



<?xml version="1.0" encoding="ISO-8859-1"?>


 


<web-app


xmlns="http://java.sun.com/xml/ns/javaee"


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"


metadata-complete="true"


version="2.5"


>


<servlet-mapping>


<servlet-name>CFMLServlet</servlet-name>


<url-pattern>index.cfm/*</url-pattern>


<url-pattern>/post.cfm/*</url-pattern>


<url-pattern>/archives.cfm/*</url-pattern>


<url-pattern>/page.cfm/*</url-pattern>


<url-pattern>/author.cfm/*</url-pattern>


<url-pattern>/feeds.cfm/*</url-pattern>


</servlet-mapping>


</web-app>


 

 

Plugin updates fail on wordpress and other PHP apps resulting in locked files.

WEBBY STUFF , Windows 2008 Server No Comments »

If you are running windows 2008 server with IIS 7 then you may have noticed a problem with your PHP apps such as Wordpress or Joomla when you try to perform updates.

The problem occurs when the old files are deleted, the delete fails to complete leaving the files/folders in a locked state and you are then unable to do anything with them at all.

this problem has been plaguing me fore a few months and solution has been to use a file unlocker tool to release the lock.

I have recently found the cause for this to be the Wincache extension for PHP, you can find more details and a fix HERE.

The WebResource.axd handler must be registered in the configuration to process this request

ColdFusion , Windows 2008 Server 3 Comments »

Has this crop up a few times, and there are all kinds of articles on the web giving complex workarounds which simply did not apply in my case.

The cause in my case was ColdFusion, specifically the wildcard (*)  handler mapping, because this handler tries to process the request first to see if the file being requested is CFML, if not then it returns the request back to IIS, which thus causes the above error.

The solution is simply to remove the wildcard handler mapping.

image

If you need to run CF and ASP.NET on the same site then you need to do so without the wildcard handler mapping. Unfortunately the regular handlers don't actually work as they point to jrun_iis6.dll , and I have no idea why they are even created, perhaps some legacy thing.

So you have to  change all the standard handlers (.cfm, .jsp etc) to point to the jrun_iis6_wildcard.dll instead of jrun_iis6.dll, and CFM pages will now work happily with ASP, PHP or anything else.

IIS7 blocks viewing access to certain folder names

WEBBY STUFF , Windows 2008 Server No Comments »

I was just asked to help someone troubleshoot a site that worked fine on previous host but didn't work on Windows Server 2008 / IIS7.  None of the images on certain pages were displaying,  the image path looked something like this:

 

http://www.sitename.com/subfolder/bin/file.jpg

 

The subfolder wasn't marked as an application, although that doesn't really matter.  The point is that since /bin/ was in the path somewhere, and it turns out that  IIS7 wont allow any file to be displayed with a /bin/ in the path.  It serves up a 404.2 error saying file or directory not found.

 

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.If you look

 

If you look in applicationHost.config you will find the following under the <requestFiltering> section:

 

 
<hiddenSegments applyToWebDAV="true">
  <add segment="web.config" />
  <add segment="bin" />
  <add segment="App_code" />
  <add segment="App_GlobalResources" />
  <add segment="App_LocalResources" />
  <add segment="App_WebReferences" />
  <add segment="App_Data" />
  <add segment="App_Browsers" />
</hiddenSegments>

 

So, IIS7 now blocks those key folders and doesn't allow them to be seen.  To the outside world, any page in any of these folders appears to not exist.

 

The easy solution is to change the folder name, but there may be times when you really do want to keep the path name, such as for SEO purposes.  Not to worry, it can be changed easily enough.  This setting in on purpose though as it is for asp.net, so you usually shouldn't remove it for the whole site.

 

If it is your own server then you can use AppCmd or do it manually from applicationHost.config or web.config.  Since requestFiltering is allowed to be set at the site or folder level by default, it's probably best to set a web.config file in the folder that you want to allow, which is your only option on shared hosting.

 

To do this on a per folder level, create a web.config file in your folder and type or paste the following into it.  It should look something like this:

 

<?xml version="1.0"?>
    <configuration>
      <system.webServer>
        <security>
            <requestFiltering>
                <hiddenSegments>
                  <remove segment="bin" />
                </hiddenSegments>
            </requestFiltering>
        </security>
      </system.webServer>
</configuration>

If you want to make the change to your applicationHost.config file instead, you can do it by adding a location tag to the bottom of the file (well, almost the bottom - along with the other location tags) like this:

 

<location path="sitename.com/subfolder/bin/debug">
    <system.webServer>
        <security>
            <requestFiltering>
                <hiddenSegments>
                    <remove segment="bin" />
                </hiddenSegments>
            </requestFiltering>
        </security>
     </system.webServer>
</location>

 

 

To do this using AppCmd just drop to the command prompt and type the following: (Be sure to change the paths to the correct page before running this.)

 

C:\Windows\System32\inetsrv\appcmd.exe set config "sitename.com/subfolder/bin/debug" -section:system.webServer/security/requestFiltering /-hiddenSegments.[segment='bin']

 

After making this change, you will be able to view pages normally, even if they have /bin in the site path.

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds