Some of you may never apply the techniques in this lecture as you do not have (or do not want to pay to have) access to a root (Administrator) account of a web server
But some others probably already have (e.g. because of Lab2) or will have such access, so this short lecture may contain some interesting knowledge for these students
In Lab2, I have asked each group (a pair/triple at that time) to spin a Digital Ocean (DO) droplet using (the fortunately free GitHub Developer Pack) and to share it among yourself
But once you graduate from NUS, you will not have access to such education pack
How to make web applications that you build in CS3226 live for longer period beyond this semester?
(similarly for your future potential web application(s))
One valid answer: Set up and maintain your own web server
(Note: Not just about using a web hosting service out there)
Some of the Performance and/or Scalability tips mentioned in the previous lecture can only be applied if you have access to the root (Administrator) account of a web server
Otherwise you are basically tied to whatever hardware specifications and/or software libraries that are available in that web server, especially the server-side technologies...
There are two ways:
Once you have access to your own root (Administrator) account of a web server, you can set up the web server, upload your web application files and setup its settings, and let the web application run 24/7
But once a while, you have to maintain your web server as no one else will (or can) do it for you, failing which your web server (and thus your web application) performance will gets slower and slower and its security will get more and more compromised
LAMP = Linux, Apache, MySQL, and PHP
For this lecture note, we will not digress too much and talk about many other web server options out there that I have not tried (WA/IMP*, MEAN, etc)...
Some of you have done this in Lab2:
spinning up a new DO droplet
Things to be considered:
You can now host your web application by copying/uploading your web application files to a certain designated document directory (depends on your Apache setting, the default for Ubuntu 16.04 LTS is /var/www/html
)
The index.html (or index.php) stored in that directory is is the one that will be served when you entered the IP address of your Digital Ocean's droplet in a web browser, e.g. visit http://128.199.68.145 (we will talk about Domain Name registration in the next lecture)
Every year, there are various (new) Linux distro released to public, e.g. the 2016 version
Upgrading the OS (the "L" in the LAMP stack) will likely entail the need of upgrading everything else (the "AMP"), so do such upgrade when there is a (critical) security upgrade (painful verbal story in class)...
As root, you can perform these tasks (not exhaustive):
Likely the no 1 web server software as of 2017
(active sites metric, see this)
As root, you can perform these tasks (not exhaustive):
As a root user, you have a root MySQL account that you should NOT directly use in your PHP (Laravel) script
With that MySQL root account, you can perform the following tasks (not exhaustive):
As root, you can perform these tasks (not exhaustive):
Sooner or later, the Linux distro, the Apache version, the PHP version, and/or the MySQL version that you have will get outdated
When a new version appears, you have to decide whether to upgrade and when to do so...
All the best in setting up and maintaining your own (cloud-based) web server