VerySimple Developer Blog
Technical Tips, Tricks and Rants.

Archive for the ‘IIS’ Category

 
Mar
30
Filed Under (Apache, IIS, PHP) by Jason on 30-03-2006

Installing PHP to run on Windows through IIS is pretty simple because there is an installation wizard that does everything for you. But, those of us who also have Apache running for development need to have Apache process PHP pages too. This is a walkthrough to get both running.

This will run PHP in CGI mode for both IIS and Apache.

1. Download from www.php.net the Windows Installer version of PHP AND the Windows “manual install” .zip distribution. (If you already have PHP running for IIS, then you only need the zip version)

2. Run the PHP installer. Install it to its default location of C:\PHP. PHP should now be working with IIS.

3. Move the file C:\PHP\php.ini-dist to C:\Windows\php.ini

3. Unzip the “manual install” distribution. You’ll notice that it has much of the same files as are already in C:\PHP. Move all the of extra directories contained in this .zip to C:\PHP

4. Download and install Apache HTTP server from www.apache.org. (I used version 2). Default install location is C:\Program Files\Apache Group\Apache2. The configuration you use is up to you, but i specify in the install wizard to run Apache manually on port 8080 so that it will co-exist with IIS (which is already on port 80). Then after that is done, I install it as a service by executing the command-line command: apache -k install
(from within the apache2\bin directory)

5. Edit the Apache configuration file C:\Program Files\Apache Group\Apache2\httpd.conf - make the following changes:

# search for “DirectoryIndex” and add index.php to the end:
DirectoryIndex index.html index.html.var index.php

# search for “ScriptAlias” and add the following lines in that section:
ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php.exe”

6. restart Apache and the new configuration should take effect. create a test PHP file and see how it works.

* caveat: if you use the same browser and surf back-and-forth between IIS and Apache, you may get a bunch of weird error messages about permission denied while writing session files. This is because Apache and IIS run as different users & they will block each other from writing to the same session file.

 

 
Mar
30
Filed Under (IIS) by Jason on 30-03-2006

If you’re a developer and you want to be able to use SSL on your development machine, or you are just doing some in-house development, you can install an SSL certificate on your IIS server without obtaining it from VeriSign, Thawte or others.

The plus side is that you can enable this right away for free. The downside is that any visitors to your site will get the security warning saying that the certificate used is not valid. If this is for in-house use only, you can add the certificate to your trusted certs for IIS for yourself and/or all your internal employees. Otherwise, you can just deal with the security pop-up. Either way, it works for testing SSL on your dev box.

Installing it is actually pretty easy. First, you need to install the IIS 6.0 Resource Kit From Microsoft:

[url]http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en[/url]

Once it’s installed, Your Start menu will contain a new folder with a bunch of IIS utilities.

To install the cert, run the app: Start -> IIS Resources -> SelfSSL -> SelfSSL

A DOS window will open with some instructions. At the DOS prompt, type “SelfSSL” (without the quotes) to run the app and enter “Y” when prompted to override your default certificate.

At that point SSL should be installed - you can verify this by opening your browser to https://localhost/

 

 
Mar
30
Filed Under (IIS, Windows) by Jason on 30-03-2006

If the server has multiple IP addresses, when you specify port 443 for SSL, you can’t just accept the SSL identity for “All Assigned” you have to add an identity for the specific IP that is assocated with this domain (or add it to all IPs assigned to this machine). If you just leave the “All Assigned” then you’ll get a DNS not found response when you browse, even if you can successfully test the connection through telnet.

 

« Previous Entries Next Entries »
Close
  • Social Web

NOTE: Email is disabled

E-mail It