Skip to content

Testing on the Server

Frank Siderio edited this page Mar 22, 2018 · 1 revision

Pre-Permissions

In order to be able to SSH (Secure SHell) into the server, you need to request access from the CIO (who will then request access on your behalf from Marist IT).

How to Connect

In order to use PHP and test on the server there are a few things you need to do:

  1. Make sure you're on Marist Foxnet. If you're using a different wifi network, please download the VPN and connect using that.
  2. Download an SSH (Secure SHell) file viewer so that you can see the file structure like on your computer (Finder on Mac, Windows Explorer on Windows).
  3. Run Cyberduck and click the Open Connection button on the top left.
  4. Click the first drop down menu and make sure you're using SFTP (SSH File Transfer Protocol). The server won't accept any other types of connections.
  5. For the server put sga.dev.it.marist.edu.
  6. For the username please enter your K Account.
    • Find out your K Account. Log In and look at the last part of the URL displayed for you.
    • K Accounts are 5 letter aliases for your Foxmail account starting with k.
    • Tip: You can use this K Account in place of your full first.last1 account name. This means any sort of Marist Login system (CAS) or even Foxmail itself.
  7. For the password please enter the password you use for Foxmail.
  8. Leave Anonymous Login unchecked and leave SSH Private Key to None.
  9. Click Connect.
  10. You should see a path at the top dropdown: /home/<kaccount>
  11. Click that top dropdown and navigate to the root of the server: /

Actually Testing

From here you can see all the folders on the server. The SGA IT Council only deals with a small space. You likely won't have access to modify any of the folders that you see, unless you request permission.

The IT Council's folder path data/sga_webapps/htdocs/
Entry to the actual website home
The test page you're interested in test

In the test folder you should see a bunch of folders with names of the IT Council members. If you don't have a folder with your name on it (literally), please contact the CIO and request one be made for you.

If there is a folder with your name on it, take your local version of the repository (copy the top level files).

Open any of the files in your favorite text editor (obviously Atom), and modify away. Test using

  • http://sga.marist.edu/test/<your name same as the folder>/<path for a file in your directory>

To test the home page:

  • http://sga.marist.edu/test/<your name same as the folder>/pages/index.html

Why Test on a Server?

Running code you write in HTML, CSS, and JavaScript using Chrome or Safari (or some other browser) is what is called Front End or Clientside code, meaning the user's computer (the browser) actually executes the code.

Some websites are only built using front end technologies, and that's just fine. But they tend not to be very dynamic.

We use PHP, which is a Web Scripting language that runs on the server, not the client. This distinction is important. The server runs all the PHP commands before the webpage is even out of the server, so the all the client receives is a normal-looking HTML page with no PHP in sight.

PHP is helpful for dynamically loading information. For example, Facebook's news feed is dynamic. It serves you posts and pictures customized for you, the user. It does this by doing all sorts of Server Side calculations, and then hands off the easy, display-code to your browser to layout.

We use PHP to access a database, which stores most of the information on the website (such as the Officers of SGA and of SGA's clubs). This database access can only occur on our server, which contains the database. The client (Chrome, Firefox, etc.) have no clue about a database; they only see a nicely formed HTML document.

This presents a problem when the people working on the website test on their own laptops, which are distinct from the server on which the website's code runs. SSH allows us to access and modify all the files on the server (if we have access). In this way we can work on our laptops, use Atom or Vim or whatever, and comfortably edit files on the server from anywhere. We test those files by actually going to the url of the server; in this sense, we become both server and client.

tl;dr So PHP and MySQL stuff works. Learn to become both server and client.

Clone this wiki locally