The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘IIS’ Category

Internet Information Server

How to properly cleanup/shutdown a Delphi ISAPI (which uses Threads) | Mathias Pannier programmiert

Posted by jpluimers on 2019/10/03

For my link archive:

If you use Threads or global Objects (which are created in the initialization section for example) You have to cleanup/shutdown them in the OnTerminate event of the ISAPI Application. If You destroy/shutdown them in the finalization section in a unit it could end up in a hanging application pool in IIS on shutdown/reuse and some windows event log entries.

//added
procedure DoTerminate;
begin
  //free global objects and wait/terminate threads here
end;
exports
  GetExtensionVersion,
  HttpExtensionProc,
  TerminateExtension;
begin
  ReportMemoryLeaksOnShutdown := true;
  CoInitFlags := COINIT_MULTITHREADED;
  Application.Initialize;
  Application.WebModuleClass := WebModuleClass;
  TISAPIApplication(Application).OnTerminate := DoTerminate; //added
  Application.Run;
end.

Source [WayBack] How to properly cleanup/shutdown a Delphi ISAPI (which uses Threads) | Mathias Pannier programmiert

Related:

–jeroen

Posted in Delphi, Development, IIS, Software Development | Leave a Comment »

Enabling IIS log files on Windows 7

Posted by jpluimers on 2019/10/01

Since each Windows version, Microsoft hides the way to first enable, then configure IIS Logging in a different place: [WayBack] Enabling IIS log files on Windows 7.

That should provide me some guidance on how to find it back when it is not displayed at all.

Related:

–jeroen

Posted in Development, IIS, Power User, Software Development, Windows | Leave a Comment »

UptimeRobot is written in PHP and runs on IIS

Posted by jpluimers on 2018/11/28

