TCNJ Server Setup

Going Public

This is a one time setup. If you've already completed this you can kick back for a few minutes.

We'll need to use a terminal prompt, but it should work from your laptops as well as the lab computers.

Terminal.app is included with all versions of macOS. You'll find it in the Utilities folder, inside the system Applications folder. Pull up Spotlight and search, of from the Finder, select Go > Utilities in the menu bar (CMD+Shift+U for short) and open Terminal.app.

You'll get a small window with a prompt ending in a $.

The terminal is a very powerful way to control almost every aspect of your computer, but it's not very forgiving. Type the following commands exactly as they appear here, replacing yourusername with your TCNJ email/unix login.

  1. Type ssh yourusername@beauty.tcnj.edu and hit enter.
  2. You may be asked to add this server to your list of "known hosts". This is safe to do since it's your first time connecting, so type yes and hit enter.
  3. Next you'll be prompted for your password, which is the same as normal. There are no password characters ( or ) in the terminal, so nothing will happen while you're typing the password. Hit enter.
  4. If it worked, you should get a welcome message and see a new, slightly different terminal prompt. You are now remotely logged in to the server beauty.tcnj.edu under your given username.
  5. Everyone is locked into their own user's "home" folder, represented by a tilde ~. There isn't too much you can do harm the server, and your files are all private.
  6. TCNJ has a custom script for setting up your web server, so all you have to do is type wwwsetup and hit enter.
  7. When it's finished, open your browser and check to see that a dummy index page has been created for you. Your web space is visible on the internet at http://www.tcnj.edu/~yourusername
  8. If it worked, you can return to the terminal prompt and hit CTRL+D, which will disconnect from the server and return you to your regular prompt. That's it!

From now on you'll access your servers through FTP, which is much friendlier to use. Check the glossary page of FTP Instructions on this site for the details.

Local or Remote

Files can either be local or remote. Local files exist on our computer, offline, where we'll spend most of our time working and testing. Remote files are stored on a server, where the web site can be publicly accessed. When you make changes or updates to your local files and they are polished, working, and ready to go "live", you'll upload them to the remote server so the world can see them.

When working with a web server, it's always best to follow these two general rules:

  • Remote file structure should always mirror local file structure. Mirroring simply means that the folders and files on your server should always be organized exactly the same as on your computer. This helps prevent broken links.
  • Never edit remote files directly. While it's entirely possible to edit the files and work directly off of your remote server, it's almost never a good idea. Editing two sets of the same files - online and offline - becomes very confusing. Always edit your files locally, on your computer, and "push" the updates to your server.