Tuckey URLRewrite How-To
Posted by Ben in CFML/ColdFusion, Railo, Server, Tomcat on November 28, 2011
Today I will walk through how to put into practice use the Tuckey URL Rewrite java web filter under an Apache Tomcat web server.
URL rewriting is the method of converting complex URL parameters into more human readable format to allow more simple and memorable URLs. This can be an important function if you start using frameworks or content management systems which automatically generate long and at times cryptic URLs. While URL rewrite on the more popular Apache HTTP Server is relatively easy to set up using the default mod_rewrite module, reproducing this functionality on Tomcat requires a little more work.
Standard URL: http://www.example.com/list.cfm?product=fruit&page=1&order=asc&perpage=30
Rewrite URL: http://www.example.com/list/fruit/asc/30/1
Installation
A downloadable copy of URLRewrite can be found from one of 2 sources. The outdated website at http://www.tuckey.org/urlrewrite/ lists version 3.2 as the most recent version. But there is a more recent and in my testing still stable 4.0 beta at Google Code http://code.google.com/p/urlrewritefilter/downloads/list that contains some critical bug fixes. This article will assume you have downloaded the 4.0 beta and not the 3.2 stable.
Extracting the downloaded URLRewrite archive reveals a single WEB-INF folder which contains a lib folder and the file urlrewrite.xml. Both these items will need to be copied to the WEB-INF folder of your Tomcat server root directory. For example if example.com was located in /var/www/www.example.com or c:\www\www.example.com the lib folder and urlrewrite.xml would go in /var/www/www.example.com/WEB-INF/ or c:\www\www.example.com\WEB-INF.
Generally for most default installations of Tomcat the WEB-INF folder will only contain the single file web.xml. We will need to edit web.xml using a text editor to enable URLRewrite on Tomcat but because it is an XML text file. It can be machined parsed so I’d recommend editing it using a source code text editor such as NotePad++ on Windows or Textmate on OS/X.
Add the following code to web.xml anywhere contained within the <web-app></web-app> tags.
<!-- URL ReWriter -->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<!-- set the amount of seconds the conf file will be checked for reload
can be a valid integer (0 denotes check every time,
empty/not set denotes no reload check) -->
<init-param>
<param-name>confReloadCheckInterval</param-name>
<param-value>0</param-value>
</init-param>
<!-- you can disable status page if desired
can be: true, false (default true) -->
<init-param>
<param-name>statusEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>logLevel</param-name>
<param-value>DEBUG</param-value>
</init-param>
<init-param>
<param-name>statusEnabledOnHosts</param-name>
<param-value>localhost</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
Let’s quickly go through these settings.
confReloadCheckInterval is a numeric value in seconds that tells how frequently URLRewrite should check your urlrewrite.xml rules for any changes. Normally with Tomcat the modification of an XML configuration file requires a restart before the changes are reflected. You can set this value to -1 to disable automatic checking, while our value of 0 will mean that URLRewrite will check the urlrewrite.xml on every HTTP request. It is a great setting while testing and developing but a resource waste if used on a production server.
statusEnabled is a Boolean value that enables a URLRewrite status page that is reachable via a web browser at http://www.example.com/rewrite-status. It is probably best to disable this feature on production servers.
logLevel sets how much logging should be produced by URLRewrite. While the default setting is INFO, I suggest using DEBUG while you are testing. Through in a production environment you will probably want to use ERROR or FATAL to limit logging as URLRewrite can generate some large log files very quickly with more verbose log settings.
statusEnabledOnHosts allows you set which IP addresses and hosts that have access to the URLRewrite status page previously mentioned.
Finally the <filer-mapping> tag tells what kinds of methods to pass through via URLRewrite. The tags < url-pattern ></ url-pattern> should be left as is to apply URLRewrite to the whole site. While the 2 < dispatcher ></ dispatcher > tags mean that URLRewrite should be used for all HTTP REQUESTS and HTTP internal FORWARDing.
Once done, save your web.xml file and restart your Tomcat server. If all goes well you should be able to point your browser to http://www.example.com/rewrite-status and an UrlRewriteFilter 3.2.0 build 1 configuration overview should be shown. Yes that 3.2 version number is incorrectly listed in 4.0. Point your browser to http://www.example.com/test/status/ and you should be automatically forwarded to /rewrite-status. When this works then congratulations as you now have URLRewrite enabled on your server. Now I will give you some helpful example rules that may come in use. These rules all go in-between the <urlrewrite></urlrewrite> tags located in the urlrewrite.xml file within the WEB-INF folder. Whenever a page is requested on your Tomcat server the URLRewrite application will in a sequential order process ALL the rules contained in the urlrewrite.xml.
Pretty URL, SES Friendly URL Pass-Through
The most common use of URLRewrite would probably be to enable a 3rd party framework or CMS to use pretty URLs. The rule below is a generic setup that could be adapted for many uses. Generally speaking this should always be the LAST rule listed in your urlrewrite.xml rule set. The rule passes all URL requests to the index.cfm file except requests with URLs pointing to files or folders listed in the <condition></condition> tag regular expression value. So with this rule the URL http://www.example.com/list/apples would be displayed as is in the user’s browser but URLRewrite will actually pass http://www.example.com/index.cfm/list/apples to the Tomcat server. You do want to make sure that the page that contained within the <to></to> tag value is also listed in the (not equal) <condition></condition> value otherwise you could run into an infinite loop.
<rule enabled="true">
<name>Generic Pretty URLs Pass-through</name>
<condition type="request-uri" operator="notequal">^/(index.cfm|robots.txt|osd.xml|flex2gateway|cfide|cfformgateway|railo-context|admin-context|files|images|jrunscripts|javascripts|miscellaneous|stylesheets)</condition>
<from>^/(.*)$</from>
<to type="passthrough">/index.cfm/$1</to>
</rule>
Permanent Redirection
This rule is specifically for when you want to do a permanent redirection using the HTTP code 301. If we break this rule down, the <rule enable=”"> Boolean enables you to selectively turn off this rule without the need to comment it out. The <name></name> tags contains the label you wish to use to describe the rule. <from></from> tag contains a regular expression to forward all requests for the documents.cfm page plus any URL parameters. While <to></to> is the new URL to redirect to. The attribute type tells URLRewrite to send a permanent direct code to the browser requesting the URL, while the attribute last = true tells URLRewrite not to process any further rules for this page request.
<rule enabled="true">
<name>Permanent redirect example</name>
<from>^/documents.html(.*)$</from>
<to type="permanent-redirect" last="true">/file/list/document</to>
</rule>
Selective HTTPS Enforcement
If you have HTTPS setup on your server you can use URLRewrite to enforce certain folders, URL paths or files to only be served on an encrypted HTTPS protocol. The <condition></condition> tag is used to enforce additional policies as to when the rule should be implemented. The attribute type with a value of scheme and the attribute operator with a value of equal states that when the URL scheme (http, https, ftp, etc) is equal to HTTP then apply this rule.
<rule enabled="false">
<name>Force HTTPS example</name>
<note>Automatically redirects adminstration requests to a secure protocol.</note>
<condition type="scheme" operator="equal">^http$</condition>
<from>^/CFIDE/administrator/(.*)$</from>
<to type="permanent-redirect" last="true">https://www.example.com/CFIDE/administrator/$1</to>
</rule>
Railo HTTPS Enforcement railo-content.
<rule enabled="false">
<name>Force HTTPS example</name>
<note>Automatically redirects adminstration requests to a secure protocol.</note>
<condition type="scheme" operator="equal">^http$</condition>
<from>^/railo-context/admin/(index|web|server).cfm$</from>
<to type="permanent-redirect" last="true">https://www.example.com/railo-context/admin/$1.cfm</to>
</rule>
Conditions Based On URL Parameters
You can also apply conditions to user supplied URL parameters. In the example below the condition looks for the URL parameter named fruit and sees if its value is either kiwi, apple or orange. If the values match then it redirects to a replacement URL which also incorporates the parameter. The URL request http://www.example.com/list.html?fruit=apple would forward to http://www.example.com/list/fruit/apple.
<rule enabled="true">
<name>Selective fruit example redirect</name>
<condition type="parameter" name="fruit" operator="equal">(apple|kiwi|orange)</condition>
<from>^/list.html(.*)$</from>
<to type="permanent-redirect" last="true">list/fruit/%{parameter:fruit}</to>
</rule>
Embed a Railo ColdFusion/CFML Server within your CFEclipse/Eclipse application with no need for XML configurations.
Posted by Ben in CFML/ColdFusion, Eclipse, Railo on October 7, 2011
This entry will walk you through step by step to enable you from within Eclipse to start and shutdown a custom install of the open source CFML engine Railo running off Apache Tomcat. Most importantly though you will be able to implement this without the need of touching any fickle XML Tomcat configuration files.
This article was written in mind with the CFEclipse add-on running off Eclipse Helios. I have not tested these steps with Adobe’s proprietary CFBuilder.
Eclipse: http://www.eclipse.org/downloads/compare.php
CFEclipse: http://cfeclipse.org
Let’s start.
Visit Apache Tomcat and download your appropriate edition under the Core section. Windows users should download either the 32-bit or 64-bit Windows zip but not the Service Installer.
Tomcat 7: http://tomcat.apache.org/download-70.cgi
Tomcat 6: http://tomcat.apache.org/download-60.cgi
Extract the downloaded zip containing Apache and then move the created apache-tomcat-7.*.* directory to a location of your choice. In this example I will move it to my server collection under W:\Dev\Server\.
Go to the Railo download page and fetch the latest Current stable release Railo Custom WAR Archive under the ALL OS.
Railo: http://www.getrailo.org/index.cfm/download
Using 7-Zip or some other WAR compatible archive tool extract the downloaded Railo-3.*.* WAR archive.
7-Zip: http://www.7-zip.org
Now create a working resource directory for your CFEclipse project. I will use W:\Railo\Test\.
Copy the content of the extracted WAR archive to your project resource directory.
Start Eclipse.
From the pull-down menu select Window > Preferences then Server > Runtime Environment and select Add.
In the New Server Runtime Environment dialog select your appropriate Apache Tomcat version and select Next >. If you cannot see an Apache folder containing various Tomcat versions you will need to click the Download additional server adapters link and follow the Install New Extension wizard.
Give your Tomcat Server a name and point it to your Tomcat installation directory.
Click the Installed JREs… button and in the Installed JREs dialog select Add. In the Add JRE wizard select Add and point the JRE home: input to your local Java Runtime Environment location. This is often either C:\Program Files\Java\jre6 or C:\Program Files (x86)\Java\jre6. If you downloaded the 64-bit edition of Tomcat you will need to point to the 64-bit Java RE that is installed on your machine. Once done select the Finish button and then the OK button in the Installed JREs dialog.
Java Runtime Environment: http://java.com/en/download/manual.jsp
Now make sure the New Server Runtime Environment has your installed JRE selected and not the Workbench default JRE and press Finish. Press OK in the Server Runtime Environments dialog.
Now we need to bring up the Eclipse Servers view. From the Eclipse pull-down menu select Window > Show View > Other > Server > Servers and press OK. The Servers tab should now be selected, right click on the Servers pane and select New > Server.
In the Define a New Server dialog select your Apache Tomcat server type. Give the server a Server name, keep the host name as localhost, make sure the Server runtime environment is correct and select Finish.
You should have a new entry in your Servers tab. Double left-click it to bring up the server’s Overview tab.
Under Server Locations select the Use Tomcat installation option. The Deploy path should be set to webapps and then save the changes using Ctrl-S.
Now select the Modules tab in the Overview and press the Add External Web Module… button. Point the document base to your Railo working resource directory in my case it is W:\Railo\Test\ but keep the path as / and press OK. Save the updated Web Modules using Ctrl-S.
Back to the Servers tab select your server, right click and select Start. Eclipse should automatically switch tabs to the Console as the server starts before reverting you back to the Servers. The server should have a revised status saying Started, Synchronized.
Point your web browser to http://localhost:8080/and you should have the Railo Welcome page. To shut down your server select it under the Eclipse Servers tab, right-click and select Stop. Congratulations you have a working embedded Tomcat Railo server operating within Eclipse.
Next we will create a CFEclipse project and a simple Hello World application otherwise you can end the tutorial here.
In Eclipse pull-down Window and select Show View > Project Explorer.
Right click on the Project Explorer pane and select New > Project to bring up the New Project wizard. Open the CFEclipse folder and selected CFML Project and press Next.
Give your CFEclipse Project a Project name and then deselect the Use default location checkbox. Select the location of your working resource directory where you placed your Railo installation. For me it was W:\Railo\Test\ and then Finish.
Open your newly created project from the Project Explorer, right-click and select New > File. Create a new file named hello.cfm in your project and Finish. Edit the hello.cfm and add the following mark-up and save using Ctrl-S.
<cfdump var=”Hello world!”>
In the Servers tab start your server. Once it has loaded select from the Eclipse pull-down menu Window and then Show View > Browser View. Under the Project browser tab enter the URL http://localhost:8080/hello.cfm and you should see a dump of text Hello world!.
Now you are ready to develop, test and troubleshoot your ColdFusion Mark-up all contained within the Eclipse environment.
Cygwin Walkthrough and Beginners Guide – Is it Linux for Windows or a POSIX Compatible Alternative To PowerShell?
Linux in Windows?
Cygwin is an awesome tool for agnostic operating system users who regularly use both Windows and Linux but want the power of a Linux shell and its tools running within Windows. It is a great replacement to the primitive Windows command prompt without the need to learn a new collection of commands or a new scripting language. A requirement which is needed for the Microsoft developed and recommended command prompt alternative PowerShell.
Cygwin is POSIX (Portable Operating System Interface for uniX) complaint which basically means it shares a common API with all the other complaint operating systems. It does not mean applications compiled for other POSIX systems such as Linux software will automatically work within Cygwin. To add new POSIX software you still need to compile the software source code under Cygwin using its own compilers and libraries. This process is a requirement with most POSIX complaint operating systems e.g. software complied for FreeBDS (Unix) will not work under Debian/Ubuntu (Linux).
Cygwin will work on any x86 32-bit or x86-64 editions of Windows NT from NT 4.0 Service Pack 4 (1998) onwards to Windows 7 including 2000, 2003, 2008, XP and Vista. There is no support for the Windows 16/32-bit hybrids such as 95, 98 or ME.
Installation
So lets get started. Visit http://cygwin.com/install.html, download then run the setup.exe. This file is a Windows based package manager for Cygwin. By default it will download and install the latest minimal install of Cygwin but on future launches it will also enable you to add new packages and update your existing Cygwin software. So after you install Cygwin do not delete or loose the location of setup.exe!
By default Cygwin will install to C:\cygwin but you can change this to any directory of your choosing. It is highly recommended that you do not choose a directory path which contains spaces in the name, so both C:\Program Files\cygwin or C:\Program Files (x86)\cygwin are out.
Cygwin setup will save all downloaded packages to this folder after it has finished installation. You can then either delete them, leave them in this directory or back them up to a USB stick for future use on this or other computers.
Unless otherwise needed you should leave the Internet connected selection with the default selection of Direct Connection.
Choose A Download Site lets you select a file repository from where Cygwin setup will download the the packages and files. It is preferable to pick a download location from a site this is geographically close to your own. But if you can not determine this from the country codes in the URL or can not find a suitable mirror then simply select the first item.
Selecting Packages
This Select Packages screen is the most important part to Cygwin setup. It is the Cygwin package manager interface, equivalent to Synaptic Package Manager in Debian and Ubuntu or YUM Extender in Fedora Linux. The screen capture has a number of arrows pointing to features of the interface but as a first time user you can completely ignore all of these and press Next to accept the default installation.
- The dark green solid arrow points to the search dialog enabling you to quickly filer packages by name. Unfortunately the search does not work on the package descriptions.
- The solid black arrow has 4 radio buttons enabling you to mass-apply installation restrictions on all packages.
- Keep tells Cygwin setup not to update any installed packages.
- Prev is short for previous which reverts all packages back one version.
- Curr is the default and recommended option as it installs the current version of all selected packages.
- Exp will install the most current or experimental version of all selected packages.
- The red arrows point to the manager categories which can be expanded to reveal individual packages.
- The purple arrow points to version numbers which belong to packages that are already installed onto Cygwin.
- Orange arrow enables you to manually override the global package version (black arrow radio buttons).
- Skip means the package has not been installed and setup will ignore it.
- Keep means the package has been installed but setup will ignore it.
- Reinstall will overwrite an existing package installation with the same version from a fresh download.
- 1.0-1 or some other version number means setup will install this version of the package for the first time.
- Source means setup will ignore the installed package but will download the source codes.
- Uninstall removes the installed package from your Cygwin installation.
- The yellow arrow points to a Binary check-box while the light green points to a Source check-box. These check-boxes only appear only when available to the package New column.
- The light blue arrow is the package download size in Kilobytes.
- Dark blue contains the package name and a brief description.
Cygwin setup will now download and install all the default-install packages. Wait until the Progress screen is complete and go onto the Next screen.
Create Icons enable you to add Desktop and Start Menu shortcuts. Once finished use either shortcut to launch Cygwin.
Bash Terminal
Welcome to your Bash prompt in Windows! You can test this by running Bash version.
bash --version
The first thing I’d recommend doing is customising your bash shell to implement some aliases for basic colouring for some staple Cygwin commands.
dir -A ~
Will reveal some hidden setting files in your home directory which you can edit these using a text editor, but please avoid using the standard Windows Notepad. I use Windows Notepad++ and would edit w:\cygwin\home\Ben\.bashrc but you would probably need to edit c:\cygwin\home\[User name]\.bashrc. Windows may have issues opening a file which it sees as only having an extension but lacking a file name. If this is the case just use the Open With dialog but make sure you have the Always use the selected program to open this kind of file check-box left unchecked.
Once you have finished your changes you can apply them by reloading Bash.
bash --login
Test your new alias and option defaults.
cd / ll
You now see a colourised directory and file listing of the Cygwin root.
This is the same directory as you chose during the Cygwin setup installation which by default is c:\cygwin. You can use either Windows File Explorer, Windows command prompt or Cygwin to modify the contents of the root. For more details on how Cygwin handles POSIX permissions within Windows and other potential incompatibilities I’d recommend reading the Using Windows Security in Cygwin chapter in the manual.
Tips
By default there is no Cygwin clear command (cls in command prompt) but the easiest way to clean your terminal is to press Ctrl l.
Use the Tab key on your keyboard to auto-complete commands, file and directory names. This Bash feature is superior to the basic Tab auto-complete used by Windows command prompt.
Did you also know you can chain 2 or more commands together using a semi-column ; character as the separator.
cd /; echo "Root Directory"; ls; cd ~; echo "My Home Directory"; ls
And if you didn’t realise in the command above, change directory forward-slash cd / takes you to the Cygwin root, while change directory tilde cd ~ takes you to your user home directory.
Drill Down of the Cygwin Root
- Cygwin.bat is the Windows batch file used to launch a Cygwin Bash prompt within a Windows command prompt.
- Cygwin.ico is a standard Windows icon file attached to the Cygwin batch file.
- bin/ is a directory containing binary (execute) applications that have been compiled for use on Windows under Cygwin. In here are all the unique POSIX-like commands and applications that give you all that extra functionality that a bare-Windows install often lacks.
- cygdrive/ contains a list of mounted Windows drive letters. From here you can access any drive partition that is viewable to Windows. For example cygdrive/c/Windows/ would be the location of most peoples Windows installation.
- dev/ is short for devices. Traditionally for POSIX this is where your detected hardware devices are listed but in Cygwin its usage is mainly there for software compatibility and can be ignored. http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices
- etc/ contains all your Cygwin related configuration files. Unlike the Windows registry these should all be plain text files that can be edited within any Windows text editor (such as NotePad++) or a Cygwin editor such as VM or Nano.
- home/ contains the user directories which are not unlike the Windows User directories. This is where your non-Cygwin files such as documents, file downloads should be stored.
- lib/ is an abbreviation of library. These are compiled, shared components that are used by various Cygwin commands and applications but you can ignore this directory.
- proc/ is a virtual directory that allows you to display various aspects of your system using the cat command.
- cat /proc/cpuinfo Displays your computer CPU details.
- cat /proc/meminfo Displays your Windows memory information.
- cat /proc/mounts Lists your disk mounts within Cygwin.
- tmp/ is the Cygwin temporary directory.
- usr/ is the bread and butter of your Cygwin install.
- usr/bin/ is identical to bin/ that was listed previously.
- usr/include/ are programming header files which are somewhat like shared libraries, you can ignore this.
- usr/local/ is a location where you can compile applications for yourself, again if this does not interest you it can be ignored.
- usr/sbin/ contains system binaries and applications tools for Cygwin system administration.
- usr/share/ are platform independent read-only shared files such as documentation. For example /usr/share/fonts contain a collection of system fonts. /usr/share/doc contains application documents.
- usr/src/ is a location for storing application source code.
- usr/ssl/ is a location for storing SSL (Secure Socket Layer) and TLS (Transport Layer Security) certificates which are used for Internet communication encryption and security.
- usr/tmp/ is the same temporary folder as /tmp.
- var/ is where variable data files are stored. These are files generated by yourself or applications. For example all log files would go in /var/log. If you ran an Apache HTTP daemon the files it hosted would be contained in /var/www.
POSIX and Cygwin Commands
Now the usage of a Bash shell or POSIX-like commands is out of the scope of this article. You can run dir /bin to see all the .exe execute commands available to you within Cygwin. Like Windows command prompt you do not need to include the file extension when running an application, dir works the same as dir.exe.
If you need quick help on the usage of a command, use [command] –help e.g. dir –help. Many commands share the same options.
If you think the default Cygwin bash shell is a bit ugly then you are not alone. Microsoft does not give the default command prompt much love and unfortunately this is what Cygwin relies on for its own terminal interface. You can easily change this though by again running Cygwin setup.exe. When you are back in the Select Packages screen do a search for mintty. Select to install the mintty binary package and once complete go to your Cygwin start menu. There should be a new mintty option in addition to the Cygwin Bash Shell.
Services and Daemons
Want to to implement a service or daemon into your Cygwin install? I will show an basic example using Lighttpd, a light-weight HTTP server that is an alternative to Apache2 HTTP (which also can be installed to Cygwin).
Run Cygwin setup.exe again to search and install lighttpd and make sure you say yes to install any resolving dependencies. Once installed you will find the application residing in the usr/sbin/ directory as lighttpd.exe. An example configuration file lighttpd.conf.default can be found in etc/lighttpd/. We will create an empty configuration file using the touch command.
cd /etc/lighttpd touch lighttpd.conf
Now use your Windows notepad application to edit c:/cygwin/etc/lighttpd/lighttpd.conf and copy the settings listed below.
server.document-root = “/var/www/servers/www.example.org/pages/”
server.port = 80
server.username = “www”
server.groupname = “www”mimetype.assign = (
“.html” => “text/html”,
“.txt” => “text/plain”,
“.jpg” => “image/jpeg”,
“.png” => “image/png”
)static-file.exclude-extensions = ( “.fcgi”, “.php”, “.rb”, “~”, “.inc” )
index-file.names = ( “index.html” )$HTTP["host"] == “www2.example.org” {
server.document-root = “/var/www/servers/www2.example.org/pages/”
}
This config we are using is taken from the Lighttpd Configuration Tutorial.
Now attempt to launch lighttpd with your new configuration file.
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
Our attempt will fail because the web server document root directory does not exist, so lets create that and lets also make an index.html document and try it again.
mkdir /var/www ; mkdir /var/www/servers ; mkdir /var/www/servers/www.example.org ; mkdir /var/www/servers/www.example.org/pages touch /var/www/servers/www.example.org/pages/index.html
In a Windows notpad application edit c:/cgywin/var/www/servers/www.example.org/pages/index.html and copy/paste the following HTML code.
<html>
<title>Hello World</title>
<body>
<h1>Hello from Lighttpd running in Cygwin!<h1>
</body>
</html>
Lets retry running Lighttpd again.
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
Once Lighttpd has loaded you may need to press the Enter key to restore your Bash prompt but Lighttpd will continue to run in the background. Now point your local Windows web browser to 127.0.0.1 or localhost.
When you want to shutdown Lighttpd run find the PID (Process IDentifier) and kill it.
ps -s kill [PID number]
Congratulations! You have successfully implemented a Bash shell environment on your Windows operating system that also has a robust but simple HTTP server.
Popular Cygwin Applications
Other popular Cygwin packages that maybe of interest.
Servers services such as Apache, BIND, PostgreSQL, Pure-FTPd, OpenSSH.
Programming languages such as C, C++, Perl, Python, Ruby, TCL.
Remote log-in tools SSH, RSH, Telnet.
File transfer tools FTP, SCP, rsync, unison, rtorrent.
In addition to an extensive range of network, system and file diagnostics tools.
More information on Cygwin can be found in its User’s Guide.












































