How do i remove Apache2 Ubuntu Default Page?

December 6, 2015 4.4k views
DNS DigitalOcean Apache Python Linux Basics VPN

Please, kindly need help, after deployed flask application on ubuntu 14 into this path var/www/FlaskApp, Accessing my IP, it display correctly, So, i decided to point my domain to digital ocean which display "Apache2 Ubuntu Default Page", please how do i remove this default page to display the content on var/www/FlaskApp

Here is my folder structure var/www
--------------------------- templates
--------------------------- static

1 Answer

After you have installed the Apache2, you need to configure virtual hosts.
The term Virtual Host refers to the practice of running more than one web site (such as, and on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

All the apache VHOSTs are stored inside /etc/apache2/sites-available/vhosts.conf . You can create your own VHOST here, so apache2 will handle a certain domain or IP. For this sake you would need to use the following command:

sudo nano /etc/apache2/sites-available/yourdomain.conf

Inside you would need to add this:

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/domain.com_error.log
    CustomLog ${APACHE_LOG_DIR}/domain.com_access.log combined

You would need to edit this to your own setup, so change to your own domain.
After creathin this VHOST save it and exit the nano. You will now need to activate the VHOST.
Apache includes a certain directory inside its system wich will enable a VHOST:

sites-enabled: like mods-enabled, sites-enabled contains symlinks to the /etc/apache2/sites-available directory. Similarly when a configuration file in sites-available is symlinked, the site configured by it will be active once Apache2 is restarted.
Use this command:

sudo a2ensite yourdomain.conf

Now restart apache and it should all work:

sudo service apache2 restart
  • Thanks @CrypticDesigns appreciate your response, i've done exactly but the domain still showing "Apache2 Ubuntu Default Page", i'm running Flask Application (Python) on this directory var/www/FlaskApp.

    Any other approach or what's missing? Thanks

Have another answer? Share your knowledge.