Interacting With HE Hosting
HE doesn't tell you which tools to use. That is completely up to you. You should be using the best tools possible.
In this article I cover the various technologies that work together to deliver a website to an end-user and popular programs for interacting with them.
The Server
HE hosting provides you with a user, disk space, database, email, and an IP address on a server. Whether you have a domain name or not that space and database always exist and is always accessible.
Your User
Having a user on a server is like a user account on a home computer. When you log in you are brought to your home folder, which contains all of your files and restricts other users from accessing them.
Inside your home folder is a folder called "public_html". That is often referred to as the webroot or docroot. Anything in that folder is considered public and anyone connected to the internet can make a request for files stored in your webroot. Sensitive files should not be stored in it.
Your IP Address
The IP address assigned to your account is your account's internet address. It is used to reach the files in your webroot. When a domain is typed into a web browser it is silently converted into an IP address behind the scenes. But the domain isn't necessary. You can just as easily use the not-so-human-friendly IP address.
For example, www.he.net has the IP address 216.218.236.2 (pronounced 2-1-6 dot 2-1-8 dot 2-3-6 dot 2). So another way to reach the HE website is by the IP. Try it yourself. In the browser, open a new tab and type in http://216.218.236.2.
For those on IPv6, the IPv6 address works too. Go to http://[2001:470:0:503::2]. IPv6 needs the square brackets.
I am not saying domains are useless, just that the files on the server don't cease to exist when your domain name expires.
Your Database
The database is for executing structured queries that read and write structured data. Data is important to business. It should be handled with care. We'll cover the database in more detail later on.
Interacting
I'll just say it. If you aren't using a command-line shell you should be. No matter your skill level, learning to use the shell is one of the most productive choices a developer can make.
Linux Shell
A shell gives a user access to an operating system's services. Command-line is an interface that prompts the user for text commands.
The command-line shell is a way for a human to issue commands to a computer via text. Since it is all done in text it is extremely useful for working remotely or across various types of computers.
Examples of command line shells are the Windows Command Prompt and Windows Power Shell and Unix-like's Bourne Shell, Bourne Again Shell, and Z shell.
When I say shell I am referring to the unix-like shells of which the Bourne Again Shell (bash) is extremely popular, but any of them work for issuing commands.
Using Shell
Using a shell to connect to your HE webserver account is different depending on your computer's operating system.
Mac/Linux
Mac and Linux come with the program "Terminal"
Windows
Windows users need to download a program called "PuTTY". It is a free program that can be downloaded at https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
Accessing the Server
Use SSH to log into the webhosting account.
ssh username@example.net
"ssh" is the command to execute the SSH program. "username" is your username and "example.net" should be replaced with the server name.
Your first time accessing the server with SSH will give a warning.
The authenticity of the host can't be established.
Are you sure you want to continue connecting (yes/no)?"
This is expected. Read the article about security certificates and fingerprinting for more information about this warning, otherwise type "yes" and press enter.
You will be prompted to enter your password. When typing in the password it will appear as if nothing is being typed. Finally, press enter.
Successful logins will print information about mail and the last login and give you a command line for typing like:
No mail.
Last login: Mon Jan 28 05:47:43 2019 from he.net
user@example.net:~$ |
Basic Shell Commands
To see the manual for a command use the `man` command. Even `man` has a manual.
man man
To see the current directory you are in use the `pwd` command.
pwd
To see the files in the current directory use the `ls` command.
ls
To change to a different directory use the `cd` command.
cd /some/other/directory
With the shell we can move, copy, delete, upload, and download files on the server anywhere there is a computer with an internet connection. The shell allows for tasks ranging from stupidly simple to amazingly complex. We can even use it to run Secure File Transfer Protocol (SFTP) if we wanted. But why would we? We have the shell.
Start learning the commands one at a time. It is a powerful tool every developer should learn to use. We covered some basic commands. The article on using the shell covers it more in-depth.
Browsers
People have gotten familiar with the browser applications that come standard on any computer and provide an extensive Graphic User Interface that gives users a rich and secure experience on the internet. Examples include Chrome, Firefox, Safari, Opera, and Edge. If you are still using Internet Explorer it is time to switch browsers.
There are many more browsers designed for accomplishing different goals. For example, there are full-fledged browsers for the command-line like Lynx. There's wget and cURL, which aren't full-on browsers, but can generate HTTP requests to view websites and download files from the internet.
There are browsers designed for privacy like Tor, browsers for hacking, browsers for testing, and headless browsers for computers to use instead of humans. Browsers are a tool that every developer should know how to use.
HTTP Requests Via Shell
Every so often I need a file from somewhere on the internet to be on the webserver. Rather than download the file from the internet to a local computer and then upload it from the local computer to the webserver I can use the shell on the webserver to download the file directly to it.
cURL and wget are useful for that reason. They are mostly the same so you can choose one and stick with it, knowing that the other is available in a pinch. I tend to stick with cURL. Here is an example of using cURL to download a file.
curl -O http://blog.jschmedes.corp.he.net/images/jason-he-blog.png
"curl" tells the shell to run the cURL program. "-O" is a flag to tell cURL to save the file. And the URL is the file I am requesting. In this case it is the logo image on this page.
Another use case that occurs frequently is viewing a webpage's source. Sometimes it is useful to control the HTTP request that is generated or to not have to worry about javascript attempting something malicious. With cURL the request can be modified to have additional header information or provide a different user agent string or send the request to a different IP address than DNS says to use. Having complete control is useful during development.
Browser Developer Tools
Browser applications these days come with powerful tools for development built in. Every developer should know how to access the tools and the information they offer.
Sometimes a piece of a page just isn't working, or it works in one browser, but not another. The console tool shows errors and warnings issued by the browser when it loaded the page. The error could be that a javascript was blocked because of mixed-content or that an XHR request failed with a 500 error. It isn't important to understand all of it, just that the browser provides powerful tools for debugging.
Other tools include the ability to view and even edit the source code, run javascript, view the requests for page resources along with the resource sizes and whether it was from cache. You can see timing and performance data, cookies, local/session storage, workers -- nearly anything about a website. Any website.
Try it now. Open a browser, navigate to your favorite website, and open the browser's developer tools to take a peak under the hood.
For example, the CSS on this page can be played with using Chrome's developer tools:

MySQL Database
Databases can be connected to in different ways. The shell, desktop applications, and web applications all can connect to, query, dump, and restore a database.
Remember the four main database interactions with the mnemonic CRUD. Data is (C)reated, (R)ead, (U)pdated, or (D)eleted.
Databases will be covered more later.