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

495
Vistas
How to configure apache main DocumentRoot correclty?

I am new with linux and VPS servers in general but I am now learning through building a website that runs in VPS server. Everything else goes smoothly but when I am trying to access my site from my phone (or friends phone doesn't matter) it tries to load content from /var/www/html directory even though my site is located at home/sitename/public_html. From desktop it works fine and doesn't give any errors.

In sites-available/mysite.conf everything seems right and DocumentRoot is correctly pointing to home/sitename/public_html. But when i run

apache2ctl -S

it gives me this:

VirtualHost configuration:
1.1.1.1:80       mysite.com (/etc/apache2/sites-enabled/mysite.com.conf:1)
1.1.1.1:443      mysite.com (/etc/apache2/sites-enabled/mysite.com.conf:40)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex fcgid-proctbl: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33

From here we can see that the Main DocumentRoot is "/var/www/html/" instead of the beforementioned correct one. Is this the reason why I can't access my sites from my phone correctly and how this could be fixed? I have tried everything that I could find from google and yes I have purged my cache always after changes but not with a success. I would really appreciate help.

over 4 years ago · Santiago Trujillo
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