Monday 6 February 2017

How to change XAMPP Apache port

About XAMPP

XAMPP is a free and open source cross-platform web server solution stack package, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages.
The program is released under the terms of the GNU General Public License and acts as a free web server capable of serving dynamic pages. XAMPP is available for Microsoft Windows, Linux, Solaris, and Mac OS X, and is mainly used for web development projects. This software is useful while you are creating dynamic webpages using programming languages like PHP, JSP, Servlets.

Why to change default Apache port in XAMPP

If you are a developer or a QA and you want to use XAMPP it is great probability that port 80 is already in use by some other application, or maybe blocked by an administrator.
In order to avoid problems, change Apache port in XAMPP to some other value, e.g. 8080
Consider that regardless of which port you specify Apache to listen to, the XAMPP Control Panel will always display:
"Apache started [Port 80]"

 

 

  How to change Apache port in XAMPP

1) Open xampp/apache/conf/http.conf
2) Find a line "Listen 80"
3) Change port from default 80 to e.g. 8080
4) Then search for the string “ServerName” and update the port number there also. Find a line:
"ServerName localhost:80"
5) Change it to e.g. localhost:8080
6) Save the file
7) Restart XAMPP server

 

  How to use new port in XAMPP Apache

Let's say that your machine is localhost, so in that case you only need to add port number at the end in browser's addressbar, e.g.:
http://localhost:8080

 

 

If you like the article please share it with others!

Harry

Author & Editor

A technology enthusiast and addictive blogger who likes to hacking tricks and wish to be the best White Hacket Hacker of the World.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.