RSS

Category Archives: IIS

How to Install PHP on IIS 6 for Windows Server 2003

How to Install PHP on IIS 6 for Windows Server 2003
One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, WordPress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 6 on your Windows Server 2003 system.

Configuring PHP
In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:PHP’). For IIS 6, the non thread safe binaries should be used.

image_thumb44

Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.

image_thumb45

Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 6 system:

  • Uncomment and set the key, cgi.force_redirect = 0
  • Uncomment the key, fastcgi.impersonate = 1
  • Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:PHPext’).
  • Set the key, date.timezone to the time zone of your server (the URL on the line above this key lists the accepted values).

At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.

Installing the IIS 6 FastCGI Extension

In order for Internet Information Services (IIS) 6 to execute and serve PHP scripts, some additional configuration is required. In this guide, we will install PHP on IIS using the FastCGI interface which provides a good balance of stability and performance. Since FastCGI is not included with IIS 6 be default, we need to download and install it.

image_thumb46

The FastCGI installer does not require any configuration, however once the FastCGI extension is installed we need to configure it to run PHP.

Open the file ‘C:WINDOWSsystem32inetsrvfcgiext.ini’ in Notepad and find the ‘Types’ section and enter the configuration information:

[Types]
php=PHP

[PHP]
ExePath=C:PHPphp-cgi.exe
InstanceMaxRequests=5000
EnvironmentVars=PHP_MAX_REQUESTS:5000

Revise these values as needed according to your environment, but it is important that all of settings have the correct values. Once you are finished, save this file.

image_thumb47

Configuring IIS to Run PHP via FastCGI

With both PHP and FastCGI installed and configured, all that is left is to set up IIS 6. When you open the IIS Management Console, under the Web Service Extensions make sure the “FastCGI Handler” is set to allowed.

image3_thumb

Next, go to the Properties settings for the Web Sites group.

On the “Home Directory” tab, click the “Configuration” button.

image_thumb49

Add a mapping for files with the .php file extension with the executable set to the FastCGI extension DLL.

image_thumb50

Once you have applied all the changes, restart IIS.

image_thumb51

Testing PHP

At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:Inetpubwwwroot’ named ‘phpinfo.php’ which simply contains the line:

<?php phpinfo(); ?>

image_thumb52

Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.

image_thumb53

Conclusion

Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.

Links

Download PHP Windows Binaries (non thread safe)

Download IIS 6 FastCGI Extension

——————————————————————————–

Thanks for: http://www.howtogeek.com/50455/how-to-install-php-on-iis-6-for-windows-server-2003/

 
1 Comment

Posted by on April 25, 2013 in IIS

 

Global MIME Types

Global MIME Types

