Weborum Webmaster Forum > Guide: Running IIS and Apache on one machine
Help - Search - Members - Calendar
Full Version: Guide: Running IIS and Apache on one machine
Weborum Webmaster Forum > TUTORIAL ARCHIVE - tutorials & scripts to save you scouring the internet. Please feel free to add your own. > Software & hardware resources & reviews, + System tips and tweaks
sjthomas
OK I've just done this and there are a couple of things that need to be done. My reason for doing this is so I can run ASP and PHP on the same development machine. And before anyone asks, yes I do know that you can run PHP on IIS and that you can run a version of ASP on Apache but quite frankly ASP on IIS and PHP on Apache is the way it should be done.

Right first off I installed Apache. I used the latest Apache release from the site. Its important to install this as a service as its simply much easier to use that way. Then go ahead and install PHP and MySQL or whatever you want. In this installation I'll be using Apache as my main server and IIS only to test ASP files. If you want to use IIS as your default then you will want to set the port number of Apache to something other than 80 as 80 is the default for Web Services. To change this port you open your httpd.conf file which is in the "conf" directory of your apache installation directory. Whilst in there look for the line that reads "listen 80" and change the 80 to a different port that you have access to. Many use 8080 for ease of remembering. Now test your installation by going to http://localhost, if it worked then you will see a page saying that you have successfully installed apache.

NOTE: If you have changed the port number then you will have to add that into the url, so if you used port 8080 you will need to go to http://localhost:8080 to check your installation.

Right now for IIS. You'll need your Windows CD for this and I'm assuming that you are running XP SP2 so there may be slight differences is you are not. First stop Apache by clicking on the little apache icon in your system tray, highlighting the service and clicking STOP. Now go to add/remove programs from your control panel or type appwiz.cpl in your run box (Windows key and "r"). Now click add/remove Windows Components on the left hand side. Scroll down to Internet Information Services and tick it. Then click on details and select the sub components you require (for example Visual Studio.net requires front page extensions). Click OK and then NEXT and follow the instructions given. There seems to be quite a prevalent bug with this process but there is a fix. If you see the message "Setup cannot copy the file staxmem.dll ...insert "Windows XP Professional Service Pack 2 CD" or words to that effect you need to quit the setup and open up your console. Now type "esentutl /p %windir%\security\database\secedit.sdb" without the quotes and follw what it says. Now you can go back into add/remove programs and try to install IIS again. When this is done you can configure IIS. First off it will listen to port 80 by default so going to http://localhost immediately after installing should give you a page with all sorts of info on it. You may get a prompt asking for a username and password so we'll address this and the ports next.

As IIS runs as a Windows service configuing it is rather different to the methods used with Apache and PHP (editing the httpd.conf and php.ini files). As I said I'm going to use Apache as my default server so I'm going to change IIS to listen to a different port, namely 8080. To do this you need to open up your control panel, go to Administrative tools, Internet Information Services. Double clicking on this will open up another window with 2 panes. Expand the name of your computer, then Web sites and then right-click on "Default Web Site". This is where you can change allt he default settings for your IIS server. I'm going to change two things in here. The first is I'm going to change the listening port so where it says "TC Port" I'm going to change it to 8080. Now I'm going to change the username and password to the default directory by clicking on the "Directory Security" tab and clicking "Edit". Yet another window will pop up. I'm going to make sure Annonymous access is permitted and change the username and password to something that is secure yet memorable. To do this you need to de-select the "Let IIS manage the Password" box and then change the username and password to whatever you want. You'll be asked to confirm the password so do so. Now "OK" all the boxes that are open.

OK so everything is installed and should be purring beatifully. To check them you will need to fire up Apache again by following the instructions above but clicking "START" instead of "STOP". Now you can fire up your favourite browser and go to http://localhost for Apache and http://localhost:8080 for IIS (or vice versa).

I hope this helps someone out there. Some of the things are pretty obvious but need to be said if you rnot technically minded wink.gif
bassrek
Nice tut, si... very useful. smile.gif
aviansuicide
Very good tut..but it might be worth noting that port 8080 is generally used for Tomcat happy.gif
sjthomas
Good point but I'm guessin gof someone needs to read this tut then there not going to know what tomcat is let alone using it! smile.gif
aviansuicide
QUOTE(sjthomas @ Apr 10 2005, 03:03 PM)
Good point but I'm guessin gof someone needs to read this tut then there not going to know what tomcat is let alone using it!  smile.gif
[right][snapback]26520[/snapback][/right]


Good point...I read it..but it's not because I didn't know how -- and even I don't use Tomcat. I won't install Tomcat on a server that isn't standalone JSP...it's a bigger resource hog than 4 piss poorly coded php web games.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.