titbits – Helicon Tech Blog http://www.helicontech.com/articles Web Server Enhancements Fri, 11 Nov 2011 13:14:43 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.4 Automatic cache cleaning in Helicon Ape http://www.helicontech.com/articles/automatic-cache-cleaning/ http://www.helicontech.com/articles/automatic-cache-cleaning/#comments Wed, 12 May 2010 10:30:00 +0000 http://localhost:85/blog/?p=72 Continue reading ]]> Up to version 3.0.0.39 Helicon Ape cache could be cleaned only manually. Memory-based cache (mod_mem_cache) required recycling of corresponding application and disk-based cache (mod_disk_cache) cleaning implied manual files deletion form the file system. That was slightly inconvenient, to put it mildly.

Helicon Ape 3.0.0.39 (and newer) got support of cache cleaning upon request.
Now, to clean cache just set the cache-clear environment variable. This will cause cache cleaning corresponding to the current request (context).

Setting cache-clear variable using SetEnvIf directive provides flexibility of conditions that will lead to cache cleaning.

For example, to trigger cache cleaning by requesting specific URL:

SetEnvIf request_uri ^/system/cache/clear/$ cache-clear=1

To trigger cache cleaning by appending specific query string value:

SetEnvIf Query_String clear_cache_request cache-clear=1

For security purposes it may be necessary to clean cache only from definite IP address:

SetEnvIf (Query_String clear_cache_request) and (Remote_Addr 11\.22\.33\.44) cache-clear=1

Cache cleaning may take some time, so be ready.

When cache cleaning is over, the error.log (with info or higher verbosity level) will display the number of deleted records.

Best regards,
Ruslan, Anton – Helicon Tech Team

]]>
http://www.helicontech.com/articles/automatic-cache-cleaning/feed/ 3
Titbits: Making Ape work with Plesk 9.5.1 http://www.helicontech.com/articles/making-ape-work-with-plesk/ http://www.helicontech.com/articles/making-ape-work-with-plesk/#comments Thu, 22 Apr 2010 07:39:00 +0000 http://localhost:85/blog/?p=71 Continue reading ]]> If you have Ape and Plesk installed on your server, you may come across the issue that Ape is not working in it’s entirity. This may be caused by the fact that Plesk overrides the handlers list for each domain it creates. Like this:

<location path="Example.com">
        <system.webServer>
            <handlers accessPolicy="Read, Script">
                <clear />
                <add name="Plesk_Handler_05171048" path="*.dll" verb="*"
                    modules="IsapiModule" resourceType="File"
                    requireAccess="Execute" allowPathInfo="true" />
                <add name="Plesk_Handler_05171080" path="*.exe" verb="*"
                    modules="CgiModule" resourceType="File"
                    requireAccess="Execute" allowPathInfo="true" />
                <add name="StaticFile" path="*" verb="*"
                    modules="StaticFileModule,DefaultDocumentModule,
                    DirectoryListingModule" resourceType="Either" />
            </handlers>
            ...
    </location>

To add handler for Helicon Ape, you need to add this simple spell to the root web.config for the site:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>

    <handlers>
      <add name="Helicon.Ape Handler" path="*.apehandler" verb="*"
          type="Helicon.Ape.Handler" resourceType="Unspecified"
          preCondition="integratedMode" />
    </handlers>

  </system.webServer>
</configuration>

Guess, this small hint will make Plesk and Ape cohabitation on your server more peaceful.

Best regards,
Sergey, Anton – Helicon Tech Team

]]>
http://www.helicontech.com/articles/making-ape-work-with-plesk/feed/ 482
Titbits: Disabled ASP.NET handler prevents Ape from working http://www.helicontech.com/articles/disabled-asp-net-handler-prevents-ape-from-working/ http://www.helicontech.com/articles/disabled-asp-net-handler-prevents-ape-from-working/#comments Wed, 31 Mar 2010 14:00:00 +0000 http://localhost:85/blog/?p=70 Continue reading ]]> There have always been problems with any kind of software, when the software itself is installed correctly but doesn’t seem to work.

The same problem occured with Helicon Ape while installing on Windows Server 2003, IIS6. User had full control of config files and was able to browse the sites in IIS, but not a single rule took effect.