Category Content-Type File Suffix
type application/octet-stream bin
type application/astound asd,asn
type application/fastman lcc
type application/java-archive jar
type application/java-serialized-object ser
type application/java-vm class
type application/mac-binhex40 hqx
type application/x-stuffit sit
type application/mbedlet mbd
type application/msword doc,wiz,rtf
type application/oda oda
type application/pdf pdf
type application/postscript ai,eps,ps
type application/studiom smp
type application/timbuktu tbt
type application/vnd.ms-excel xls,xlw,xla,xlc,xlm,xlt,xll
type application/vnd.ms-powerpoint ppt,pps,pot
type application/vnd.ms-project mpp
type application/winhlp hlp
type application/x-javascript js
type application/x-javascript;charset jsu
type application/x-aim aim
type application/x-asap asp
type application/x-csh csh
type application/x-dot dot
type application/x-dvi dvi
type application/x-earthtime etc
type application/x-envoy evy
type application/x-gtar gtar
type application/x-cpio cpio
type application/x-hdf hdf
type application/x-latex latex
type application/x-javascript-config jsc
type application/x-maker fm
type application/x-mif mif,mi
type application/x-mocha mocha,moc
type application/x-msaccess mdb
type application/x-mscardfile crd
type application/x-msclip clp
type application/x-msmediaview m13,m14
type application/x-msmetafile wmf
type application/x-msmoney mny
type application/x-mspublisher pub
type application/x-msschedule scd
type application/x-msterminal trm
type application/x-mswrite wri
type application/x-NET-Install ins
type application/x-netcdf nc,cdf
type application/x-ns-proxy-autoconfig proxy
type application/x-pointplus css
type application/x-salsa slc
type application/x-sh sh
type application/x-shar shar
type application/x-sprite spr,sprite
type application/x-tar tar
type application/x-tcl tcl
type application/x-perl pl
type application/x-tex tex
type application/x-texinfo texinfo,texi
type application/x-timbuktu tbp
type application/x-tkined tki,tkined
type application/x-troff-man man
type application/x-troff-me me
type application/x-troff-ms ms
type application/x-troff t,tr,roff
type application/x-wais-source src
type application/zip zip
type application/pre-encrypted enc
type application/x-pkcs7-crl crl
type application/x-fortezza-ckl ckl
type audio/basic au,snd
type audio/echospeech es,esl
type audio/midi midi,mid
type audio/x-aiff aif,aiff,aifc
type audio/x-wav wav
type audio/x-pn-realaudio ra,ram
type audio/x-pac pac
type audio/x-epac pae
type audio/x-liveaudio lam
type drawing/x-dwf dwf
type image/fif fif
type image/gif gif
type image/ief ief
type image/ifs ifs
type image/jpeg jpeg,jpg,jpe,jfif,pjpeg,pjp
type image/png png
type image/tiff tiff,tif
type image/vnd dwg,svf
type image/wavelet wi
type image/bmp bmp
type image/x-photo-cd pcd
type image/x-cmu-raster ras
type image/x-portable-anymap pnm
type image/x-portable-bitmap pbm
type image/x-portable-graymap pgm
type image/x-portable-pixmap ppm
type image/x-rgb rgb
type image/x-xbitmap xbm
type image/x-xpixmap xpm
type image/x-xwindowdump xwd
type text/html htm,html
type text/plain txt
type text/richtext rtx
type text/tab-separated-values tsv
type text/x-setext etx
type text/x-speech talk
type video/isivideo fvi
type video/mpeg mpeg,mpg,mpe,mpv,vbs,mpegv
type video/x-mpeg2 mpv2,mp2v
type video/msvideo avi
type video/quicktime qt,mov,moov
type video/vivo viv,vivo
type video/wavelet wv
type video/x-sgi-movie movie
type x-world/x-svr svr
type x-world/x-vrml wrl
type x-world/x-vrt vrt
type x-conference/x-cooltalk ice
enc x-gzip gz
enc x-compress z
enc x-uuencode uu,uue
type magnus-internal/imagemap map
type magnus-internal/parsed-html shtml
type magnus-internal/cgi cgi,exe,bat
type application/x-x509-ca-cert cacert
type application/x-x509-server-cert scert
type application/x-x509-user-cert ucert
type application/x-x509-email-cert ecert
 
Leave a comment

Posted by on February 9, 2012 in IIS

 

Apache and IIS7 Together on Windows 2008

Apache and IIS7 Together on SBS2008

Posted on 04 February 2009 by Shane Welldon

I’m currently evaluating Small Business Server 2008 on a machine which I also use for testing websites and learning PHP. With such tight integration of IIS7 to run the SBS services of remote access to Exchange email, SharePoint and even just web-based remote access of machine it makes it impossible to simply stop IIS and replace it with Apache. Instead we need to set them both up to run side-by-side.

At first I told Apache to run on a different port but got tired of appending the port number to the URL every time I needed to access it from my PC.

After some more research I found a way of giving the server a second IP address and running IIS7 on one and Apache on the other, both still on port 80. One caveat to this setup is that to keep outside access to Small Business Server’s remote applications is that external SSL connections on port 443 must remain routed to IIS7.

Add a Second IP Address

  1. Login to your server’s desktop and click Start –> Control Panel then open Network and Sharing Center and click Manage Network Connections under Tasks in the left panel
  2. Right-click the machine’s network adapter and click Properties, clicking Continue on the UAC prompt if enabled
  3. In the list select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button
  4. In the Properties dialog click the Advanced… button down the bottom-right
  5. On the IP Settings tab click the Add… button in the IP addresses grouping
  6. Enter the new IP address of your choice and the required Subnet mask then click Add
  7. You should now have two IP addresses assigned to your machine. Click OK or close all open dialogs and windows

