virtual host not listen port - nothing working to fix this
Posted by: Tigercat (23.106.59.---)
Date: July 04, 2022 02:34PM

I have:
Windows 10
Wampserver 3.2.3
Php 7.4.26
Apache 2.4.46
mysql 5.7.31
Wampserver icon is green
No maria

"All VC++ packages needed to Wampserver are installed correctly."

phpmyadmin : "This site can’t be reached localhost refused to connect."
The physical address of the localhost is c:/wamp64/www

***
My problem:
I cannot access my website locally. The message when I try to access a page is:
"Not Found
"The requested URL was not found on this server.

"Apache/2.4.46 (Win64) PHP/7.3.21 Server at zorro Port 8083"

The following is on the localhosts page:

"Your VirtualHosti
localhost:8083 - Not a Listen port

"Port :8083 used for the VirtualHost is not an Apache define variable"


My head tends to spin with too much techy stuff. I hope someone can help me out of this.

My virtual hosts have been working previously.

Thanking you in advance for your help and advice.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 04, 2022 04:06PM

Hi,

> Wampserver 3.2.3
Out of date. Apply Wampserver 3.2.9 update

> "Apache/2.4.46 (Win64) PHP/7.3.21 Server at zorro Port 8083"

1 - Why do you want to use port 8083?

2 - How did you declare port 8083 as a listening port for Apache?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (23.106.59.---)
Date: July 04, 2022 11:59PM

1 I shall apply the Wampserver 3.2.9 update, scary as doing that is.

2 We have a number of websites on the net. The whizz son, now too busy being a whizz, set up the ports for the sites to be 8083, 8084, 8085. I believe this is to do with keeping the servers separate on our 'internal' computers.

3 In the process of gathering the information in the current httpd-vhosts.conf file, I realised that the entries did not look right, they were all the same, templates rather than customised to our different sites! Thus, entries in that file all read as
<VirtualHost *:8083>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www/abelard"
<Directory "${INSTALL_DIR}/www/abelard">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

instead of, for instance,
<VirtualHost *:8083>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www/tiger"
<Directory "${INSTALL_DIR}/www/tiger">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

Well, thanks to your questioning, everything is working again as it should, hurrah!!!; and yes, I shall still do the Wampserver update.

Thank you very much for 'shaking my tree' and making me look around at what is actually going on.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 05, 2022 09:28AM

Hi,

> everything is working again as it should, hurrah!!!;
This is a good thing!
Nevertheless, the content of your httpd-vhosts.conf file calls for several remarks.

- The VirtualHost localhost is reserved for the Wampserver homepage and must not be modified, so stay with DocumentRoot "${INSTALL_DIR}/www" and Require local

- Your local sites must be declared in other VirtualHost.
See:
The need for Virtual Host
and
Wampserver 3 - Create or add a VirtualHost

- Port 8083 instead of 80 must be declared by :
Right-click -> Tools -> Use port other than 80 -> 8083
Is this the case?

- To use other ports than 80 or 8083 above, you have to use :
Right-click -> Tools -> Add Listen port to Apache.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (23.106.59.---)
Date: July 05, 2022 10:44PM

Dear Otomatic


I have tried to follow the instructions in both the page Wampserver 3 - Create or add a VirtualHost, and using :
Right-click -> Tools -> Add Listen port to Apache.

Everything is now in a mess!

In the Localhost page, where before the projects were unlinked and the error message, Port :8085 used for the VirtualHost is not an Apache define variable,
the page is now
This site can’t be reached. localhost refused to connect.

When I attempted to use Tools to add a Listen Port, the port number changed to 808385. I corrected this, but in the Tray there now is

Apache error log
There is a syntax error in Apache conf files.
AH00526: Syntax error on line 72 of C:/wamp64/bin/apache/apache2.4.46/conf/httpd.conf:
Invalid address or port

and

Error Apache variables
Unable to find the Apache variables.
There may be a syntax error in Apache conf files.
To be checked by the tool integrated in Wampserver:
Right-click -> Tools -> Check httpd.conf syntax.

The icon is green.

Sadly, trying to regularise things has made them worse, and I don't (yet) see how to straighten things.
Your advice, please.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 06, 2022 12:34PM

Hi,

> Right-click -> Tools -> Add Listen port to Apache.

When you use this option, the ports to be used are defined as an Apache variable in the httpd.conf file.