Investigation of the problem led us to IIS Manager/Web Service Extensions. The ASP.NET handler was disabled, which was completely blocking Helicon Ape operation.

The reason is that Ape is an ASP.NET module which can’t be run with appropriate handler “prohibited”.

One look is all it takes to find a solution to the issue – press “Allow” button for ASP.NET in Web Service Extensions:

Best regards,
Andrew & Anton, Helicon Tech Team

]]>
http://www.helicontech.com/articles/disabled-asp-net-handler-prevents-ape-from-working/feed/ 829
Titbits: Plus sign in IIS7 http://www.helicontech.com/articles/plus-sign-in-iis7/ http://www.helicontech.com/articles/plus-sign-in-iis7/#comments Wed, 10 Mar 2010 10:00:00 +0000 http://localhost:85/blog/?p=68 Continue reading ]]> This seems to be a known issue, but I’ll cover it once again just in case…

So, after fresh install of IIS7 you are likely to notice that requests containing plus (‘+’) character are not accepted.

The issue is that by default IIS is set to not accept double escape sequences. Let’s fix it.

Open IIS Manager, go to Request Filtering page and open Edit feature settings… dialog.

Now check the Allow double escaping option and press OK.

Note! The same can be set directly in web.config using the following code:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <security>
            <requestFiltering allowDoubleEscaping="true" />
        </security>
    </system.webServer>
</configuration>

That done, refresh the page in the browser and you’ll have it handled correctly.

Hope you’ll find this tip helpful.

Best regards,
Anton, Helicon Tech Team

]]>
http://www.helicontech.com/articles/plus-sign-in-iis7/feed/ 1
Adjusting Coldfusion & ISAPI_Rewrite collaboration http://www.helicontech.com/articles/adjusting-coldfusionisapi_rewrite-collaboration/ http://www.helicontech.com/articles/adjusting-coldfusionisapi_rewrite-collaboration/#comments Thu, 18 Feb 2010 14:57:00 +0000 http://localhost:85/blog/?p=64 Continue reading ]]> If you have ISAPI_Rewrite3 (Ape) and Coldfusion installed on your server, you may encounter issues with requests to .cfm resources. The problem lies in handler mappings configuration. To resolve it, any handler mappings for *.cfm extension should be mapped to 1\jrun_iis6_wildcard.dll executable (instead of run_iis6.dll).

The following piece of code should be put into the web.config in the root of your site if you are on Windows Server 2008 (the x‘s in bold are machine-specific and must be replaced by proper numbers):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <remove name="AboMapperCustom-xxxxxxxx" />
      <remove name="AboMapperCustom-xxxxxxxx" />
      <remove name="AboMapperCustom-xxxxxxxx" />
      <remove name="AboMapperCustom-xxxxxxxx" />
      <remove name="AboMapperCustom-xxxxxxxx" />
      <add name="AboMapperCustom-xxxxxxxx" path="*.cfm" verb="*" modules="IsapiModule"
         scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
         resourceType="Unspecified" requireAccess="Script" responseBufferLimit="0" />
      <add name="AboMapperCustom-xxxxxxxx" path="*.cfc" verb="*" modules="IsapiModule"
         scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
         resourceType="Unspecified" requireAccess="Script" responseBufferLimit="0" />
      <add name="AboMapperCustom-xxxxxxxx" path="*.cfml" verb="*" modules="IsapiModule"
         scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
         resourceType="Unspecified" requireAccess="Script" responseBufferLimit="0" />
      <add name="AboMapperCustom-xxxxxxxx" path="*.cfr" verb="*" modules="IsapiModule"
         scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
         resourceType="Unspecified" requireAccess="Script" responseBufferLimit="0" />
      <add name="AboMapperCustom-xxxxxxxx" path="*.cfswf" verb="*" modules="IsapiModule"
         scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
         resourceType="Unspecified" requireAccess="Script" responseBufferLimit="0" />
    </handlers>
  </system.webServer>
</configuration>
 

Regards,
Anton, Helicon Tech Team

]]>
http://www.helicontech.com/articles/adjusting-coldfusionisapi_rewrite-collaboration/feed/ 2
Titbits: dynamic mapfiles names http://www.helicontech.com/articles/dynamic-mapfiles-names/ http://www.helicontech.com/articles/dynamic-mapfiles-names/#comments Fri, 22 Jan 2010 10:02:00 +0000 http://localhost:85/blog/?p=60 Continue reading ]]> Not so long ago one of our clients urged us to test an interesting situation we’ve never tried before. The result was positive and saved him a lot of lines in the config file. Now we want to share this experience with you.

