Hi,
After a complete uninstall and reinstall, I tried again "Tools-> Add a Listen Port for Apache" from scratch, during which I was watching what happened indeed after this process:
1. Tools-> Add a Listen Port for Apache -> 8010;
1-1. A cmd window just flashes and then closed quickly (without messages or pause), the wampserver icon turned orange, then green.
1-2. In the file C:\Wamp\bin\apache\apache2.4.37\conf\httpd.conf, two new rows were found to be inserted automaticly:
Define MYPORT8010 8010 (Line 48 or so)
Listen 0.0.0.0:${MYPORT8010} (Line 72 or so)
1-3. After a restart of wampserver and then a refresh of WAMPSERVER Homepage, in the Server Configuration Section, the second line:
Server Software: Apache/2.4.37 (Win64) PHP/7.1.26 - Port defined for Apache: 80 - 8010 (Note 8010 newly added here)
2. Then comes to the file C:\Wamp\bin\apache\apache2.4.37\conf\extra\httpd-vhosts.conf:
2-1: The first try (Restart of wampserver and then refresh of WAMPSERVER Homepage each time):
# Virtual Hosts
#
<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 *:80 *:8010>
ServerName demo.com
ServerAlias www.demo.com
DocumentRoot "C:/Wamp/www/demo"
<Directory "C:/Wamp/www/demo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
In the bottom of WAMPSERVER Homepage, there are errors showing:
Your VirtualHost
localhost
demo.com:80 *:8010 - Not a Listen port
Error(s) See below
Port :80 *:8010 used for the VirtualHost is not an Apache Listen port
Port number for <VirtualHost *:port> has not correct value or is not the same in file C:/Wamp/bin/apache/apache2.4.37/conf/extra/ httpd-vhosts.conf
2-2: The second try:
# Virtual Hosts
#
<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 *:80>
ServerName demo.com
ServerAlias www.demo.com
DocumentRoot "C:/Wamp/www/demo"
<Directory "C:/Wamp/www/demo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8010>
ServerName demo.com
ServerAlias www.demo.com
DocumentRoot "C:/Wamp/www/demo"
<Directory "C:/Wamp/www/demo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
In the bottom of WAMPSERVER Homepage, there are errors showing:
Your VirtualHost
localhost
demo.com
demo.com:8010 - Not a Listen port
Error(s) See below
Port :8010 used for the VirtualHost is not an Apache define variable
2-3: The third try:
# Virtual Hosts
#
<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 *:80>
ServerName demo.com
ServerAlias www.demo.com
DocumentRoot "C:/Wamp/www/demo"
<Directory "C:/Wamp/www/demo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:${MYPORT8010}>
ServerName demo.com
ServerAlias www.demo.com
DocumentRoot "C:/Wamp/www/demo"
<Directory "C:/Wamp/www/demo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
In the bottom of WAMPSERVER Homepage:
Your VirtualHost
localhost
demo.com
demo.com:8010
As you see, FINNALLY no errors are shown in the bottom !
3. My further tests and conclusions are as below (Kindly point out if any):
3-1. In httpd.conf, can we REPLACE
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8010}
Listen [::0]:${MYPORT8010}
WITH
#Listen 12.34.56.78:80
Listen 80
Listen ${MYPORT8010}
OR EVEN
#Listen 12.34.56.78:80
Listen 80
Listen 8010
?
The Answer: NO ! There will be errors shown in the bottom of WAMPSERVER Homepage:
Your VirtualHost
localhost - Not a Listen port
demo.com - Not a Listen port
demo.com:8010 - Not a Listen port
Error(s) See below
Port used for the VirtualHost is not an Apache Listen port
3-2. Can we MOVE (By move we mean "CUT"
,
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:${MYPORT8010}
Listen [::0]:${MYPORT8010}
FROM httpd.conf TO httpd-vhosts.conf (With following line in httpd.conf UNCOMMENTED of course: Include conf/extra/httpd-vhosts.conf)
?
The Answer: NO ! There will be same errors shown in the bottom of WAMPSERVER Homepage just as 3-1.
HOWEVER, just like the very beginning of my post, with any of these configs [2-1, 2-2, 2-3, 3-1, 3-2], the Wampserver Icon can turn green, and it just works as expected to open and visit the urls in browsers: localhost, localhost:80, localhost: 8010, demo.com, www.demo.com, www.demo.com:8010 and so on.
SO, do you think the "Not a Listen port" errors in the above situations are Wrongly or Unnecessarily shown in WAMPSEVER Homepage ?
Would you mind to check the lines 189-202 in www/index.php file ?
$UrlPortVH = ($virtualHost['ServerNamePort'][$value] != '80') ? ':'.$virtualHost['ServerNamePort'][$value] : '';
if(!$virtualHost['port_listen'] && $virtualHost['ServerNamePortListen'][$value] !== true || $virtualHost['ServerNamePortApacheVar'][$value] !== true) {
$value_url = ((strpos($value, ':') !== false) ? strstr($value,':',true) : $value);
$vhostsContents .= '<li>'.$value_url.$UrlPortVH.' - <i style="color:red;">Not a Listen port</i></li>';
if($virtualHost['ServerNamePortListen'][$value] !== true)
$msg_error = ' not an Apache Listen port';
elseif($virtualHost['ServerNamePortApacheVar'][$value] !== true)
$msg_error = ' not an Apache define variable';
if(!$vhostError) {
$vhostError = true;
$vhostErrorCorrected = false;
$error_message[] = "Port ".$UrlPortVH." used for the VirtualHost is ".$msg_error;
}
}
Thanks for your patience
Best Regards,
Mike
Edited 1 time(s). Last edit at 03/21/2019 12:33PM by mike652638.