You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Louis <st...@stormy.ca> on 2018/06/20 00:01:07 UTC

[users@httpd] Virtualhosts

Apache 2.4 on Ubuntu 16.04LTS . We have multiple VirtualHosts running on 
port 80, one on port 8080. They are all fully functional...

BUT for the one on port 8080 I have to explicitly append the port number 
to the URL in a browser to access it (or the browser gets the 
000-default.) No diff between .conf files except Listen 80 | 8080 and 
<VirtualHost *:80> | <VirtualHost *:8080>

How to avoid appending the port number to the browser URL? (I'm sure 
it's simple, but I just can't find it.)

Nothing relevant in the logs. From apachectl -S :

VirtualHost configuration:
*:8080                 ships-admin 
(/etc/apache2/sites-enabled/ships-admin.conf:5)
*:80                   is a NameVirtualHost
          default server localhost 
(/etc/apache2/sites-enabled/001-default.conf:1)
          port 80 namevhost localhost 
(/etc/apache2/sites-enabled/001-default.conf:1)
          port 80 namevhost ships (/etc/apache2/sites-enabled/ships.conf:4)
          port 80 namevhost shipstt 
(/etc/apache2/sites-enabled/shipstt.conf:1)

etc., etc,

Many thanks -- Louis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtualhosts

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jun 19, 2018 at 8:01 PM Louis <st...@stormy.ca> wrote:
>
> Apache 2.4 on Ubuntu 16.04LTS . We have multiple VirtualHosts running on
> port 80, one on port 8080. They are all fully functional...
>
> BUT for the one on port 8080 I have to explicitly append the port number
> to the URL in a browser to access it (or the browser gets the
> 000-default.) No diff between .conf files except Listen 80 | 8080 and
> <VirtualHost *:80> | <VirtualHost *:8080>
>
> How to avoid appending the port number to the browser URL? (I'm sure
> it's simple, but I just can't find it.)
>

The configuration means the config enclosed in the virtualhost will be
used if and only if the server is accessed exactly that way, with the
port 8080 in the browser /  in the HTTP Host: header.

You can use a different hostname in a new *:80 vhost, or a different
interface (127.0.0.1:80) instead of a different port. But something
has to differentiate it if you want the server to handle it
differently.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org