So, the conditions were:

  • about 300 mapfiles with the first part of name being the name of the city, e.g. london-map.txt, paris-map.txt, moscow-map.txt etc.;
  • the requests are made to the subdomains having the names of the cities, e.g. london.domain.com, paris.domain.com, moscow.domain.com etc.;
  • requests to SEO-friendly URLs should be rewritten to the .asp page with the “id” taken from the corresponding mapfile and the “city” parameter being the city name.


Solution
To accomplish the above task with the least effort, we need the following.

Mapfiles:

london-map.txt:
london_seo_value1 11
london_seo_value2 22
london_seo_value3 33
etc.

paris-map.txt:
paris_seo_value1 44
paris_seo_value2 55
paris_seo_value3 66
etc.

moscow-map.txt:
moscow_seo_value1 77
moscow_seo_value2 88
moscow_seo_value3 99
etc.

Config:

RewriteBase /
RewriteMap london-map txt:london-map.txt [NC]
RewriteMap paris-map paris-map.txt [NC]
RewriteMap moscow-map moscow-map.txt [NC]
#etc.
RewriteCond %{HTTP_HOST} ^(?!www\.)([^.]+)\.domain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${%1-map:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^/]+)/?$ city.asp?city=%1&id=${%1-map:$1} [NC,L]

The idea is that the first part of mapfile name is dynamic and depends on the name of the subdomain being requested.

Now upon request to http://paris.domain.com/paris_seo_value1 you’ll be shown the content of http://www.domain.com/city.asp?city=paris&id=44. And upon request to http://moscow.domain.com/moscow_seo_value3 you’ll be shown the content of http://www.domain.com/city.asp?city=moscow&id=99.

Resume
As you can see we have just one rule (instead of 300) which cares about all possible requests and deals with all existing mapfiles.

]]>
http://www.helicontech.com/articles/dynamic-mapfiles-names/feed/ 1
Titbits: ISAPI_Rewrite double registration http://www.helicontech.com/articles/isapi_rewrite-double-registration/ Thu, 22 Oct 2009 09:45:00 +0000 http://localhost:85/blog/?p=52 Continue reading ]]> Hello!

We have decided to start a series of little titbits about our software. You may find them interesting
and helpful.

Today we’re gonna explain you what the “double registration” term means. It’s a typical situation on our support when a user can’t get ISAPI_Rewrite working while everything seems great, NTFS permissions are OK, the rules are the simplest ever but still no go.

In these cases we commonly ask the user to provide their IIS metabase.
On Windows 2003 Server you may find it here: C:\windows\system32\inetsrv\metabase.xml.
Windows 2008 provides another configuration model and we ask for C:\windows\system32\inetsrv\config\applicationHost.config.

Generally, double registration means simultaneous registration of ISAPI_Rewrite.dll on two different levels. “Web Sites” tree node is what we call “global level”. If you have ISAPI_Rewrite registered here, you will have the tool working for every web-site on your server. Saying “local level” we imply particular web-site.

So the point is you must have only one type of the registration — either on the global level, or on one or several local levels (to enable ISAPI_Rewrite for one or several sites respectively).

Within IIS metabase a double registration issue looks as follows:

<IIsFilter Location ="/LM/W3SVC/1800802984/filters/ISAPI_REWRITE"
  FilterPath="C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_Rewrite.dll"
 >
</IIsFilter>
 
<IIsFilters Location ="/LM/W3SVC/Filters"
  AdminACL="4963....342d"
  FilterLoadOrder="ASP.NET_2.0.50727.0,ISAPI_Rewrite3"
 >
</IIsFilters>

If you selected automatic installation of ISAPI_Rewrite you would have the tool registered globally. Here is an example:

The next screenshot demonstrates correct local registration, which you can’t get from the installation wizard, but should perform manually:

This is it. We’ve described the very gist of double registration and hope you won’t have such misconfiguration on your system.

Yours sincerely,
Helicon Tech team.

]]>