When trying to install the latest version of Apache on my development machine, I was presented with the following error at the end of the installation:

Only one usage of each socket address (protocol/network address/port) is normally pemitted. 
make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to openlogs
Note the errors or messages above, and press the < ESC > key to exit.

Initially I thought it was a problem associated with Windows Vista (yes my development machine is a Vista PC!) and the previously installed IIS. However, after a lot of deliberating and Google searches, it appears that Skype was the culprit. Skype listens on port 80 and 443 for incoming requests. So to solve the problem I simply closed down Skype and re-installed Apache. As Apache was setup as a Windows service, no conflicts subsequently arise with Skype as Apache will start using the ports before Skype.

There is a setting in Skype under Tools > Options > Advanced > Connection called “Use port 80 and 443 as alternatives for incoming connections”. This is checked by default. Uncheck this to prevent conflicts with Apache.

Skype Advanced Connection Options

The Key Point: Stop Skype before installing Apache.

Pre-requisites:

  1. Follow my instructions on installing Apache on Windows Vista
  2. And then follow my instructions on installing PHP on Windows Vista

Installing PHP with Apache on Windows Vista is a relatively simple task until you try an configure the settings in php.ini. Problems can occur and stem from the fact that when you install PHP and edit the php.ini file, you need to not only be logged in as Administrator, but run the installer and Notepad text editor as Administrator. The php.ini file also needs to be located in the Windows directory.

