The goal of this lab is to setup our development environments, to understand the difference between web browsers and web servers, and to understand the more general concept of local vs. remote in web development.
This is an individual lab. Since individual environments must be configured, you will not have a partner. You will work with a partner starting next week.
Consider making Chrome your default web browser. And, consider downloading and installing Chrome on your own laptop or desktop computer.
While Firefox is a good web browser, it's code inspector is different than Chrome's. We will be using Chrome's code inspector often and you may become frustrated if your inspector is different.
Safari and Edge have improved greatly over the years, but these browsers do not yet have proven developer tools available.
Never use Internet Explorer; It is an outdated, buggy browser that does not follow standard conventions.
The conventions below help reduce broken links and "file not found" errors. Please read below and follow a consistent convention.
MyPage.html
, Mypage.html
, mypage.html
and
myPage.html
all have different names.
You can avoid many broken links and "file not found" errors, by following a strict convention.
I recommend strictly using lower case letters for all folder and file names.
By default, Windows will hide file extensions, which makes it difficult to tell the difference between files with the same name that are actually different files with different file types,
i.e., home.html
and home.php
. The following instructions will enable you to see all file extensions.
You will be creating a lot of files in this course, it is important to keep them organized and to put them on your user drive (Z:) so you can access them from other computers.
csis390/
.csis390
folder, create a folder for storing your lab work, i.e.,
csis390/labs
.labs
folder, create sub-folders for all 12 labs, i.e.,
lab2, lab2, ..., lab12
.csis390
folder, create a folder for storing your project work, i.e.,
csis390/projects
.projects
folder, create sub-folders for all 4 projects, i.e.,
project1, project2, ..., project4
.While the files on your z: drive are stored on a remote file server at Siena, your z: drive is "mapped" locally when you login.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Web Page Title</title> </head> <body> <h1>Level 1 Heading</h1> <p>A sample paragraph</p> </body> </html>
starter.html
in z:/csis390/labs/lab1/
lab1
folder.starter.html
to open the file in your default web browser.
If Chrome is not your default browser,
consider making Chrome your default web browser.
starter.html
and look for an option to open the file in Brackets.Be sure to store all of your lab and project work in the correct folders, so you can easily locate files.
HTML documents (files with .html
file extension) can be opened in two ways:
Use WinSCP to connect to our remote server.
Details about your specific server, userid and password were emailed to you. Here is the general information:
ftp.sienasellbacks.com
or ftp.breimer.net
userid@sienasellbacks.com
or userid@breimer.net
Be sure to replace userid
with your actual Siena userid; But, do not add @siena.edu
labs
folder to your remote server by dragging the folder from left to righthttp://www.sienasellbacks.com/userid
or http://www.breimer.net/userid
into Chrome.lab1
folder and then click on starter.html
to view the HTML document.lab1
folder on both your local and remote side.starter.html
file by dragging it from the left to the right.While this may seem trivial, many students struggle to understand the following concepts:
When testing a web application on a remote server, saving your file is only the first step. You must also upload all the changed files to the remote server and then re-load/refresh the web browser.
Web browsers will stored web pages and web application data locally in cache to improve performance. To ensure that your newly changed code is properly loaded, you should always do a "HARD" refresh by holding down the SHIFT key while pressing the re-load button of the browser. This forces the browser to fetch the updated files from the remote server.
For commercial web applications, developers often use two or more remote servers. A development server is often used to test new code and a production server is used to make the web application accessible to customers and clients.
Some companies and organization also use a staging server and/or a system test server before moving applications from development to production.
In this course, we will only use one server and it will act as a development server. While your files will be publicly accessible, people will not be able to easily find your web applications unless they know the specific URL.
Because development and production web servers often have different domain names or IP addresses, it is important to always use relative hyperlinks for source files and references. You'll learn more about this in lecture.
If you are completely unfamiliar with Git or GitHub, you should have watched these videos.
Skip to the next part if you already have a GitHub account.
Please read this introduction while you wait for your instructor to add you as a collaborator to his GitHub repository.
Please read the following to understand what you are doing at a high level:
You will clone a remote repository call csis390
which is stored on GitHub.com. This will copy the remote repository locally. Then, you will "checkout" the repository and make a branch. Then, you will add a new file and add a link to that file in the index page. Finally, you will commit your changes to your local repository and then push your branch to the remote repository (called "origin").
Pushing your branch will initiate a pull request so the repository owner can merge your branch into the repository. After the repository owner has merged several pull requests to the remote repository, you will update your local repository by pulling the remote repository. This will copy all the changes other students have made from the remote repository to your local copy.
To summarize more briefly, every student will create a file called userid.html
, where userid
is the student's GitHub userid.
Every student will also modify index.html
to link to their unique file.
cd z:
cd csis390/labs/lab1/
lab1
foldergit clone https://github.com/ericbreimer/csis390
csis390
repository to your lab1
foldercd csis390
csis390
repositoryls
userid
with your GitHub useridgit checkout -b userid-additions
student1.html
in Bracketsuserid
with your GitHub useriduserid.html
, where userid
is your GitHub userid.tr
, th
and td
group indicating something else about you, i.e.,
Minor, Favorite Food, etc.index.html
and locate the div
for your correct lab, i.e., Tuesday or Wednesday.userid
with your GitHub useridstudent1.html
, student3.html
, etc. to userid.html
, where userid
is your GitHub userid.git add .
git commit -m "added new file and changed index.html"
userid
with your GitHub useridgit push origin userid-additions
You can read this introduction again while you wait for your instructor to merge some branches.
git pull origin master
ls
index.html
and note that there are many more links. If everything worked correctly, many different people just contributed to a shared repository that represents the class website. This website can be collaboratively developed using GIT, which is superior than using FTP. Unlike FTP, which just copies files, GIT keeps track of revisions and who made them.
The origin repository on GitHub is remote, i.e, you can access it from anywhere; Cloned repositories are local, i.e, they are stored on your local hard drive, which could be a mapped drive. Git is a client-server application and protocol that allows your local computer to communicate with a remote Git server. GitHub is the most popular Git server/service. Another popular Git service is called BitBucket
starter.html
file must be modified (additional paragraph) and uploaded to the remote server.csis390
repository.
Your branch must include a file called userid.html
, where userid
is your GitHub userid.
This file should contain your name and your information.
Your branch will also modify index.html
to link to the file you created.
The deliverables must be "submitted" by midnight on the Monday before your next scheduled lab meeting.