For example for port 8085, in httpd.conf ther will be :
Around lines 40-50
Define MYPORT8085 8085
Around lines 70-75
Listen 0.0.0.0:${MYPORT8085}
Listen [::0]:${MYPORT8085}

Then, for the VirtualHost with port other than 80 it must be :
<VirtualHost *:${MYPORT8085}>
and so on for other listen ports.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (23.106.59.---)
Date: July 06, 2022 06:52PM

Dear Otomatic
Having followed, I believe, your instructions, the Wampserver icon is now orange. Looking at "My VirtualHosts", localhost has a yellow warning triangle.
Warning
In the httpd-vhost.conf file:
The Port used (8080) for the VirtualHost localhost is not a Listen port
When I change the following entry in httpd-vhosts.conf from 8080 to 80
<VirtualHost *:80>
ServerName localhost
the Wampserver icon is still orange.

In httpd.conf,
at line 69 on, is now
#Listen 12.34.56.78:80
Listen 0.0.0.0:$(MYPORT8083)
Listen [::0]:$(MYPORT8083)
Listen 0.0.0.0:$(MYPORT8084)
Listen [::0]:$(MYPORT8084)
Listen 0.0.0.0:$(MYPORT8085)
Listen [::0]:$(MYPORT8085)

At line 85 on, is now
Define MYPORT8083 8083
Define MYPORT8084 8084
Define MYPORT8085 8085

By the way, at line 263 on, is
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:8083

In httpd-vhosts.conf,
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8083)>
ServerName project1
DocumentRoot "${INSTALL_DIR}/www/project1"
<Directory "${INSTALL_DIR}/www/project1">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8084)>
ServerName project2
DocumentRoot "${INSTALL_DIR}/www/project2"
<Directory "${INSTALL_DIR}/www/project2">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8085)>
ServerName project3
DocumentRoot "${INSTALL_DIR}/www/project3"
<Directory "${INSTALL_DIR}/www/project3">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

Please would you advise.

Thanking you in advance

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 06, 2022 08:17PM

Hi,

Quote
Tigercat
At line 85 on, is now
Define MYPORT8083 8083
Define MYPORT8084 8084
Define MYPORT8085 8085

The Define variables must be BEFORE their use.
Normally they should be with the other define in httpd.conf, i.e. around line 48, after the define indicated by the line:
39 # Apache variable names used by Apache conf files:

In the listen list (line 69...) the original listen are missing:
Listen 0.0.0.0:80
Listen [::0]:80

To use Apache variable we must use {} and not () !!!
Listen 0.0.0.0:${MYPORT8083} not Listen 0.0.0.0:$(MYPORT8083)

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 07/07/2022 09:18AM by Otomatic.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (23.106.59.---)
Date: July 08, 2022 05:01PM

Thank you for your patience in helping me.

In httpd.conf,
I don't know why I put line 85, the Defines start at line 45 onwards.
The Defines are
Define APACHE24 Apache2.4
Define VERSION_APACHE 2.4.46
Define INSTALL_DIR c:/wamp64
Define APACHE_DIR ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}
Define SRVROOT ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}

Define MYPORT8083 8083
Define MYPORT8084 8084
Define MYPORT8085 8085


Line 69 onwards now reads
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8083}
Listen [::0]:${MYPORT8083}
Listen 0.0.0.0:${MYPORT8084}
Listen [::0]:${MYPORT8084}
Listen 0.0.0.0:${MYPORT8085}
Listen [::0]:${MYPORT8085}

Even with fairly new glasses, curly brackets aren't that easy to see. And yes, I have Boris Johnson's, the UK's ex-PM, characteristics - long on action but short on details - sigh.

However, although the icon is green again, there are still Apache error log warning and syntax error Apache conf files, and *all* the VirtualHosts now have yellow warning triangles.

I do hope you can help, and thank you very much.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 10, 2022 11:49AM

Hi,

> there are still Apache error log warning and syntax error Apache conf files,
> and *all* the VirtualHosts now have yellow warning triangles.

You see, what would be great is if when a user writes that there is an error, it gives the exact and complete wording of the error.

And, if the user clicks on the line with the yellow warning triangle, there too there is an error message that would be nice to give here.

Please also give the content of the httpd-vhosts.conf file.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 10, 2022 03:37PM

Dear Otomatic

