How do I set absolute path of index.html in ubuntu 14.10, apache2, golang 1.3.3

October 29, 2014 1.8k views

My index.html file is locatedvar/www/html/templates/

How do I setup absolute path of my index file to load from this folder?

1 comment
  • what is your website root? I am guessing /var/www/html

    do you want your website root folder to be /var/www/html/templates

1 Answer

You have 2 options, really. You can either modify your vhost config (/etc/apache2/sites-enabled/000-default or default for Ubuntu/Debian, or /etc/http/conf/httpd.conf for Centos/RHEL/Fedora), or create a rewrite. Rewrites are heavier on system load, so I would recommend that you use the vhost modification, if you will never use resources from /var/www/html/, and will only serve content from /var/www/html/templates/

  • This is a clean boot of ubuntu 14.10 with apache2, and I am finding that the /etc/apache2/sites-enabled/000-default.conf is just a empty folder.

    But I was able to find 000-default.conf file in sites-available folder instead, so I'm just a little confused if this is the right location to modify the file or to create a new 000-default.conf file and import it to sites-enabled?

  • it's already imported, so editing it in sites-available will do fine.

  • Thanks, that's what I was thinking.

  • After making the change, don't forget:

    service apache2 reload
Have another answer? Share your knowledge.