Below is an outline of the steps to get your PHP installation running and configured correctly.

  1. Run Notepad as Administrator. Go to All Programs > Accessories Right-click “Notepad” and select “Run as Administrator”. Open the php.ini file, in my case:
    C:\PHP5\php.ini
  2. Edit the php.ini file as necessary, e.g.:
    extension_dir = "C:\PHP5\ext"
    upload_max_filesize = 16M
    upload_tmp_dir = "C:\PHP5\upload"
    session.save_path = "C:\PHP5\session"
  3. Enable the extensions you need by deleting the semi-colon at the beginning of the line. For example, you will commonly need the following MySQL extensions:
    extension = php_mysql.dll
    extension = php_mysqli.dll
  4. Save the edited php.ini file into your Windows directory. This is very important as Vista will not read the changes but will refer to the default settings.
  5. Check that the PHP directory has been added to your computers “Environment Variables”. Click Start, right-click on Computer, select Properties > Advanced > Environment Variables. Click on PATH and select Edit. If the PHP path is there, in my case “C:\PHP5\”, all is well, otherwise add the PHP path.
    • System Properties:

      Vista System Properties

    • Environmental Variables

      Vista Environment Variables

    • Edit Environmental Variable - PATH

      Vista Edit Environmental Variable PATH

  6. Open your Apache configuration file (httpd.conf). Ensure the following lines are present (at the bottom of the file):
    LoadModule php5_module "C:\PHP5\php5apache2_2.dll"
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir "C:\Windows"

    If there are additional LoadModule lines, remove them, leaving only the one that relates to your version of Apache.

  7. Find the DirectoryIndex in the Apache config and append index.php, e.g.:
    <ifmodule dir_module>
    	DirectoryIndex index.html index.php
    </ifmodule>
  8. Restart the Apache service.
  9. Create a index.php file in your webroot and add the following lines:
    < ?php phpinfo(); ?>
  10. Navigate to the file (e.g. http://localhost/index.php) and you will be presented with all the PHP and server settings. You’re now good to go.

  1. Download the current version of PHP from http://www.php.net/downloads.php. Get the Windows installer (in my case version 5.2.5).
  2. Uninstall any previous versions of PHP. Delete any extraneous remaining directories.
  3. Disable antivirus and firewall software.
  4. Disable Windows Defender.
  5. Disable User Account Control (UAC).
  6. Use the command prompt to manually run the PHP installer. Go to All Programs > Accessories Right-click “Command Prompt” and select “Run as Administrator”.

    Browse to the location of the PHP install file e.g.:

    C:\Users\Simon\Desktop\
  7. In the command prompt type:

    C:\Users\Simon\Desktop\msiexec /i php-5.2.5-win32-installer.msi

    And hit the [Enter] button.

  8. The installer should start and you should see the screenshot below. Click “Next”.

    PHP Install - Step 1

  9. Read and accept the terms of the license agreement and click “Next”.

    PHP Install - Step 2

  10. Choose your install folder and click “Next”.

    PHP Install - Step 3

  11. Choose the web server you wish to setup. In my case I will be using Apache 2.2.x. Click “Next”.

    PHP Install - Step 4

  12. Browse to the Apache Configuration Directory. In my case this is:

    C:\Program Files\Apache Software Foundation\Apache2.2\conf\

    Click “Next”.

    PHP Install - Step 5

  13. Choose the items to install. In my case I have chosen to install all items. Click “Next”.

    PHP Install - Step 6

  14. PHP is now ready to install.

    PHP Install - Step 7

  15. The installation is now complete. The next task is to configure PHP.

    PHP Install - Step 8

After installing ColdFusion 8 and Apache successfully you may still see an “HTTP 500 Internal Server Error” when navigating to a ColdFusion page. All is not lost, you simply need to configure, or check the configuration of Apache.

Apache requires very little post installation modification, but it is always good practice to check the httpd.conf file to ensure that the ColdFusion “install” scripts did what they were supposed to do.

If you haven’t confirmed that Apache is running, open your browser and point it to http://localhost/ (unless you specified a real URL during installation). You should see the Apache test page. If you see an error, review the Apache installation steps to make sure you followed all the steps correctly, and/or check your log files for more detailed errors.

Now we know Apache is running, but how about ColdFusion? Point your browser to the ColdFusion Administrator found commonly at http://localhost/CFIDE/administrator/index.cfm and see what happens. One of three possible failures could occur:

  1. Your browser prompts you to save the .cfm file to your computer. There a couple of possible resolutions to this. Firstly restart the Apache service. If this does not resolve the issue you will need to check the httpd.conf file to ensure that the ColdFusion module is being loaded. The file can typically be found in the C:\Program Files\Apache Software Foundation\Apache2.2\conf\ directory.
    Make sure that the DirectoryIndex has a reference to the index.cfm file (i.e. the default file):Apache dir_module DeclarationEnsure that the LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so" is also present:

    Apache JRun Settings

    If you need to edit this file, restart the Apache service after you have saved the changes.

  2. You get a message that the CFIDE folder cannot be found. This is more likely to be a problem with where you placed the ColdFusion application during install. The default location is in the Apache directory (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs), so check in the http.conf file to ensure the DocumentRoot is pointing correctly. Alternatively, copy this folder to your localhost webroot (e.g. C:\WebRoot) ensuring that the DocumentRoot points to your webroot (see the yellow box in the second screen-shot).
  3. You get another message which probably means that you need to reinstall ColdFusion, and/or Apache!

And that is it, you can start using ColdFusion and developing applications.

A few months ago I posted an article on Installing Apache on Vista, and it proved to be extremely popular. It appears that I was not the only one who found it a non trivial matter.

Now it is the turn of ColdFusion 8. ColdFusion 8 as we well know is the latest and greatest incarnation of the ColdFusion platform from Adobe. It has a lot of great new features such as cfimage, cfzip, cfexchange, some contentious features such as cfthread and cfinterface, and some not-so-necessarily-cool new “Web 2.0″ features such as cffeed and cfajax. But since this article isn’t about any of these, I better stick to the topic.

Like my article on installing Apache, installing ColdFusion on Vista is again not a trivial matter and involves only what can colloquially described as a “shed load of steps”. I’m probably being a little harsh towards ColdFusion as many of the problems I encountered were more closely related to Apache than ColdFusion.

NB: This article will assume that you have pre-installed Apache (although you could use IIS if so compelled), turned off Vista’s User Account Control (UAC), disabled any firewalls you have installed and finally, but most importantly, you have downloaded ColdFusion from the Adobe website.

Let us begin.

  1. Find where you downloaded your copy of the ColdFusion Installer. Right-click on the executable file and specify to “Run as Administrator”. The installer should start and you should see the screenshot below. Select “English”, or which ever your language preference is, and Click “OK”.

    1. ColdFusion Installer

  2. The ColdFusion Installation progress screen may or may not be briefly displayed.

    2. ColdFusion Installation Progress

  3. The Introduction screen will be displayed. Click “Next”.

    3. Introduction Screen

  4. The License Agreement screen will then be displayed. Agree to the “I accept the terms of the License Agreement” and Click “Next”.

    4. License Agreement

  5. The Install Type screen is then displayed. You don’t need to enter a serial number unless you are installing this into a production environment. Check “Developer Edition” and Click “Next”.

    5. Install Type

  6. The Installer Configuration screen should be displayed. Since we already have Apache 2.x installed as our web server (if you want to use IIS, you will need to skip steps 11.1 and 11.2), check “Server configuration” and Click “Next”.

    6. Installer Configuration

  7. The Sub-component Installation screen should be displayed. This is one of the noticeable changes from version 7 to version 8 of ColdFusion. Hovering your mouse over each sub-component will describe in more detail what each sub-component does. If you plan to integrate .NET (especially with WebServices) or carry out Flex development then make sure that the “.NET Integration Services” and “LiveCycle Data Services” items are checked. For simplicities sake, check everything and Click “Next”.

    7. Sub-component Installation

  8. The Select Installation Directory screen should be displayed. The default directory for a Serverconfiguration will be “C:\ColdFusion8″ on a Windows machine. Click “Next” to continue.

    8. Select Installation Directory

  9. As you have chosen to install LiveCycle Data Services, you will need to agree to a further Licence Agreement screen. Click “Next”.

    9. Licence Agreement (LiveCycle Data Services)

  10. The Adobe Livecycle Data Services ES Installation screen is displayed. You will need to enter a serial number into this screen for production environments. Since I am going to assume a development environment, simply click “Next”.

    10. Adobe Livecycle Data Services ES Installation

  11. The Configure Web Servers / Websites screen should be displayed. This is the point where we want to connect ColdFusion with Apache. By default “Configure web server connector for ColdFusion” is checked. We need to add Apache so Click “Add”.

    11. Configure Web Servers / Websites

    1. The Add Web Server Configuration screen is displayed, choose Apache from the drop-down.
    2. Add the relevant Apache directory paths, e.g.:

      11-2. Add Web Server Configuration (Directory Paths)

      1. The Configuration Directory C:\Program Files\Apache Software Foundation\Apache2.2\conf
      2. The Server Binary Directory C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe
  12. The Review Configured Web Server screen is then displayed. If all the settings are correct, click “Next”.

    12. Review Configured Web Server

  13. The Choose Adobe ColdFusion 8 Administrator Location screen should be displayed. Since we are using Apache for our web server then the default Directory should be pointing to C:\Program Files\Apache Software Foundation\Apache2.2\htdocs. You can alternatively point this to C:\WebRoot or wherever you have set up your web project files. Select “Next”.

    13. Choose Adobe ColdFusion 8 Administrator Location

  14. The Adminstrator Password screen is then displayed, prompting for a password. Enter one, remember it (!!) and click “Next”.

    14. Adminstrator Password

  15. The Enable RDS & Password screen is then displayed. If you want to use this, check the box and provide an additional password. Don’t use RDS in a production environment. Click “Next”.

    15. Enable RDS & Password

  16. The Pre-Installation Summary screen is then displayed, detailing your configuration. This is your last chance to go back and make changes. If everything is OK, click “Install”.

    16. Pre-Installation Summary

  17. The Installing Adobe ColdFusion 8 screen is then displayed, showing a host of marketing messages.

    17. Installing Adobe ColdFusion 8

  18. The Please Wait screen is displayed, and be prepared to wait!

    18. Please Wait

  19. The Installation Complete screen is finally displayed and indeed the installation is complete. Now for the configuration! Click “Done”.

    19. Installation Complete

  20. Configuration and Settings Migration Wizard. Open up a browser and enter the url http://localhost/CFIDE/administrator/index.cfm to begin the ColdFusion 8 Configuration and Settings Migration Wizard. Enter your password and Click “Login”.

    20. Configuration and Settings Migration Wizard

  21. ColdFusion will now begin Configuring Server, which could take any number of minutes to complete.

    21. Configuring Server

  22. Once the Configuration Complete is displayed, you can login to the ColdFusion Administrator and start working, or playing, with the new interface, settings and Server Monitor.

    22. Configuration Complete

So, that only 22 steps! That may be the longest installation process you may go through, but the power now at your finger tips to produce hugely interactive websites is a compelling reason why to choose this version of ColdFusion, or indeed ColdFusion over other products.

Apache is controlled by a series of configuration files but the one we will be dealing with here is httpd.conf. This file contains instructions on how Apache should run. Several companies offer GUI-based Apache front-ends, but it’s easier to edit the configuration files by hand.

Remember to make back-up copies of all your Apache configuration files, in case one of the changes you make while experimenting renders the Web server inoperable.

Also, remember that configuration changes you make don’t take effect until you restart Apache.

Configure the httpd.conf File:

The httpd.conf file can be found in the conf directory in your Apache installation. In my case, this is the following location:

C:\Program Files\Apache Software Foundation\Apache2.2\conf

1. To include the correct default or index file, you need to find the following code and make sure that your default file name is included (see screenshot).

<IfModule>
DirectoryIndex index.htm index.html
</IfModule>

Apache httpd.conf DirectoryIndex Configuration

For ColdFusion and PHP you would also need to include their equivalents, i.e. index.cfm and index.php.

2. Set up a virtual host definition:

<virtualhost>
DocumentRoot c:\WebRoot
ServerName localhost
<directory>
Order allow,deny
Allow from all
</directory>
</virtualhost>

Make sure that the directory permissions are set otherwise a directory forbidden message (such as below) will be displayed.

Unsuccessful Apache Configuration

3. Restart the Apache service. You should then be able to browse to your local website.

Successful Apache Configuration

4. If you’re doing something cunning like setting up an alias for the local site, e.g. http://whatley.local/ rather than the usual http://localhost/whatley/ then you may need to edit your hosts file e.g.:

Hosts File Configuration

In my case, the hosts file is found in the following location: C:\Windows\System32\drivers\etc. You can simply edit this file in notepad, much like with httpd.conf.

And that is all there is to it.

Following the purchase of a spangly new Toshiba laptop running Vista, and not one for making life simple, I decided not to run my development environment on IIS7, but rather, I wanted to install the latest version of Apache.

Installing Apache under Windows XP was relatively trivial. This is not the case under Windows Vista. The creation of the Apache service fails, but not overtly. Furthermore, the all-important conf directory can™t be set up by the installer, probably due to user permission problems.

I finally got it working with the following procedure. I used the latest version of Apache (2.2.4) and Windows Vista Business Edition.

  1. Uninstall any previous installations of Apache Web server (Start > Control Panel > Programs and Features).
    Make sure that all old Apache folders are also removed (e.g. like C:\Program Files\Apache Software Foundation\…).
  2. Turn off your firewall via the Control Panel.
  3. Stop User Account Control (UAC).
  4. Get the most recent version of Apache from http://httpd.apache.org/ and put it on your desktop, or folder of your choosing. The file I used was called apache_2.2.4-win32-x86-no_ssl.msi, but for ease, it is a good idea to rename the install file to apache.msi.
  5. Start > All Programs > Accessories Right-Click Command Prompt and choose œRun as Administrator.
  6. Via the command prompt, navigate to the folder in which the apache.msi install file is located.
  7. Type msiexec /i apache.msi on the command prompt.

    Apache Install Command Prompt

  8. Run through the Apache installer.

    Apache Install Step 1

    Apache Install Step 2

    Apache Install Step 3

    Apache Install Step 4

    Apache Install Step 5

    Apache Install Step 6

    Apache Install Step 7

    Apache Install Step 8

    Apache Install Step 9

  9. I™m running it as a development server, so I left the domain as “localhost”.
  10. Choose the default server on port 80 for all users option.
  11. The default installation directory is C:\Program Files\Apache Software Foundation\Apache2.2\, but again for ease, you could change the installation directory to C:\Apache.
  12. Reboot your computer.
  13. The little Apache feather icon won™t appear on the task bar under Vista with the present version of Apache (2.2.4). To remove the œerror box that says blank or “the operation completed successfully on startup, go to All Programs > Startup, and remove the “Monitor Apache Servers” item there.
  14. Browse to http://localhost. It should say “It works!” If it doesn’t, panick, or check your httpd.conf file by going to All Programs > Apache HTTP Server 2.2.x > Configure Apache Server > Test Configuration. Follow the directions for fixing the configuration file.
  15. Turn your firewall back on.
  16. Turn UAC back on too, if you like to be constantly bugged by control messages!

Good luck!

One of the many reasons to use ColdFusion MX is that it has a large, standard toolset that enables the creation of full-featured, dynamic Web applications. The tag-based language makes it relatively simple to query a relational database and send e-mail. In a similar way, you can create and search Verity full-text indexes.

However, there are situations where you cannot use the full-text searching capabilities of Verity. For example, Verity only runs on Windows, Linux and Solaris, therefore the ability to run ColdFusion MX on the Apple OS X operating system, whilst advantageuos to developers who code on the Apple platform, does not include the ability to use Verity. Furthermore, programmers who work in a hybrid J2EE/ColdFusion MX environment cannot natively use the Verity search capabilities in the J2EE environment. Finally, programmers who need customized searching and indexing capabilities may find the standard Verity integration limiting. There are work-arounds include installing Verity on a Windows, Linux, or Solaris server and configuring your ColdFusion server to use the remote Verity server, however these may not only be impractical, but cost-prohibitative.

Enter Lucene, an open source full-text searching framework from the Apache Jakarta project, which, when combined with ColdFusion MX, can be run on Apple OS X, can be programmatically accessed by both J2EE and ColdFusion MX developers, and can be fully customized and extended.Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.

Apache Lucene is an open source project available for free download.

Features

  • Lucene offers powerful features through a simple API.

Scalable, High-Performance Indexing

  • Over 20MB/minute on Pentium M 1.5GHz
  • Small RAM requirements — only 1MB heap
  • Incremental indexing as fast as batch indexing
  • Index size roughly 20-30% the size of text indexed

Powerful, Accurate and Efficient Search Algorithms

  • Ranked searching — best results returned first
  • Many powerful query types: phrase queries, wildcard queries, proximity queries, range queries and more
  • Fielded searching (e.g., title, author, contents)
  • Date-range searching
  • Sorting by any field
  • Multiple-index searching with merged results
  • Allows simultaneous update and searching

ColdFusion & Lucene Implementations

If you don’t fancy attempting the task of writing your own ColdFusion implementation of Lucene, below are a couple of projects that will give you a kick-start along the road to indexing database content. With the addition of other Java projects such as PDFBox the textual content of a pdf can also be extracted and indexed.

Aaron Johnson

Inspired by Lindex, Aaron Johnson has created a CFX Tag called CFX_Lucene that closely mimics the ColdFusion cfsearch tag, but uses Lucene rather than Verity.

http://cephas.net/blog/lucene/index.html

CFLucene

CFLucene is an open source project that attempts to provide developers an easy way to integrate the indexing and searching functions of the Apache Lucene Java library with a ColdFusion web application. The CFLucene is a collection of ColdFusion Components that natively call the Lucene Java classes to index and search any sort of textual data.

http://www.cflucene.org/