| ||||||||||||||||||
| ||||||||||||||||||
| ||||||||||||||||||
Getting Started with Windows Azure (Linux) Virtual MachineIndexGetting Windows AzureThanks to a grant from Microsoft, you will have 6-month free access to Windows Azure, which allows you to run a virtual machine in the cloud for the assignments and project in this class. At the beginning of the semester, you will receive an email from the instructor with a Windows Azure "passcode." Visit http://www.windowsazurepass.com/ to redeem your passcode. You will be prompted to create a Microsoft account if you do not already have one. You will be notified via email when your free access is granted in a couple of days. Because of this delay, do NOT wait until the last minute to get Windows Azure for your assignment! Setting up the virtual machineCreating the virtual machineGo to https://manage.windowsazure.com/ and sign in with your Microsoft account.
Setting up after logging into the virtual machineUse your favorite SSH client to log into the machine you created (if you are unfamiliar with SSH and shell, read below for tips first). The first time you log in, run the command "sudo apt-get upgrade" to update the operating system. When finished, run "sudo shutdown -r now" to reboot the machine. You will have wait for a while before it is ready again to accept remote login.
After updating the operating system, SSH into the machine again---this time to set it up for the course. Issue the following commands in order:
ADVANCED USERS ONLYInstead of using Windows Azure, you are welcome to use your own server for assignments and project. In this case, just download the file dbcourse.tgz (see above for its URL). Once you download that file, untar it and explore the directory install/ to see what needs to be installed on your own server. Tips on using (Ubuntu) LinuxIn the following, HOSTNAME refers to the fully qualified host name of the virtual machine (e.g., dukedb-junyang.cloudapp.net), and USER refers to your user name (e.g., azureuser). Logging in using SSHYou can use an SSH (secure shell) client to access HOSTNAME. Depending on the computer from which you work, the choice of SSH client varies:
Once you login, you will be inside a "shell" with a command-line interface. See below for more tips on how to work in the shell. Shell basicsA lot of your work will be done from within a "shell" (more precisely, a bash shell) on HOSTNAME. The shell has a command-line interface. When it is ready for your commands, it displays a shell prompt. On our virtual machine, it has the form USER@HOSTNAME:current_path$, where current_path tells you where you currently are in the directory (folder) hierarchy. For example, the prompt may be azureuser@dukedb-junyang:~$; here, ~ stands for your home directory. You type in a command, hit return, and the command will execute. When the command finishes, the shell gives your another prompt. If a command hangs and you want to stop it, ctrl-c will usually do the trick. If you are new to shell, please check out this tutorial (link) for beginners. At least go through the sections "Navigation," "Looking Around," and "Manipulating Files." We highly recommend going through the entire tutorial; it is not that long. A useful (but potentially damaging) command is sudo, which gives you the power of the root user (a.k.a. the superuser). "sudo command..." will execute "command..." as root. Normally you shouldn't need to use sudo often, but it is often required when you need to install something or access some protected files from the shell. For example, to look at the protected file /etc/tomcat6/tomcat-users.xml (which contains Tomcat manager account passwords), you will need to run "sudo less /etc/tomcat6/tomcat-users.xml". For security, sudo will verify your password every now and then. To edit text files and code, you can use nano. In a shell, use the command "nano filename" to edit a file. More powerful editors include vim (also preinstalled on our virtual machine) and emacs. Read the section on maintenance and software installation below for instructions on how to get alternative editors on your virtual machine. Working with remote files on your local computerYou can use FileZilla (free from Duke OIT) to transfer files between HOSTNAME and your local computer. For example, to submit files on HOSTNAME for grading, you can first use FileZilla to download them to your local computer, and then use a browser on your local computer to submit them via the course website. If you hate using editors on HOSTNAME inside an SSH client window, then with FileZilla (or other similar programs), an alternative workflow is to create/edit code or input files on your local computer (using whatever your favorite editor is), use FileZilla to upload them to HOSTNAME, use the SSH client to work with these files on HOSTNAME, and then use FileZilla to download any output files from HOSTNAME to your local computer. You will need to remember to synchronize the files constantly and appropriately, however. Yet another possibility with FileZilla is to use its built-in file editing future. You will need to enable it explicitly under settings; make sure you choose to "watch locally edited files and prompt to upload modification." Once enabled, this feature allows you to select a remote file in the FileZilla interface and view/edit it in-place. Maintenance and software installationYou may need to periodically update the operating system and software on your virtual machine to keep it safe from attacks. When you login, you may see a message informing you that some number of "packages can be updated." If that is the case, issue these commands:
Looking for a particular software? Visit http://packages.ubuntu.com/ to browse/search for it. Once you find the "package name" for the software that you wish to install (say emacs), go into the shell and issue the command "sudo apt-get install emacs". |
||||||||||||||||||
Last updated Wed Sep 11 10:18:07 EDT 2013 |