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

Laravel XAMPP MySQL artisan migrate install error mysql.sock

In my previous post I wrote about setting up Laravel 4 on Mac with XAMPP . When I tried to use migrations (using artisan) I faced some issue. I will also post about Laravel migrations soon.    php artisan migrate:install Error :                                                     [PDOException]                                       SQLSTATE[HY000] [2002] No such file or directory                                              Solution : We need to tell artisan which mysql we want it to use. For this to work we need to porivde it with mysql.sock which we want it to use. So change your database settings like this: 'mysql' => array( 'driver'    => 'mysql', 'host'      => 'localhost',     'unix_socket' => '/Applications/xampp/xamppfiles/var/mysql/mysql.sock', 'database'  => 'wedding', 'username'  => 'root', 'password'  => '', '

Add (Drop) a new article (table) at publisher in merge replication

Let us add the article using the GUI first. First of all create the table on publisher database. Now right click on the publisher and select properties from the menu. Click on articles. Uncheck the - "Show only checked articles in the list" checkbox, in order to see the newly added table. Select the table as shown in the figure below. Press ok The article has now been added to the publisher We now need to recreate the snapshot Right click the publication and select – “View snapshot agent status”. Click start to regenerate snapshot. Now right click on the subscription (I have both on same server you may have on different servers) and select “View synchronization status” Click on start on the agent. The schema changes will propagate to the client if you have "Replicate schema changes" property set to true in the publisher.

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