You're finding my character failings, brushing over details.
I'm sorry, after a bit I'm like a rabbit frozen in headlights, in this case yellow ones.
I shall do better (part of why I'll never be a reasonable programmer).

The menu that appears on clicking the green icon is now clear (no warning regarding Apache error log and syntax error Apache conf files).
The yellow triangle warnings are
*
VirtualHost_PortValue
Warning

In the httpd-vhosts.conf file:

Port number into <VirtualHost *:port>
has not correct value

Value are:Array
(
[0] => 80
[1] => $(MYPORT8083)
[2] => $(MYPORT8084)
[3] => $(MYPORT8085)
)
*
Project 1
Warning

In the httpd-vhost.conf file:

The Port used ($(MYPORT8083)) for the VirtualHost project1 is not a Listen port
*
Project 2
Warning

In the httpd-vhost.conf file:

The Port used ($(MYPORT8083)) for the VirtualHost project2 is not a Listen port
*
Project 3
Warning

In the httpd-vhost.conf file:

The Port used ($(MYPORT8083)) for the VirtualHost project3 is not a Listen port
*
In httpd.conf,
lines 43 to 51
Define APACHE24 Apache2.4
Define VERSION_APACHE 2.4.46
Define INSTALL_DIR c:/wamp64
Define APACHE_DIR ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}
Define SRVROOT ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}

Define MYPORT8083 8083
Define MYPORT8084 8084
Define MYPORT8085 8085

lines 73 to 81
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8083}
Listen [::0]:${MYPORT8083}
Listen 0.0.0.0:${MYPORT8084}
Listen [::0]:${MYPORT8084}
Listen 0.0.0.0:${MYPORT8085}
Listen [::0]:${MYPORT8085}
*
Testing project1 [zorro] (my server is 'called' zorro)

Not Found
The requested URL was not found on this server.

Apache/2.4.46 (Win64) PHP/7.3.21 mod_fcgid/2.3.10-dev Server at zorro Port 8083

There are similar results for Ports 8084 and 8085.
*
I hope this will be of help to you.
I do appreciate your patience in negotiating through my somewhat chaotic problem.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 10, 2022 03:43PM

Told you, I'm not good at detail, or even reading everything.
Here's the content of the httpd-vhosts.conf file:

<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8083)>
ServerName project1
DocumentRoot "${INSTALL_DIR}/www/project1"
<Directory "${INSTALL_DIR}/www/project1">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8084)>
ServerName project2
DocumentRoot "${INSTALL_DIR}/www/project2"
<Directory "${INSTALL_DIR}/www/project2">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:$(MYPORT8085)>
ServerName project3
DocumentRoot "${INSTALL_DIR}/www/project3"
<Directory "${INSTALL_DIR}/www/project3">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

Apologies.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 10, 2022 05:55PM

Hi,

> <VirtualHost *:$(MYPORT8083)>

Not ( ) but { } !!!

Same for Virtualhost with port 8084 and 8085

> <Directory "${INSTALL_DIR}/www/project1">
Must be ended with a / slash
<Directory "${INSTALL_DIR}/www/project1/">
Same for project2 and project3

If you had used the tools integrated to Wampserver... !

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 10, 2022 09:10PM

;;;Dear Otomatic

I, or is it we, do get there in the end.

First, I had not appreciated that using curly brackets applied to both httpd-type files.
I have increased the zoom on notepad++ to the extent that I can actually so what is curly and what isn't - this does help!

Sadly, the VirtualHosts stayed yellow triangled.

Next, I had not used the tools integrated to Wampserver because the dropdown for " use "Listen port" other than the default" only showed 8084 and 8085, not 8083. This was a cause for freezing/inaction.

However, niggled, ridiculed even, by you, I looked around the Localhost page, and dared to use the Modify a VirtualHost button - modifying just one won't make everything bad, will it?

I did this to each project, and ...
blow me, everything is behving itself. For the first time, the Localhoqt p

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 10, 2022 09:55PM

Dear Otomatic

I had not appreciated that using curly brackets applied to both httpd-type files. Now done.
I have increased the zoom on notepad++ to the extent that I can actually so what is curly and what isn't - this does help!

Sadly, the VirtualHosts stayed yellow triangled.

Next, I had not used the tools integrated to Wampserver because the dropdown for " use "Listen port" other than the default" only showed 8084 and 8085, not 8083. This was a cause for freezing/inaction.

However, niggled, ridiculed even, by you, I looked around the Localhost page, and dared to use the Modify a VirtualHost button - modifying just one won't make everything bad, will it?

I did this to each project, and ...
blow me, the projects are opening using the local server. For the first time, the Localhost has no error messages.
However, the warning triangles are still there.

