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.
Stopping the HTTP service will also stop these services.
World Wide Web Publishing Service
HTTP SSL
HTTP SSL
The World Wide Web Publishing Service service is stopping..
The World Wide Web Publishing Service service was stopped successfully.
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 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.
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
Post a Comment