Apache and IIS 7 running together
I am working on windows 7. IIS 7 and XAMPP are installed on the same computer. I have been playing with win host file and apache configuration files into to understand Server Root a开发者_运维知识库nd directory.
I dont know where i messed up, that know when i type localhost it shows me IIS 7 screen and when localhost/xampp then apache screen.
How can IIS and apache run together at port 80 ? confused.
It is doable. The thing to keep in mind is that no 2 services can share the same port and IP address. Unfortunately, IIS takes over port 80 completely on the magic 0.0.0.0 address. What you need to do is re-bind apache and IIS to different IP addresses as well as remove the 0.0.0.0 binding. Not exactly sure how to get there on IIS7 (presuming you are running it given IE9 in the screenies), last time I pulled this stunt IIS6 was hawt.
A more sane option would be to setup a reverse proxy on 80 and have it hand stuff out to different web servers based on whatever rational criteria you want to use.
EDIT: found the magic juju, IIS7 post #44 - IIS7 and Apache on the same machine.
How To Run IIS And XAMPP Together On Same Machine
It is possible to run both IIS and XAMPP servers together on same machine by just changing the port number of any one of the server's. XAMPP-Apache and IIS both the server's uses the same port 80 to connect. In this post i am going to show you how to change the port number for the XAMPP-Apache server. Changing the port number for Apache server allows you to run both IIS and XAMPP server's on same machine using different port's.
Firstly, You need to know the folder where XAMPP is installed (root folder). The default folder is c:\xampp. From the root folder navigate to " apache\conf " folder and find the file "httpd.conf".
Before editing the file, make a backup of it with a name "httpd.conf.bak" so that if something goes wrong you can replace this file. Now open the file "httpd.conf" with an editor like notepad. You need to make two edits to the file.
The first one:
Find out the below lines in the file.
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 80
change it as shown below:
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 8080
The second edit:
Find the below line:
ServerName localhost:80
change it to:
ServerName localhost:8080
You have finished changing the port number. Now restart your apache server from the xampp control panel and its ready to run.
Open your browser and and enter the address localhost:8080
. You can see the root folder of apache opened. There is no need to make any changes to the IIS server and you an access it by just entering the address localhost
in your browser.
In the above screenshot you can see the IIS server being accessed through localhost
and XAMPP server through localhost:8080
on the same machine and even the same browser at a time.
In case of trying to get XAMPP (Apache) and IIS (5.1) working on WinXP this is what I did:
C:\xampp\apache\conf\httpd.conf: Search for “Listen 80″, change to “Listen 8080″ Search for “ServerName localhost:80″, change to “ServerName localhost:8080″
C:\xampp\apache\conf\extra\httpd-ssl.conf Search for “Listen 443″, change to “Listen 4499″ Search for “”, change to “” Search for “ServerName localhost:443″, change to “ServerName localhost:4499″
[Then, access your Apache side by running localhost:8080 and ISS side by simple loccalhost]
It is possible to run both IIS and XAMPP on same machine by just changing the port number which is used by XAMPP server. Read this article to know how to change port number:
http://www.gooshareit.com/2012/03/how-to-run-iis-and-xampp-together-on.html
I have faced the same problem. However I have solved this way. I got it from here, it was really effective for me when all solutions were unable to provide me absolute solution.
- Go to Control Panel > Administrative Tools > Click Services
- Find “World Wide Web Publishing Service”
- Right click and select “Stop”
- Right click and select “Properties”, then change “Startup type” to “Manual”
If this doesn’t fix it, you can find out what is using port 80 as follows:
In a Command Prompt, run ‘netstat -ao > netstat.txt’ to write active connections and associated process IDs (PID) to a file (for me, there were too many to just view them in the command prompt) Find the PID that is listening on port 80 (0.0.0.0:80) – for me, the PID was 4, which seems quite common Open Task Manager (Ctrl + Shift + Esc), right click on the column headers, and then click PID to show the PID column. Sort by PID to find the process for the PID that you identified above. Once you know the process that is causing the problem, a bit of Googling (other search providers are available) should help you fix it.
精彩评论