Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

638
Vistas
How to ban access Laravel file from other IP, just allow localhost can access

OS: Microsoft Windows Server

web server: Apache

front-end framework: Vue.js

back-end framework: Laravel

I set when path is "example.com", I can see my Vue.js page; When path is "example.com:9999", I can see my Laravel project.

I want access to "example.com" from any IP and "example.com:9999" just can access from this website, how to do that?

This is my httpd-vhost.conf.

<VirtualHost *:80>
    DocumentRoot "C:\Apache24\htdocs\index"
    ServerName example.com
    <Directory "C:\Apache24\htdocs\index"> 
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:9999>
    DocumentRoot "C:\Apache24\htdocs\Laravel_project_name\public"
    ServerName example.com
    <Directory "C:\Apache24\htdocs\Laravel_project_name\public"> 
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

My final goal is I don't want anyone know what framework I'm using. and prohibit anyone can see my laravel index.php and other file in laravel_project_name/public.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Look at the documentation for VirtualHost:

<VirtualHost addr[:port] [addr[:port]] ...> ... </VirtualHost>

Addr can be any of the following, optionally followed by a colon and a port number (or *):

  • The IP address of the virtual host;
  • A fully qualified domain name for the IP address of the virtual host (not recommended);
  • The character *, which acts as a wildcard and matches any IP address.
  • The string default, which is an alias for *

If you only want it accessible from localhost, then replace * with the localhost IP address.


That said, your goal is a bit unclear.

The above will stop a client running on a different computer from accessing on that virtual host.

There's no way to allow users of the Vue application to access that VirtualHost without letting people bypass the Vue application and access it directly. They will still be making an HTTP request to your server and there's no way to tell if it was initiated by your code built into your Vue application or someone else's code (or manually constructed request).

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda