Thursday, August 4, 2011

How to use IIS and XAMPP together

I have IIS setup in my PC which use 80 port by default. Today I have installed XAMPP in my PC so that I can do both ASP and PHP programming together. But I have seen that Apache is not running. Thus I am failing to run php files. This is happening, because Apache server also use 80 port. IIS is using the same port, so Apache server will not work in this port. So I have to set Apache server in other port (8080) so that it can run properly. To change the port, please follow the following steps,

1/ Change to this file, C:\xampp\apache\conf\httpd.conf
  • Find "Listen 80" and replace with "Listen 8080"
  • Find "ServerName localhost:80" and replace with "ServerName localhost:8080"
2/ Change to this file, C:\xampp\apache\conf\extra\httpd-ssl.conf
  • Find "Listen 443" and replace with "Listen 4499"
  • Find "ServerName localhost:443" and replace with "ServerName localhost:4499"
Now you will be able to use both server together using following URL,
  • IIS Server: http://localhost/YourProjectName/
  • Apche Server: http://localhost:8080/YourProjectName/