httpd.conf
lines 43 to 53
Define APACHE24 Apache2.4
Define VERSION_APACHE 2.4.46
Define INSTALL_DIR c:/wamp64
Define APACHE_DIR ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}
Define SRVROOT ${INSTALL_DIR}/bin/apache/apache${VERSION_APACHE}

Define MYPORT8083 8083
Define MYPORT8084 8084
Define MYPORT8085 8085

ServerRoot "${SRVROOT}"

lines 73 to81
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8083}
Listen [::0]:${MYPORT8083}
Listen 0.0.0.0:${MYPORT8084}
Listen [::0]:${MYPORT8084}
Listen 0.0.0.0:${MYPORT8085}
Listen [::0]:${MYPORT8085}

and in httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:${MYPORT8083}>
ServerName abelard
DocumentRoot "${INSTALL_DIR}/www/abelard"
<Directory "${INSTALL_DIR}/www/abelard">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:${MYPORT8084}>
ServerName mcp
DocumentRoot "${INSTALL_DIR}/www/mcp"
<Directory "${INSTALL_DIR}/www/mcp">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

<VirtualHost *:${MYPORT8085}>
ServerName sites
DocumentRoot "${INSTALL_DIR}/www/sites"
<Directory "${INSTALL_DIR}/www/sites">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1.41
Require ip 192.168.1.31
</Directory>
</VirtualHost>

Please, would you advise?
Thanking you in advance

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 11, 2022 09:39AM

Hi,

> <Directory "${INSTALL_DIR}/www/abelard">
As explained before :

Must be ended with a / slash
<Directory "${INSTALL_DIR}/www/abelard/">

Same for all <Directory .....

> However, the warning triangles are still there.
If you click on the line with the triangle, you should see what the error is.

Maybe you should use the Wampserver option:
- Right-Click -> Wamp settings -> Check VirtualHost definitions -> Allow VirtualHost localIP's other than 127...

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 11, 2022 08:09PM

Dear Otomatic

Yes, I know, I'm a clumsy, indisciplined pupil that does not read their lessons carefully. I'm surprised that I ever managed to complete school or uni!

I have spent a while, better later than never, reading this page:
[forum.wampserver.com].
I haven't reached the end (yet), but I perhaps I'll understand better what's going on under the bonnet/hood!

I have put in the ending slashes (that Wampserver option was already in place) and...

There Are No Triangles, No Error messages
it's like when tuning a car and at last the carburettor is balanced, the timing is right, the fan belt is adjusted...

Your patience in helping me is very much appreciated, as are the lessons in taking care and concentrating.
You have sorted what the whizz who set up the server failed,
thank you very much for your time, care, attention, and above all your forbearance.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Otomatic (Moderator)
Date: July 12, 2022 09:34AM

Hi,

Well, there you go! Everything is for the best in the best of worlds - well in the least bad!

For the continuation, always think of going to see the tools and the options integrated into Wampserver as well as the some options of help, all that with the Right-Click before wanting to modify directly a file as well as all the options of modifications of the options, extensions, modules, configuration of PHP, Apache, MySQL and MariaDB with the left-click.

Look also at all that there is in Wampserver 3 - Some explanations

A little detail is bothering me : you have an email address in free.fr which is a french ISP and you use the english forum !

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: Tigercat (185.222.27.---)
Date: July 12, 2022 07:25PM

Dear Otomatic

"before wanting to modify directly a file"

I don't think it helped that the whizz is Oxford maths educated and so (fairly) fluently dives into code-tweaking, rather than going a conventional route.
But yes, _my_ wrists, at least, are duly slapped, and I shall make sure *I read the manual* and follow the rules.

French email - well, born and brought up in London so a native English-speaker, but my French will probably never be good enough to manage a French technical forum.

Moved to France 'cos it's warmer (well, maybe too warm now, today 36.7°C in the shade locally), cheaper, and politically, socially, morally even, more comfortable.

Options: ReplyQuote
Re: virtual host not listen port - nothing working to fix this
Posted by: hawazop (47.15.0.---)
Date: September 02, 2022 08:23AM

same issue with me, I have tried to follow the instructions in both the page Wampserver 3 - Create or add a VirtualHost, and using :
Right-click -> Tools -> Add Listen port to Apache. tellculvers com survey taco bell breakfast hours

Options: ReplyQuote


Sorry, only registered users may post in this forum.