In [WayBackJeroen Pluimers‏ @jpluimers: Every now and then editing @uptimerobot entries failed. Just “HTTP Error 503.4 – Service Unavailable The FastCGI pool queue is full” 1/2 I found out that UptimeRobot:

There is also a maintenance page at uptimerobot.com/maintenance.php#tvMode [Archive.is] and uptimerobot.com/maintenance.php?c-e [Archive.is]. If you get to those, then retry in ~10 minutes as sometimes it takes that long for an update to be processed.

Sometimes setting up multiple Android devices for the same uptimerobot account can be a bit of a hassle: [WayBack] Uptime Robot on Twitter: “Once logged in to the account from another Andriod device, that device will be added as an alert contact too.… “.

All in all it is still a nice tool (:

–jeroen

Read the rest of this entry »

Posted in *nix, Development, IIS, Monitoring, PHP, Power User, Scripting, Software Development, Uptimerobot, Web Development | Leave a Comment »

stop/start IIS

Posted by jpluimers on 2016/03/03

I know, old knowledge, but I only recently added the below batch files to file collection.

Why? Because since a few Windows versions, the System process uses port 80 because IIS is installed by default in many configurations. And recently I had to do quote a bit of http communication work against a local machine outside the IIS realm.

windows 7 – Why is System process listening on Port 80? – Super User.

Stop IIS:

:: http://stackoverflow.com/questions/22084561/difference-between-iisreset-and-iis-stop-start-command
:checkPrivileges
  net file 1>nul 2>nul
  if '%errorlevel%' == '0' ( goto :gotPrivileges ) else ( goto :getPrivileges )

:isNotAdmin
:getPrivileges
  echo You need to be admin running with an elevated security token to run %0
  goto :exit

:isAdmin
:gotPrivileges
::  net stop w3svc
::  net stop iisadmin
  iisreset /stop

:exit
  ::pause
  exit /b

Start IIS:

:: http://stackoverflow.com/questions/22084561/difference-between-iisreset-and-iis-stop-start-command
:checkPrivileges
  net file 1>nul 2>nul
  if '%errorlevel%' == '0' ( goto :gotPrivileges ) else ( goto :getPrivileges )

:isNotAdmin
:getPrivileges
  echo You need to be admin running with an elevated security token to run %0
  goto :exit

:isAdmin
:gotPrivileges
::  net start w3svc
::  net start iisadmin
  iisreset /start

:exit
  ::pause
  exit /b

–jeroen

Posted in Batch-Files, Development, IIS, Scripting, Software Development | Leave a Comment »

logparser – Wikipedia, the free encyclopedia

Posted by jpluimers on 2015/07/31

Thanks to Sebastian Gingter for pointing me at Logparser:

Logparser […] powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows operating system such as the Event Log, the Registry, the file system, and Active Directory. The results of the input query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.

Common use:

$ logparser [options] [SQL expression]

–jeroen

via logparser – Wikipedia, the free encyclopedia.

Posted in Development, IIS, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

IIS on Windows 7: installing and opening the firewall

Posted by jpluimers on 2012/11/12

Usually, I run IIS only on server systems, but for the occasional time when I need it on a (development) workstation (as Cassinni only listens to localhost), these links come in handy:

  1. Installing IIS 7 on Windows Vista and Windows 7 : Installing IIS 7 : Installing and Configuring IIS : The Official Microsoft IIS Site.
    This helps you setup IIS 7, and make sure ASP.NET works on it
  2. Allowing Remote Connection in IIS on Windows 7 – Super User.
    This helps you open up the firewall to access IIS over http port 80.
  3. Make sure if you add virtual directories or applications, that they are based on Physical Paths. When not (for instance with a subst path), you will get an error like this:
    <<
    —————————
    Add Virtual Directory
    —————————
    The specified directory does not exist on the server.
    —————————
    OK
    —————————
    >>
  4. For ASP.NET applications, when creating a virtual directory or application (especially outside the C:\inetpub\wwwroot realm), make sure the rights are set correctly.
    The IIS configuration will warn you when testing a new virtual directory:
    <<
    The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that <domain>\<computer_name>$ has Read access to the physical path. Then test these settings again.
    >>
    When in doubt, check out the rights set to C:\inetpub\wwwroot and use that as a point to get started.
    Usually the user is IIS_USRS, and the minimum rights looks like read+execute, but in fact is excute+read-data+read-attributes+read-extended-attributes.

–jeroen

Posted in Development, IIS, Software Development, Web Development | 2 Comments »

Web means Unicode

Posted by jpluimers on 2010/02/12

Google published an interesting graph generated from their internal data based on their indexed web pages.Encodings on the web

A quick summary of popular encodings based on the graph:

  1. Unicode – almost 50% and rapidly rising
  2. ASCII20% and falling
  3. Western European* – 20% and falling
  4. Rest – 10% and falling

Conclusion: if you do something with the web, make sure you support Unicode.

When you are using Delphi, and need help with transitioning to Unicode: contact me.

–jeroen

* Western European encodings: Windows-1252, ISO-8859-1 and ISO-8859-15.

Reference: Official Google Blog: Unicode nearing 50% of the web.

Edit: 20100212T1500

Some people mentioned (either in the comments or otherwise) that a some sites pretend they emit Unicode, but in fact they don’t.
This doesn’t relieve you from making sure you support Unicode: Don’t pretend you support Unicode, but do it properly!

Examples of bad support for Unicode are not limited to the visible web, but also applications talking to the web, and to webservices (one of my own experiences is explained in StUF – receiving data from a provider where UTF-8 is in fact ISO-8859: it shows an example where a vendor does Unicode support really wrong).

So: when you support Unicode, support it properly.

–jeroen

Posted in .NET, ASP.NET, C#, Database Development, Delphi, Development, Encoding, Firebird, IIS, InterBase, ISO-8859, ISO8859, Prism, SOAP/WebServices, Software Development, SQL Server, Unicode, UTF-8, UTF8, Visual Studio and tools, Web Development | 7 Comments »

.NET/C#/ASP.NET – CodeProject: Multi-Threading in ASP.NET. Free source code and programming help

Posted by jpluimers on 2010/01/12

Finally someone who explains this topic well: CodeProject: Multi-Threading in ASP.NET.

Most of it is based on Web 405 “Building Highly Scalable ASP.NET Web Sites by Exploiting Asynchronous Programming Models” by Jeff Prosise, which should be here on the Microsoft events site (which currently has connection problems) and is referenced here and here.

Recommended reading!

–jeroen

Posted in .NET, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, IIS, Software Development, Visual Studio and tools | 2 Comments »

IIS Error 404 2 1260

Posted by jpluimers on 2009/11/09

This just had this happen on a Windows 2003 server with a client’s client.

Any .asmx page would return a 404 error like this IIS log line shows:

2009-11-06 09:46:05 127.0.0.1 GET /MyVirtualDirectory/MyWebService.asmx – 80 – 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) 404 2 1260

Searching for “iis 404 2 1260 asp.net” found this top from Marc Valk, that solved the issue: ASP.NET v2.0.5727 was prohibited to run.
Which means that none of the ASP.NET bound extensions would work: they all returned 404 errors.

(Note: if you are wondering where your IIS log files are, this post shows you).

–jeroen

Posted in .NET, ASP.NET, Development, IIS, SOAP/WebServices, Software Development, Web Development | Leave a Comment »