Wednesday, 21 September 2016

Change Default Port of XAMPP Apache Server

This problem comes many times when you install skype and other application to your system that conflict the port issue with xampp port i.e 80 . So this post is all about how to change default port 80 to another.

Change Default Port of XAMPP Apache Server

This error is show in your xampp console
8:12:37 PM  [Apache]     Problem detected!
8:12:37 PM  [Apache]     Port 80 in use by “Unable to open process” with PID 4!
8:12:37 PM  [Apache]     Apache WILL NOT start without the configured ports free!
8:12:37 PM  [Apache]     You need to uninstall/disable/reconfigure the blocking application
8:12:37 PM  [Apache]     or reconfigure Apache and the Control Panel to listen on a different port

Change Default Port 80,443 of XAMPP Apache Server.

1) First, you need to open the Apache “httpd.conf” file and configure it to use/listen on a new port no.

To open httpd.conf file, click the “Config” button next to Apache “Start” and “Admin” buttons. In the popup menu that opens, click and open httpd.conf

2) Within the httpd.conf file search for “listen”. You’ll find two rows with something like;
Listen 80

Change the port no to a port no. of your choice (e.g. port 1234) like below
Listen 1234

3) Next, in the same httpd.conf file look for “ServerName localhost:” Set it to the new port no.
ServerName localhost:1234

4) Save and close the httpd.conf file.

5) Now click the Apache config button again and open the “httpd-ssl.conf” file.

6) In the httpd-ssl.conf file, look for “Listen” again. You may find:
Listen 443
Change it to listen on a new port no of your choice. Say like:
Listen 1443

7) In the same httpd-ssl.conf file find another line that says, “<VirtualHost _default_:443>”. Change this to your new port no. (like 1443)

8) Also in the same httpd-ssl.conf you can find another line defining the port no. For that look for “ServerName”. you might find something like:

ServerName or  ServerName localhost:433

Change this ServerName to your new port no.

9) Save and close the httpd-ssl.conf file.

10) Finally, there’s just one more place you should change the port no. For that, click and open the “Config” button of your XAMPP Control Panel. Then click the, “Service and Port Settings” button. Within it, click the “Apache” tab and enter and save the new port nos in the “main port” and “SSL port” boxes. Click save and close the config boxes.

That should do the trick. Now “Start” Apache and if everything goes well, your Apache server should start up.

You will also see the Apache Port/s no in the XAMPP control panel has change to the new port IDs you set.

The open http:localhost:1234

Featured post

How to create dynamic schema in mongodb

Sometime what we need in our application is to create mongodb schema for collection and some of our collection schema are same but names are...

Popular Posts