Disable standard localhost? (I use virtual host)
Posted by: ohm-ish (---.u.parknet.dk)
Date: July 17, 2018 09:11AM

Hi

I use pretty standard settings, on port 80.

And I use virtual host, so it's like [myhost.tld]

But [localhost] still works and shows my web content.

How can I disable [localhost] so only the virtual host name is accessible?

Thank you

Options: ReplyQuote
Re: Disable standard localhost? (I use virtual host)
Posted by: ohm-ish (---.u.parknet.dk)
Date: July 17, 2018 09:45AM

Ok now I have it set so that [localhost] shows WAMP default www content (the wamp overview/interface), and my virtual host [myhost.tld] shows my own content.

I assume nobody can access my localhost WAMP interface from outside right?

Options: ReplyQuote
Re: Disable standard localhost? (I use virtual host)
Posted by: Otomatic (Moderator)
Date: July 17, 2018 10:04AM

Hi,

VirtualHost localhost is Require local

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.4 32 bit - Apache 2.4.35 - PHP 7.2.11/7.1.23/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.10
Wampserver 3.1.4 64 bit - Apache 2.4.35 - PHP 7.2.11/7.1.23/7.0.32/5.6.38 - MySQL 5.7.23 - MariaDB 10.3.10
PhPMyadmin 4.8.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Disable standard localhost? (I use virtual host)
Posted by: RiggsFolly (Moderator)
Date: July 17, 2018 10:40AM

Access to your localhost is controlled by the Virtual Host that defines localhost. As it is for ALL Virtual Hosts you define.

So it you made the mistake of changing the VH definition of localhost to `Require all granted` that would explain why it is visible from outside the PC running WAMPServer


Make sure the Virtual Host for localhost has

    Require local

in its definition, then only the PC running WAMPServer will be able to connect to it.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.