create new tag
, view all tags
These tools are simple Cygwin shell scripts used to install, uninstall, start, stop and monitor the Apache WebServer as a service on CygWin - useful for TWikiOnCygwin where you are running Apache for Cygwin (CygwinApache) (not Apache for Win32 (WindowsApache).

The Cygwin cygrunsrv tool doesn't completely work when starting/stopping Apache as a service, for reasons that aren't clear but may be because Apache puts itself in the background (which is not expected of a service). (UPDATE: see below for a fix.)

Sometimes Apache under Cygwin won't start as a service after a system reboot - check /var/log/apache.log for any errors relating to the service not starting, as sometimes such messages are spurious (or just do apachectl start to test-run it as a normal process). If one or more process IDs are listed by srv-apache-start, Apache has started OK.

The scripts require pskill.exe from the Sysinternals pstools package (freeware) - this is a tool that lets you kill an Apache process even though it was started as part of an NT/Win2000 service.

The scripts should be self-explanatory, let me know if you have comments.

You should install the scripts and pskill in /usr/local/bin, to keep them out of the way of Cygwin upgrades.

-- RichardDonkin - 29 Mar 2002

I got Cygwin Apache working as a service on Windows XP Home Edition (SP2) as follows:

  • Edit /etc/apache/httpd.conf to include User Fred, where Fred is a user with local Administrator rights ('computer administrator' in XP Home Edition).
  • Run the following command to install Apache as a service - the -F is the option to keep Apache running, supersedes the obsolete -k option that you may find mentioned elsewhere
          cygrunsrv -I "Apache-Cygwin" -p /usr/sbin/httpd.exe -t auto -a '-F'
  • Start the service - you can use the normal Windows Services folder under Control Panel, or net start Apache-Cygwin, or Cygwin's cygrunsrv -S Apache-Cygwin

The service should start automatically on boot. You might need to redo the installation of the service to add service dependencies to the cygrunsrv -I line - e.g. --dep 'Network Connections' might help on XP. However, I have not tested this.

Scripts attached here have not yet been updated.

-- RichardDonkin - 08 May 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip apache-tools.zip r1 manage 1.4 K 2002-03-29 - 12:00 RichardDonkin Apache tools
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-05-08 - RichardDonkin
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.