How to Edit the MSU HAWC Website

Accessing the Files:

  1. Log on to the www.pa.msu.edu server, also known as power.pa.msu.edu, using ssh
    • In your terminal, use either command (removing the brackets when you actually enter your username):
      • ssh [username]@power.pa.msu.edu
      • ssh [username]@www.pa.msu.edu
    • Enter your password.
  2. You should now be in your own personal directory. To make sure, enter the command "pwd" and what should be returned is as follows: "/h0/[username]"
  3. **NOTE** To enter the directory with the MSU HAWC website files straight from your personal directory, enter the command "cd ../web/hawcsite/http"
  4. **OR**Follow these broken down instructions:
    • Enter the command "cd .." to go up a directory (/h0 ).
    • Here you will find the "web" directory. Enter the command "cd web" to enter that directory.
    • Enter the command "pwd" to make sure you are in the "web" directory.
    • Now enter the command "cd hawcsite" to enter the "hawcsite" directory, which is in the "web" directory.
    • Now enter the command "cd http" to enter the "http" directory, which is in the "hawcsite" directory.
  5. If you enter the command "ls", you can now see all of the files related to the MSU HAWC website.
    • "index.html" is the home page.
    • The other ".html" files are those with the source codes for their respective pages off of the MSU HAWC site home page.
    • "hawc_papers" is the directory that contains all the files for the HAWC Papers page off of the MSU HAWC website.
      • "papers.html" is the file in this directory with the source code to the HAWC Papers page.
    • "milagro_papers" is the directory that contains all the files for the Milagro Papers page off of the MSU HAWC website.
      • "papers.html" is the file in this directory with the source code to the Milagro Papers page.
    • To exit at any time, enter the command "exit"

Editing the Files:

  1. The best way to edit the files is do to so locally on your own account before transferring over to the official site directory.
  2. To edit a particular page on the MSU HAWC website, first go to that site in your browser.
  3. Right-click on the page and select "View Page Source"
  4. Copy over the code from the window that opened (this window contains the source code for the page you requested it from)
  5. Open an editor (gedit, emacs, etc.) and paste the copied code.
  6. Now, you should give this file the same name as the corresponding file in the official site directory.
    • To do this, you need to follow the instructions regarding accessing the files and locate the file that corresponds to the page you are trying to edit.
    • Remember/take note of the name of that file.
    • Give your local file the same name, saved as an ".html" document.
  7. Now that your file has the same name as the official file, you can edit the source code however you intend to.
  8. Make sure that the web page looks the way you intend it to (by opening it in your local directory).
  9. When you are finished editing the source code, save your document, and you can now copy it over to the official site directory.
    • Make sure you know the path to the official file (i.e. know if it's in the main "http" directory or in one of the subset directories such as "hawc_papers" or "milagro_papers" )
    • Enter the command "scp [file_name.html] [username]@power.pa.msu.edu:../web/hawcsite/http/[...]" where the [...] represents the subset directories if applicable.
      • You could also replace "power.pa.msu.edu" with "www.pa.msu.edu"
      • Remove the brackets when you actually enter the file name and your username.
    • Enter your password.
  10. The official page should now have the changes you have implemented.

Uploading Documents and Adding Links:

If you would like to add a document and a link to it to the MSU HAWC website, follow the instructions below:
  1. Download/Save the file you want to upload and go to the directory/folder that it is located in.
  2. Make sure you know the location of the MSU HAWC website file where the link to this document will be uploaded, as you will copy this document to the same directory as said file.
    • The location must be somewhere in the "h0/web/hawcsite/http" directory (on the www.pa.msu.edu server) or in one of the subset directories.
    • To find the file, follow the instructions regarding accessing the files and locate the file you want to add the document's link to.
  3. In your terminal, still in the same directory as the document, enter the command: "scp [document_name.document_type] [username]@power.pa.msu.edu:../web/hawcsite/http/[...]"
    • You will replace "document_name" with the name of the document, "document_type" with the type of file your document is (i.e. .pdf, .jpg, .doc, etc.), "username" with your www.pa.msu.edu username, and [...] with the remaining path name (i.e. subset directories), if applicable, to the file you will be adding this document's link to.
    • Remove the brackets when you replace this information.
  4. Enter your password.
  5. The document you will be adding a link to should now be in the same directory as the file where you will be adding its link.
  6. To edit the file you are adding the link to, follow the instructions regarding editing the files.
    • To add a link to your document, you will need to add the following line to the desired location in the page source code:
      • <a href="[document_name.document.type]">[Name Of Link To Document]</a>
      • Replace [Name Of Link To Document] with the text that will link to the document and remove all brackets.
      • **NOTE** If you were to simply trying to add a link to another website rather than to a document, the same line of code would be added to the page's source code, but you would replace [document_name.document.type] with the URL of the website you want to link to, and [Name Of Link To Document] would be instead [Name Of Link To Website]
  7. The link to the desired document should now appear on the proper web page of the MSU HAWC website, and when the link is clicked, the desired document should load.
    • If the desired document does not load properly, check for any spelling errors and make sure that the document is in the same directory as the source code of the page that has the link to it.
Topic revision: r8 - 05 Aug 2014, JenniferRanta
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback