xampp apache and localhot website

Problems with the Windows version of XAMPP, questions, comments, and anything related.

xampp apache and localhot website

Postby liloeconnie » 07. May 2019 14:43

Hello eveyone, i'm new in this forum and i need an help for my question. Sorry for my bad english also...

I've a worpress mywebsite run in localhost, under xampp 3.2.2. All go very well. All works fine! :D

This morning i had need to reassign port 80 for another use, and i changed the port number in all (i think) file (httpd, Apache, xampp), to another one (85 or also 81, 82). restart apache, xampp, windows more and more times
In this machine IIS isn't installed, only HyperV with one virtual machine but turned off.

Unfortunately now my wordpress website not working. :(

In order, Apache start ok on port 85, mysql start ok, in chrome http://localhost/dashboard/ is ok. But if i try to point another website under htdocs (such as mywebsite) or index.php (test file) in the root, an error occur, (i try to translate in english from Italian)

"is impossibile to reach the site"
"connection is denied from localhost"
"ERR_CONNECTION_REFUSED"
.....

This error appear both if digit http://localhost/mywebsite/ or http://localhost:85/mywebsite/ (as happened correctly before)

I followed many tutorials to change port address in xampp, httpd etc...without having solution.

If anyone can help me, i will be grateful

Many thanks
Massimo
liloeconnie
 
Posts: 4
Joined: 07. May 2019 14:14
XAMPP version: 3.2.2
Operating System: windows 10

Re: xampp apache and localhot website

Postby liloeconnie » 09. May 2019 12:16

Hi everyone, update the post with news.

Today I modified the redirect on aruba to my site in local, adding the new port (eg 90), the same of new apache port in local.

Public situation:
Now if I type www.mysite.com it loads the site correctly as it did before (even if the loading wheel runs for a few seconds even after having completely loaded the home, but this could be a relatively important problem, even if of dubious taste).
I do not understand, however, because before on port 80, it was not necessary to specify the port in the redirect. Maybe because it's the default apache port and so now I'm "forced" to specify it? It would be useful to understand the technical reason.

Local situation:
If I type http://localhost/mysite/ or http://localhost:90/mysite/ I always get an error "cannot access the site" (see first post).
In essence, the situation has not changed and the only way to access the site or admin page is to type http://****.dyndns.org: 90/mysite/ or http://****.dyndns.org:90/mysite/wp-admin/
So, if I type 127.0.0.1:90/mysite/ it load well, but if i type localhost:90 i get the error "cannot access the site" (see first post), but 127.0.0.1 and localhost aren't he same?

My knowledge stops here for now. So by eye if I could map the localhost on the machine like **** dyndns.org:81 should go, maybe in the windows hosts file, I'll definitely try (never solution)
But there would remain the fact of not understanding the theory of this necessity, if before with port 80 there was no need for it (the hosts file I have never modified), but perhaps we return to the famous default port ...

If someone knew how to argue these things better, it would be very useful ...
liloeconnie
 
Posts: 4
Joined: 07. May 2019 14:14
XAMPP version: 3.2.2
Operating System: windows 10

Re: xampp apache and localhot website

Postby Nobbie » 09. May 2019 12:42

liloeconnie wrote:Maybe because it's the default apache port and so now I'm "forced" to specify it?


Exactly. In a fully qualified URL usually you have to specify a portnumber. But each protocoll (like http: or ftp: etc.) has "default" ports, that means, IF you ommit the portnumber, the client (i.e. browser or ftp client or or or) inserts silently the default port and the default port for protocoll http is port 80. The default for https: is port 443. The default for ftp: is port 21 and so on.

This results in:

http://www.domain.com is IDENTICALLY to http://www.domain.com:80

Therefore, if you intend to use a different port than port 80 for a http: connection, you MUST apply the port in the URL:

http://www.domain.com:90 for example. You CANNOT leave out the portnumber if it is different to 80. No way.

in the hosts file you cannot assign ports anyway. The hosts file only assigns domain names to physical IPs. No ports at all. Only names.

Finally, this is the reason why we STRONGLY recommend NOT TO CHANGE the port 80 for http in your Apache configuration to any other portnumber. This leads to port number problems as well as to "ugly" URLs. If you have a problem with a blocked port 80, ALWAYS find out the reason and change the program which uses port 80 instead. NEVER CHANGE APACHE PORT 80 (neither PORT 443). Even if its technically possible, it is ugly and not the right solution.
Nobbie
 
Posts: 10941
Joined: 09. March 2008 13:04

Re: xampp apache and localhot website

Postby liloeconnie » 09. May 2019 13:36

Ok Nobbie, i understand and ok for all. But why if I type 127.0.0.1:90/mysite/ I can view my site well, while if i type localhost:90/mysite/ an error occur? 127.0.0.1 and localhost aren't the same thing?
liloeconnie
 
Posts: 4
Joined: 07. May 2019 14:14
XAMPP version: 3.2.2
Operating System: windows 10

Re: xampp apache and localhot website

Postby Altrea » 09. May 2019 15:29

For Ipv6 localhost might me ::1
You can easily test name translation by opening a cmd and ping localhost
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9643
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: xampp apache and localhot website

Postby liloeconnie » 09. May 2019 15:36

This is a localhost ping result:

C:\>ping localhost
Esecuzione di Ping WIN10-SERVER [::1] con 32 byte di dati:
Risposta da ::1: durata<1ms
Risposta da ::1: durata<1ms
Risposta da ::1: durata<1ms
Risposta da ::1: durata<1ms

Statistiche Ping per ::1:
Pacchetti: Trasmessi = 4, Ricevuti = 4,
Persi = 0 (0% persi),
Tempo approssimativo percorsi andata/ritorno in millisecondi:
Minimo = 0ms, Massimo = 0ms, Medio = 0ms

....mmmmm why ipv6? I am lost :roll: :roll:
liloeconnie
 
Posts: 4
Joined: 07. May 2019 14:14
XAMPP version: 3.2.2
Operating System: windows 10

Re: xampp apache and localhot website

Postby gsmith » 25. May 2019 18:09

IPv4 [10.0.0.5] vs. IPv6 [fe80:ef4b:fc70:f118:21d4:eaf9].

A short simple explanation. https://www.webopedia.com/DidYouKnow/In ... rence.html
gsmith
 
Posts: 244
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 7-10/VC 6,9,11,14,15


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 65 guests