Webhosting sites provide access to a server. Some universities offer free webhosting to students to support their education. If such a server environment is not provided, some websites offer free webhosting accounts with limited online disk storage. The amount offered by most sites, usually 1500 to 2000 MB, is more than enough for all the code exercises. Some of the exercises in this book can only done through a server. It is important, therefore, to secure resources on a server. All that is needed to obtain an account is an email address. After registering for an account, a message is sent to the email address for verification. Once confirmed through email, the account is activated. There is no need to enter payment information.
Free webhosting accounts are always a subdomain. This means that the web address will be something like http://mikep.podserver.info. The main domain is "podserver.info". If you wanted a web address like http://your_name.com, this would be its own domain that would need to be registered separately. Registering a domain involves a fee. While some sites will advertise that they offer a free domain, they will invariably charge a monthly fee to recoup the cost.
Some countries restrict access to webhosting sites. Most of the webhosting sites lited below cannot be accessed in China. Certain Internet Service Providers (ISPs) and universities in other countries, including the United States, restrict access to some of these sites as well. Although cumbersome, these restrictions can be circumvented using a virtual private network (VPN).
Webhosting services have a standardized interface through what is called the cPanel, or control panel. Although many different tools are offered through the cPanel, only a subset of those will be needed here. Of the tools offered, FileManager is used most often. It is designed to upload, edit, move, rename, and delete files. To complete the assignments in the book, the minimum requirement is to create a MySQL database. Data is uploaded to the database with phpMyAdmin. So, the three online tools that must be present through the cPanel are FileManager, MySQL and phpMyAdmin.
All files that are to be served through the web reside in a specific folder, usually called "htdocs" or "public". A file called "index.htm" in this folder would be displayed by default. If this file is not present, accessing the website may simply list the contents of the htdocs or public directory.
It is usually faster to upload a zipped file. The FileManager in the cPanel may automatically unzip these files on the server. The size of files to be uploaded is usually limited to 4 or 5 MB. FTP clients like FileZilla can upload entire folders in excess of 100 MB.
HTTPS stands for Hyper Text Transfer Protocol Secure. It is highly advanced and secure version of HTTP. Most of the mapping examples here will still work with HTTP but a few require an HTTPS server. All examples that locate the user's position, like those in code20, require a secure server. Free webhosting sites that implement HTTPS are harder to find, and some of these don't offer all of the services needed for the other examples. The following is a webhosting site that provides an HTTPS server for code20:
neocities.org - Offers a free HTTPS website but no cPanel. It would not work for code18 that requires PHP and MySQL
One of the problems in converting from HTTP to HTTPS is that all references to files within the code of a file on an HTTPS server must be to an HTTPS server. This means that you cannot make a reference to a file on an HTTP server from within the code served from an HTTPS server. In general, files created for an HTTPS server will also work from an HTTP server.
HTTP Webhosting with cPanel:
podserver.info - Displays ad bar on bottom of all pages. Can be suppressed with AdBlock browser extension. All addresses need to be prefixed with "www". HTTPS not possible.
infinityfree - cPanel, MySQL and PHP. For HTTPS, you will need to get this SSL certificate from an SSL certificate vendor and install it on your hosting account.
ByetHost - Offers cPanel, PHP and MySQL. SSL Certificates can be added into cPanel for creating an HTTPS site.
GoogieHost - 1 GB of free storage. Can be modified for HTTPS.
fnHost.org - Unable to sign-in to account several days after account created.
7uw.net - Site down and for sale.
HostFree - Needs 48 hours for account activation?
Freeost - Redirects to cpanel.main-hosting.com, then non-English language.
FreeHostingHero - No confirmation email received.
000Free- No confirmation email received.
1FreeHosting - No confirmation email received.
0-Host - No confirmation email received.
FreeHosting - Redirects to ipage.com, asks for money.
Oxhost - No confirmation email received.
My3gb - Doesn't load properly.
3owl - No confirmation email received.
888webhost- No confirmation email received.
000webhost.com - No cPanel.
x10Hosting - No ads or redirects. Nice interface and FileManager and ability to upload files larger than 4 MB. Access to MySQL and phpMyAdmin is difficult. Account is deactivated after one month of non-use (no sign-in). Files over ~20 MB automatically deleted after one day.
yupage.com - No cPanel.
uHostFull - Redirects on missing pages to display inappropriate pictures.
Creating a server through Amazon Web Services (AWS)
Another alternative for webhosting is to use a virtual server through Amazon Web Services (AWS). These can be either HTTP or HTTPS. Amazon Web Services (AWS) is a cloud computing platform provided by Amazon. While AWS does not implement free webhosting directly, it does offer a limited server for one year of use. Since most webhosting software is open-source, all of the necessary software can be installed including the cPanel, Apache, MySQL and php (collectively called a "stack").
AWS offers packages or images to assist with the installation of open-source tools. WebUzo has a LAMP stack Single User Control Panel. LAMP stack is a popular open source web platform commonly used to run dynamic web sites and servers. It includes Linux, Apache, MySQL, and php/Python/Perl. While AWS servers are very stable, a disadvantage of the service is that a credit card must be used to activate the account. It is best not to provide a credit card unless you are willing to eventually pay for services.
Building your own Server
Finally, it is also possible to create a server using your own hardware. Servers generally don't require a fast processor or a lot of memory — and certainly no graphics card. The software is generally free, especially for Linux and Macintosh. The only requirement is that you have a static IP address and can register the site with a nameserver, a computer that translates domain names into IP addresses. Otherwise, you'll need to always type the numeric address, like http://22.214.171.124 - and that's hard to remember.