Web Hosting at UNBC

What is web.unbc.ca

Web.unbc.ca is a basic web server which serves content from the public_html directory within all UNBC user H: drives.  It can be used to make small files available for download over the web or to host basic HTML/PHP web pages.  The amount of content that can be hosted is limited by the individual's H: drive quota and can be accessed at https://web.unbc.ca/~<username> (For example if your username is john the URL would be https://web.unbc.ca/~john)

 

How to Set Up My web.unbc.ca?

Setting up your own web.unbc.ca content takes two steps.  These steps will require you to access your H: drive on gpu.unbc.ca or to connect to your H: drive with a program which allows you to adjust the permissions such as WinSCP. Note that in these steps I am referring to the root of your home drive. This is a bit unintuitive as the H: drive which is automatically mapped when you log in to a UNBC Windows machine is actually a subfolder within your full home drive:

  1. Create a public_html folder within your home drive.  This folder should owned by your username and allow read and execute by all parties while only the owner is allowed to write.
  2. Place the files you would like to host in your public_html folder within your home drive.  These files should be owned by your username and allow read by all parties while only the owner is allowed to write 

Once this is done your content should be available at https://web.unbc.ca/~<username>.  See the examples below for more details on how to make the changes listed above.

 

File Sharing vs Hosting a Website Examples

Below are two common use cases for web.unbc.ca and some very basic examples.  In these examples I am using a student user account with the username 'storie'.

Making Files Available for Download

In this scenario we have a file, researchResults.txt, which we would like to make available for download over the Internet.  The process to do so is as follows:

  1. If it does not already exist, create the public_html folder
    • On gpu.unbc.ca

  • Using WinSCP, connecting to gpu

  • Then creating the public_html folder

  • Place researchResults.txt within the public_html folder and adjust its permissions
    • On gpu.unbc.ca

  • Using WinSCP

  • Browse to your web.unbc.ca url to test the file's availability.  You should be able to click the file to open it or Right Click -> Save Link As... to download it.

Hosting a Basic Webpage

In this scenario we will create a basic HTML web page and then show a basic php script which can give details on the version of php.

  • If it does not already exist, create the public_html folder (see step one of the first example for instructions)
  • Create index.html with some basic content.  Ensure the permissions are set the same as in the previous example
    • On gpu.unbc.ca

  • Using WinSCP

  • Browse to your web.unbc.ca url to check the results

  • Create php-test.php with the following content
    • On gpu.unbc.ca

  • Using WinSCP

  • Browse to web.unbc.ca/~<username>/php-test.php to see the result of the php script

​​​​​​​

These webpage examples are extremely basic.  There are a multitude of guides available online with more in-depth examples for simple HTML/PHP web pages.  If you require more complex web page features please contact ITS support and we can discuss options.

Patching and Downtime

Web.unbc.ca is hosted on multiple servers behind a load balancer.  This means that we are able to keep web.unbc.ca accessible when individual servers require downtime and maintenance.  However web.unbc.ca should not be used for critical web pages without first contacting ITS support so that we can determine how best to fit your requirements.  

Details

Article ID: 1179
Created
Tue 4/27/21 1:16 PM
Modified
Thu 4/29/21 10:54 AM