Using Our Server
We use a Linux server at sanbox.mc.edu to host web pages. Linux is a Unix clone. For this class, we need only be able to transfer files to the server so they will be available online. You also have access to the Unix shell, though its use is optional.
  1. Sandbox
    1. Sandbox is server which we use to provide web pages to browsers.
    2. Sandbox runs Linux, a Unix clone.
    3. It is only necessary only to be able to transfer files to the server, but knowing a bit about how to use it directly can be helpful.
  2. Accounts and web service.
    1. For this class, you will use regular user accounts on Sandbox. This is different from the web account used in the CSc 114 class.
    2. Each user has a password-protected account.
    3. Each account has a home directory for storing files.
      1. “Directory” is the same thing Windows calls a “folder.” Just a collection of files.
      2. Individual home directories keep a user's files together and apart from those of other users.
    4. Web directory.
      1. To publish a file on the web, place it in a sub-directory called local_html. Files outside of local_html are not published.
      2. A file called somefile.sometype stored in local_html by a user someuser is available online by the URL http://sandbox.mc.edu/homes/someuser/somefile.sometype, or by the more old-fashoned http://sandbox.mc.edu/~someuser/somefile.sometype
      3. If you create a subdirectory (sub-folder) inside local_html, its contents are also visible online, and the directory name becomes a component of the URL. If user smith creates a folder proj under local_html, and places the file idea.html inside proj, the URL would be http://sandbox.mc.edu/~smith/proj/idea.html.
      4. You may also access your files via the secure protocol, https.
    5. Files outside the local_html directory are not accessible to the web server.
  3. Transferring files from Windows with WinSCP. (This is how you make your files available on-line.)
    1. A common way to place files on a server is using the FTP protocol. You shouldn't use FTP for this, however. On Sandbox, FTP only works with simple web accounts used for CSc 114.
    2. You should use the SFTP or SCP protocols, and WinSCP is an excellent client client for them.
    3. When you open WinSCP the first time, you will see something like this:
    4. Click New, and fill out the form with the name of the server (sandbox.mc.edu) and your account name. You may fill in your password here, else it will ask you when you push login.
    5. Push Login. The system will ask for your password if you didn't give it earlier. Then it will show you a listing of the files on your account.
    6. Right-click, choose New, and then Directory. You will get a dialog asking for the directory name. Type local_html and say ok. You will now see the new folder in your list.
    7. WinSCP shows the listing of files in your server folder. You can navigate it just like the local file system.
    8. You can transfer files to and from the server by dragging them in the usual way. The only difference is that WinSCP will raise a dialog asking if you want to copy the files. Just tell it yes.
    9. If you wish, on the second screen shown above, you can fill in your password and push Save. This will save this information on your computer, and you will be then able to select it from a list on the first screen, so you won't need to type everything again. You probably don't want to do this on a public computer.
  4. An alternative to WinSCP is FileZilla, which also has a Mac version.
  5. Both Linux and Mac clients come with the scp terminal command, which allow quick transfers without needing a GUI client. You can get the similar pscp program for Windows from the putty web site, mentoned below.
  6. For this class, you only need to be able to copy files to the server. You may edit and manipulate them on any platform you like. But your Sandbox account gives you access to a Linux shell, if you want to use it. Here is some information about that.
    1. Login
      1. From a Linux, Unix or Mac client, use the ssh program from the command window.
        1. Say ssh userid@sandbox.mc.edu
        2. It will ask for your password, which will not be displayed as you type.
        3. Get that right, and you're in.
      2. From Windows, use the free program putty to connect to Sandbox.
        1. Double click it. Fill in the name of the computer to connect to, sandbox.mc.edu.
        2. Set the protocol to ssh.
        3. Press Open.
        4. Sandbox will ask for your login name and password. Note that the password does not display as you type it.
        5. It will then show you a command prompt for using the system.
    2. Change your password.
      1. To change your password, give the command passwd.
      2. It will ask for your existing password (to make sure you are you), and your new password twice (to make sure you can type).
      3. The new password will be used for both file transfer and login.
    3. Working with files.
      1. You can use a text editor to create a file
        1. Most common one is called pico. Just say pico.
        2. It's like the Notepad program, but you must use the keyboard for everything.
        3. Pico shows you the command keys at the bottom of the screen. The notation ^X means to hold down the control key and press x.
      2. Listing files: ls for all of them, or ls filename.
      3. Viewing files a screen full at a time: less filename
      4. Copying files: cp oldname newname.
      5. Renameing files mv oldname newname. (The mv stands for “move.”)
      6. Deleting files: rm filename. (The rm stands for “remove.”)
      7. Finding out about commands: man commandname, or man -k subject to do a search.
    4. Directories (folders).
      1. The command shell always has a “current directory”. The files you view or create are there.
      2. When you log in, you are in your home directory. The cd command will change that.
      3. Say cd local_html to go to your web directory.
      4. Use pico to create this file as test.html:
        <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello</title> </head> <body> Greetings, earthlings! </body> </html>
      5. Point your browser at http://sandbox.mc.edu/~yourid/test.html
      6. You can create directories with the command mkdir dirname.
      7. You can move up from a directory to its parent with cd ..