Apache php localhost port

Как запустить Apache не на 80 порту

Если какая-либо программа использует порт, то другой процесс уже не может использовать этот же самый порт. К примеру, если на вашем компьютере порт 80 уже занят, то Apache просто не запустится).

Ещё одной причиной, почему может возникнуть желание поменять порт — сделать ваш сервер менее заметным. К примеру, если вы не предприняли мер по защите, то любой в вашей локальной или глобальной сети может подключиться к вашему веб-серверу. Если скрипты содержат уязвимости или просто плохо настроены, то постороннее лицо может лазить по вашим локальным сайтам и, в случае удачной атаки, даже лазить по всему вашему компьютеру. Если поменять порт со стандартного 80 на какой-нибудь необычный, то сервер будет чуть труднее найти. Хотя сканеры портов всё равно смогут это сделать.

Итак, по умолчанию Apache использует 80 порт, это определяется директивой:

в конфигурационном файле httpd.conf.

Чтобы изменить порт, откройте этот файл и вместо 80 впишите любой другой незанятый в вашей системе:

Для кого не подойдёт смена порта

Если ваш сайт предназначен быть публичным сервером и сайты должны быть доступны другим пользователям, то смена порта нежелательна, поскольку они смогут перейти на ваш сайт только по специальному адресу.

Как открыть сайт на нестандартном порту

Чтобы открыть сайт на нестандартных портах (не на 80 или 443), добавьте через двоеточие к адресу сайта порт, который прослушивает сервер:http://localhost:48855

Читайте также:  Gitlab api python примеры

Также можно делать ссылки такого вида: http://localhost:48855. Они являются работающими и вы можете перенаправить посетителя с одной страницы или сайта на другой, работающий на нестандартном порте.

Связанные статьи:

Источник

How to Change Apache and MySQL Port Number in XAMPP Localhost

Hi! I’m going to show you how to change the apache and mysql port number in xampp localhost. In case you wonder why you should change the port number of a web server, here is the answer. It’s not unlikely for you to run multiple PHP versions on a same machine or to run IIS or JBoss simultaneously with Apache.

When you start a web server, it occupies the default HTTP port ’80’. If you try to run the second one, it will fail since the port is already occupied. So unless you change the port for the latter, you can’t run more than one web server at once. Below we will see the ways to change the port no. for apache and mysql.

xampp change apache port number localhost

To Change Apache Port Number:

Stop Apache server and exit XAMPP control panel if it is already running.

First you must change the HTTP port.

Go to [path-to-xampp-folder]/apache/conf folder and open http.conf file.

The default port for Apache is ’80’. Unless you have changed it, this is the port number you must replace.

And then change the port no. to some unused port like this,

And replace ’80’ with the new port no like this,

Next you must change the SSL port.

Open [path-to-xampp-folder]/apache/conf/extra/httpd-ssl.conf file and search for the lines,

Listen 443 ServerName localhost:433

Replace ‘443’ port with something else,

Listen 444 ServerName localhost:444

Done! Now restart Apache and access the url http://localhost:8012 on browser. If everything goes fine, you will see the xampp home page.

Please remember to use the port number along with local host to access it. This is not required when you leave apache to run on the default port itself.

To Change MySQL Port:

Just like Apache, you can also change the default port used by MySQL Server which is ‘3306’.

Читайте также:  Arrow right html code

To do this, go to [path-to-xampp-folder]/mysql/bin/ and open the file my.ini.

Locate the line containing ‘3306’ no. and change it to ‘3310’ or something else and save. Please make sure the new port number is not used by any other service.

That’s it. You have successfully changed the default port numbers of apache and mysql server on xampp server. The same procedure can be applied for ‘WAMP’ and ‘LAMP’ stacks. For LAMP, you can locate the files on ‘usr/bin/apache’ directory.

No comments:

Post a Comment

Contact Form

Subscribe

You May Also Like

Like Us on Facebook

Categories

Affiliate Disclosure: This website is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon(.com, .in etc) and any other website that may be affiliated with Amazon Service LLC Associates Program.

Kodingmadesimple.com uses affiliate links to online merchants and receives compensation for referred sales of some or all mentioned products but does not affect prices of the product. All prices displayed on this site are subject to change without notice. Although we do our best to keep all links up to date and valid on a daily basis, we cannot guarantee the accuracy of links and special offers displayed.

Источник

How To Change XAMPP Apache Server Port

This quick tutorial help to Change XAMPP Apache Server Port.The default port of xampp Apache server is 80.Sometimes, Other application is using that 80 port.

So, When you will start XAMPP server, the xampp will through unexpected and notifies the server port is busy or running another application. e.g.- Skype is using 80 port to run application.

Читайте также:  Цвета css в процентах

You can see all used ports from xampp. You can see that the which ports is already used by System.

I am going to change 80 to 8012 port to run xampp Apache web server.

How To Change Apache Port

You need to follow following steps to change xampp Apache port from 80 to 8012.

Apache HTTP server configuration file

Let’s open the «httpd.conf» file.You can open file from XAMPP config option.This file should be found in C:\xampp\apache\conf on Windows or in bin/apache for Linux :

Current configuration:

Listen 80 ServerName localhost:80

Replace them by:

Listen 8012 ServerName localhost:8012

SSL Apache HTTP server configuration file

The http-ssl.conf responsible to configure ssl setting for apache server.This file should be found in C:\xampp\apache\conf\extra on Windows and on Linux debian /etc/apache2/mods-available/ssl.conf .

The current Configuration –

Listen 443 ServerName localhost:443 

Replace them by:

Listen 4431 ServerName localhost:4431 

Restart the Apache Server.

  • Open Xampp Control Panel
  • Go to ConfigService and Port SettingsApache
  • Replace the Main Port and SSL Port values with our chosen port (e.g. 8012 and 4443 ).
  • Save Service settings
  • Save Configuration of Control Panel
  • Restart the Apache Server.

2 thoughts on “ How To Change XAMPP Apache Server Port ”

thank u so mch, after wandering through all over the internet, this article saved my life

Thanks to you guys. this is far the most impressive solution for this error I have gotten on the web. all the YouTube videos I stumbled on trying to fix this error were a bunch of junk s**t.

Источник

Оцените статью