How to point droplet's IP address to another DocumentRoot?

Posted March 3, 2017 2k views
ApacheUbuntu 16.04

I cloned a LAMP Ubuntu 16.04 droplet. I was provided a droplet IP address which pointed me to the static message “Please log into your droplet via SSH to configure your LAMP installation.” which was the text in the file “/var/www/html/index.html”, powered by “/etc/apache2/sites-available/000-default.conf”

Now I followed and created an additional virtualhosts and corresponding DocumentRoots, enabled them and disabled the default “000-default.conf”. I have one main domain (say, and several other domains co-hosted on the same droplet. If someone types the IP address I want server to render siteA. How do I make it happen?

Additional Info:

  • Currently I get The requested URL / was not found on this server. when typing the IP address. This is obviously because I disabled 000-default.conf
  • As per my understanding, since is the only enabled virtualhost, IP address should automatically render it. But this is not happening
  • Results of apache2ctl -S: ServerRoot: “/etc/apache2” Main DocumentRoot: “/var/www/html” Main ErrorLog: “/var/log/apache2/error.log” Mutex watchdog-callback: usingdefaults Mutex default: dir=“/var/lock/apache2” mechanism=fcntl Mutex mpm-accept: usingdefaults PidFile: “/var/run/apache2/” Define: DUMPVHOSTS Define: DUMPRUNCFG User: name=“www-data” id=33 notused Group: name=“www-data” id=33 not_used

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Aaaaah my bad! The problem was a typo in DocumentRoot of conf file. Instead of /var/www/, I typed /var/www/html/

Problem stands resolved.

ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/"
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used