Bind IIS to a Single IP Address

By default IIS listens on all IP addresses assigned to the machine. We need to change this and bind it to only one. I chose to keep IIS running on the original IP address (In my case 192.168.1.100) and run Apache on the second one I assigned to it (192.168.1.110).
  1. Click Start, type “cmd” in the search box then right-click cmd.exe in the Programs list and choose Run as Administrator. Click Continue on the UAC prompt
  2. In the command prompt type the following:
    netsh http show iplisten
    The list returned should be empty
  3. In the command prompt type:
    netsh http add iplisten ipaddress=192.168.1.100
    Replacing 192.168.1.100 with the existing IP address of your machine
  4. Type out the show command from step 2 a second time and you should see your IP address in the list
  5. Reboot the IIS services by typing the following in your open command prompt
    iisreset
    It will take a few minutes to completely shutdown and restart IIS
  6. Once IIS has reset close the command prompt and test both your IPs in a web browser again, this time IIS should only display on a single IP address

Install and Configure Apache

For the installation of Apache you’re on your own. You can either install it from scratch or use one of the combined WAMP packages out there. Personally I use XAMPP as I am quite lazy and no longer have the time to manually install all the required components separately.

Once you have installed Apache, we need to bind it to the second, unused IP address

  1. Run notepad as an administrator using the method from step 1 above
  2. In Notepad click File –> Open and navigate to the folder Apache installed in. Within this folder select the ‘conf’ folder then open up the httpd.conf file (NOTE: make sure you have All Files (*.*) selected in the drop-down box at the bottom right otherwise you will not see the files)
  3. Locate the line
    Listen 80
    And change it to
    Listen 192.168.1.110:80
    Replacing 192.168.1.110 with the second IP you assigned to your machine.
    sbs2008-apache-listen-string-marked
  4. Save your changes then go to File –> Open and navigate to the ‘extras’ subfolder of the conf folder and open the httpd-ssl.conf file
  5. Locate the line
    Listen 443
    And change it to
    Listen 192.168.1.110:443
    Again replacing the IP address written here with your own
    sbs2008-apache-listen-ssl-string-marked
  6. Save your changes and start/restart Apache

You should now be able to view IIS on your original IP address and Apache on the new one you added. To get external access to Apache instead of IIS you would simply change the port forwarding rule for port 80 in your router to point to this new IP address instead of the original one.

Make sure that you do not change port forwarding for port 443 though as this will stop all remote access to email and other SBS 2008 services!

 
4 Comments

Posted by on April 1, 2011 in IIS

 

How to run IIS and Apache on same machine on port 80?

How to run IIS and Apache on same machine on port 80? Here is the solution.

Solutions:1

 This article will help you to run IIS and Apache on  the same machine. There are many circumstances that warrant running IIS and Apache on the same server. For example, you are running Microsoft Reporting Service on your IIS web server and your main application is running on Apache.

In this scenario, there are a  few solutions available, for instance- using different ports, proxying method or if you willing to run both Apache and IIS on port 80 then you need to choose a method which requires different IP addresses (Two LAN adapters installed) for IIS and Apache on same server.Let me describe this further :-

Different IP addresses for IIS and Apache to run on port 80.

Most of us think that if we have two IP addresses on the same server then there’s no need for this article but the fact is that you have to put efforts to make this effective as you are working on Microsoft windows server. So IIS takes preference and binds it with all available IP addresses on this server.

In short, the issue is that IIS starts listening to all available IP addresses in the servers. Even if go thru IIS settings and manually assign one IP; this does not solve the issue.

I have performed this using the following:-

·       Windows 2003 Server (OS on which we need to perform this task)

·       Installed Windows support tools on this server. ( I have described this below in detail)

·       Two LAN adapters installed.

·       Set separate IP for every LAN adapter

·       Each IP have mapped with a DNS

