Cannot access virtual hosts by name

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

Cannot access virtual hosts by name

Postby Tariel » 17. July 2016 18:43

Xampp used to work before, but one time my computer restarted itself when I wasn't home, and after that it could no longer connect to port 80. After this I changed the port to 1234. It's able to connect, but it cannot access any of the virtual hosts by name. Also if I add NameVirtualHost *:1234 to the vhosts file, it gives a warning that there are no virtual hosts for 1234. In the past when I used port 80, I didn't have this line at all and it was still working, but some sites claim you're supposed to have it.

The contents of my vhost file.

NameVirtualHost *:1234

<VirtualHost *:1234>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/xampp/htdocs/phpMyAdmin"
ServerName phpmyadmin.loc
ServerAlias http://www.phpmyadmin.loc
ErrorLog "logs/phpmyadmin_loc_error.log"
CustomLog "logs/phpmyadmin_loc_access.log" combined
</VirtualHost>

<VirtualHost *:1234>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/xampp/htdocs/otherworld/www"
ServerName otherworld.loc
ServerAlias http://www.otherworld.loc
ErrorLog "logs/otherworld_loc_error.log"
CustomLog "logs/otherworld_loc_access.log" combined
</VirtualHost>

Also I can't change back to port 80 because it still says something about port 1234, so it continues being defined somewhere even if I try to switch back to 80. I would rather use another port than 80 so I wouldn't have to disable skype. I already disabled some Windows server program that was interfering with it in the beginning, and it no longer appears on the list of programs.

If I go to localhost:1234 it loads phpmyadmin which is the default, but there's no way to access otherworld.loc. If I type that into the address bar, it gives a blank page.
Tariel
 
Posts: 2
Joined: 17. July 2016 18:35
XAMPP version: 1.7.7
Operating System: Windows 10

Re: Cannot access virtual hosts by name

Postby Altrea » 17. July 2016 20:56

Who said you need to disable Skype to free port 80?
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: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot access virtual hosts by name

Postby Tariel » 17. July 2016 21:17

Several topics I found on Google said that Skype tends to use port 80. I found a way to stop Skype from using port 80, so that's no longer an issue, but some windows process might be using it.

Anyway, I found a workaround. If I write otherworld.loc:1234 instead of just otherworld.loc, I can access my local file. I'm not sure why it was unnecessary to include the port number when it was 80 but this isn't too much extra work.
Tariel
 
Posts: 2
Joined: 17. July 2016 18:35
XAMPP version: 1.7.7
Operating System: Windows 10

Re: Cannot access virtual hosts by name

Postby Nobbie » 17. July 2016 21:40

Tariel wrote:SI'm not sure why it was unnecessary to include the port number when it was 80 but this isn't too much extra work.


Because port 80 is the default port for http, that means, if you do not specify any port, port 80 is taken. Each protocoll in TCPIP has its default ports, so for example default port for FTP (another protocoll than HTTP) is 21. Usually you have to apply a port number always, but if you ommit it, the default port is taken.

Wikipedia provides a list of all default ports in TCPIP:

https://en.wikipedia.org/wiki/List_of_T ... rt_numbers
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 117 guests