Difference between revisions of "Host a static site on Dubsdot"

From CSLabsWiki
Jump to: navigation, search
(Initial Tutorial for hosting a static site.)
(VirtualHost)
 
Line 14: Line 14:
 
         ServerAlias foobar
 
         ServerAlias foobar
 
         DocumentRoot /var/www/foobar
 
         DocumentRoot /var/www/foobar
         <Directory /var/www/testing>
+
         <Directory /var/www/foobar>
 
                 Order allow,deny
 
                 Order allow,deny
 
                 Allow from all
 
                 Allow from all

Latest revision as of 20:32, 29 January 2016

This is a tutorial on how to take a static HTML website and host it on our webserver, DubsDot

Directory

First, a folder needs to be created on DubsDot for all of your files to be located in. By default, this should be in /var/www/. Then, place all relevant files into the directory. The directory and all contents need to be both the user and group of www-data. This should be the requirements for setting up all files needed

VirtualHost

Next is setting up the config file for a virtual host. in /etc/apache2/sites-available/, create a foobar.conf where foobar is the name of the subdomain. The template for the config file is below

<VirtualHost *:80>
        ServerName foobar.cslabs.clarkson.edu
        ServerAlias foobar.cosi.clarkson.edu
        ServerAlias foobar
        DocumentRoot /var/www/foobar
        <Directory /var/www/foobar>
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Then run a2ensite foobar and apache should be hosting the site now.

DNS

The final step is to set up DNS so one can navigate to the website. ssh into Talos and in the /etc/bind/db.cosi and /etc/bind/db.cslabs files, add the line under the CNAME section.

foobar			IN CNAME	dubsdot

As with usual DNS, increment the serial number at the top of the document and reload it with rndc reload. If everything works out, you can go to the domain specified and the page should be up.