Now Let’s Start:-

Make IIS listen on a definite IP only;-

1. Start > Run> cmd.exe (open command prompt)

2. Type on command prompt C:\Documents and Settings\Administrator>httpcfg set iplisten -i XXX.XX.XXX.X

Note :- XXX.XX.XXX.X is the IP address on which you want IIS to listen.

2.1. If the message “’httpcfg‘ is not recognized as an internal or external command, operable program or batch file.” appears that means Windows support tools is not installed. Here is the link that will help you http://www.microsoft.com/downloads/details.aspx?FamilyID=96a35011-fd83-419d-939b-9a772ea2df90&displaylang=en 

2.2. If the message “ HttpSetServiceConfiguration completed with 0.” will appear then say cheese,  for it works. Now let’s confirm this change by running “C:\Documents and Settings\Administrator>httpcfg query iplisten” you will receive IP : XXX.XX.XXX.X

3. Now let’s confirm this change by running “C:\Documents and Settings\Administrator>httpcfg query iplisten” you will receive IP : XXX.XX.XXX.X

4. Now you need to restart http service by performing command. 

4. 1. C:\Documents and Settings\Administrator>net stop http /y

         Note: – I received the following messages:-

                  The following services are dependent on the HTTP service.
                  Stopping the HTTP service will also stop these services.

                  World Wide Web Publishing Service
                  HTTP SSL

                  The World Wide Web Publishing Service service is stopping..
                  The World Wide Web Publishing Service service was stopped successfully.

                  The HTTP SSL service is stopping.
                  The HTTP SSL service was stopped successfully.

                  The HTTP service was stopped successfully.

4. 2. C:\Documents and Settings\Administrator> net start w3svc

         Note: – I received the following messages:-

                  The World Wide Web Publishing Service service is starting.
                  The World Wide Web Publishing Service service was started successfully. 

Now you need to make change in Apache configuration file 

5. Edit httpd.conf, set: Listen ZZZ.ZZZ.ZZ.Z:80

         Note :-  ZZZ.ZZZ.ZZ.Z is the IP address on which you want Apache to listen.

6. Now you need to restart Apache. If you are running Apache as service,you can use “net stop apache” And after that: “net start apache”

 That’s it!! It’s done!!

————————————————————————————————————–

The changes will replicated to the following location of registry.

 

  • If the ports are not being used, you must examine the ListenOnlyList registry subkey on the computer that is running IIS. To do, this follow these steps:
    1. Click Start, click Run, type regedit, and then click OK.
    2. In Registry Editor, locate the following registry subkey:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList
  • http://support.microsoft.com/kb/890015/en-us 

    ——————————————————————————————————————–

    Solution:2

    Running Apache and IIS 6 together on the same server

    We have a Windows Small Business Server at work, which we wanted to install Subversion onto. We therefore wanted to run Apache on the same server. However, IIS is also installed on the same machine for Small Business Server purposes so I couldn’t just remove IIS.

    I had added multiple IP addresses to the server so that IIS could have one and Apache could have another (so they could both run on port 80). However, I ran into the problem that IIS was taking control of all IP addresses on port 80 and so Apache wouldn’t start. It seems that IIS 6.0 has a “feature” called Socket Pooling that claims all ports for all loaded IP address (even if not configured in IIS) – nice! So IIS had control of the port 80 on the IP address I had assigned to Apache.

    Do not fear – there is a workaround:

    1. Extract the httpcfg.exe utility from the support tools area on the Win2003 CD.
    2. stop all IIS services: net stop http /y
    3. have IIS listen only on the IP address I’d designated for IIS: httpcfg set iplisten -i 192.168.1.253
    4. make sure: httpcfg query iplisten (the ip’s listed are the only ip addresses that IIS will be listening on and no other)
    5. restart IIS Services: net start w3svc
    6. start Apache service

    You’ll then find that Apache and IIS will then play nicely together and run on the correct ports on the correct IP addresses. Woo hoo!

     

     
    3 Comments

    Posted by on March 3, 2011 in IIS

     
     
    Follow

    Get every new post delivered to your Inbox.