Skip to main content

Running IIS and Apache on same system

Few days back I installed XAMPP. But when I tried to start the Apache service it did not start. The MySql and FileZilla services started without any problem. But the Apache service did not start. It returned a message saying Apache service not started. 

The reason for this was that I had IIS installed on the same machine. We can not have two services offered on the same ip and port numbers. On the same server, different services (IIS and Apache) need a unique IP/Port combination.

Thus there are two ways to solve this problem:-

Using two different IPs 

You need two LAN adapters for that.
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. 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. 
3. If the message “ HttpSetServiceConfiguration completed with 0.” will appear it means it worked. Confirm this change by running “C:\Documents and Settings\Administrator>httpcfg query iplisten” you will receive IP : XXX.XX.XXX.X
4. Confirm this change by running “C:\Documents and Settings\Administrator>httpcfg query iplisten” you will receive IP : XXX.XX.XXX.X
5. Now you need to restart http service by performing command. 
6. 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.
7. 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. 
Change Apache configuration file 
8. 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.
9. Restart Apache. If you are running Apache as service,you can use “net stop apache” And after that: “net start apache”

Using different Ports
By default, Apache listens to port 80. However, we must change this we will not have access to port 80 because of IIS. In order to do this, we must edit the "httpd.conf" file.
Open the httpd.conf file and change the port number to ABCD (Whatever you want).
Listen ## (## being the port number)
But Hostname Port will still use port 80 instead of 8080.It is because by the way XAMPP is built, it is not sufficient to just change listening port in httpd.conf.We will have to change all the port reference in httpd.conf file.
I found two instances - Listen 80 and ServerName localhost:80
Now we will have to change httpd-SSL.conf file. There we will change the SSL configuration. 
Change the port number (SSL Port)
Listen ##

Thats it.....Hope this will be of some help.....

Comments

Popular posts from this blog

Create a background / taskbar application in c# .NET

Recently, I was working on integration of two windows applications. First application will launch the second application on login and then they both will communicate using pre-defined set of instructions. There were some complications (I am not going into them) and thus we decided to have a third application which actually will act as mediator. First application will launch the mediator (third application) and it will launch the second application. For this purpose we needed to create a task bar application (which will run in background). How To ·          Create a new windows project and delete the default form (Form1). ·          In Program.cs create a new class and inherit it from Form. ·          Please refer the code below. ·          Now change the Main method. In Application.Run change the startup objec...

Check SQL Server Job status (State) using sp_help_job and xp_sqlagent_enum_jobs

This article is about checking the status of a SQL job. In our work place we have lot of SQL jobs. These jobs will run whole day and are business critical. They will load the data and generate extracts which will be used by business people. Thus, it becomes quite essential to support the system efficiently so that the job finishes in time and as desired. Also, while designing a new system sometimes we need to check the dependency of one job over another. In such scenario we need to check whether a particular job has finished or not. All this can be achieved in SQL Server by using the procedures:- sp_help_job xp_sqlagent_enum_jobs Note: xp_sqlagent_enum_jobs is an undocumented proc inside of sp_help_job and is used extensively to get SQL agent job information. sp_help_job: This procedure gives some insight into the status, and information, about a job. This stored procedure provides information such as last start time, job status etc. Syntax sp_help_job { [ @job_id= ] jo...

Java 8 JMX Default Metrics

This is more of a note. Here you can find default types and attributes for JMX on top of Java 8. Code: I will clean and explain it later :( private static void WriteAttributes(final MBeanServer mBeanServer, final ObjectName http) throws InstanceNotFoundException, IntrospectionException, ReflectionException { MBeanInfo info = mBeanServer.getMBeanInfo(http); MBeanAttributeInfo[] attrInfo = info.getAttributes(); System.out.println("Attributes for object: " + http +":\n"); for (MBeanAttributeInfo attr : attrInfo) { System.out.println(" " + attr.getName() + "\n"); } } Attributes for object: java.lang:type=MemoryPool,name=Metaspace:   Name   Type   Valid   Usage   PeakUsage   MemoryManagerNames   UsageThreshold   UsageThresholdExceeded   UsageThresholdCount   UsageThresholdSupported   CollectionUsageThreshold   Collectio...