Editing the group website: Difference between revisions

From Powers Wiki
(Created page with "The group website is located on [http://bionmr.unl.edu bionmr], in a typical LAMP configuration. The server has no [[:Wikipedia:Network_F...")
 
No edit summary
Line 1: Line 1:
The group website is located on [http://bionmr.unl.edu bionmr], in a typical [[:Wikipedia:LAMP_(software_bundle)|LAMP]] configuration. The server has no [[:Wikipedia:Network_File_System|NFS]] or [[:Wikipedia:Server_Message_Block|Samba]] access, so the only way of editing pages is with '''vi''' via an '''ssh''' login. Also, as it has no [[:Wikipedia:File_Transfer_Protocol|FTP]] access, the only means of uploading files is '''scp'''. Fear not! These methods are more secure. This page details how to edit the group website.
The group website is located on [http://bionmr.unl.edu bionmr], in a typical [[:Wikipedia:LAMP_(software_bundle)|LAMP]] configuration. The server has no [[:Wikipedia:Network_File_System|NFS]] or [[:Wikipedia:Server_Message_Block|Samba]] access, so the only way of editing pages is with '''vi''' via an '''ssh''' login. Also, as it has no [[:Wikipedia:File_Transfer_Protocol|FTP]] access, the only means of uploading files is '''scp'''. Fear not! These methods are more secure, and are just as simple as those you already use. This page details how to edit the group website.
 
=ACHTUNG=
'''Please edit files on the website with ''extreme caution and respect''! Make sure you don't overwrite or delete files unless you're absolutely certain it's OK to do so.'''
 
=General website access=
You can log into the server and send files to the server with the '''ssh''' and '''scp''' commands, respectively. The following subsections detail how to do so.
 
==Logging into the server==
Logging into [http://bionmr.unl.edu bionmr] is identical to logging into [http://bionmr-c1.unl.edu bionmr-c1]. You'll need the same RSA key, username and password. If you're on linux, you're already set up:
 
ssh bionmr.unl.edu
 
On windows, you'll need to copy the PuTTY session to a new name, and edit the hostname to ''bionmr'' instead of ''bionmr-c1''.
 
==Uploading files to the server==
Pushing files to [http://bionmr.unl.edu bionmr] is done using the '''scp''' program, a remote file copy program similar to '''rsh''', but secured through [[:Wikipedia:Secure_Shell|SSH]]. To send a file to the server, use the following command (from a linux workstation):
 
scp /path/to/local/file bionmr.unl.edu:/tmp
 
Once you've logged into the server, the file(s) will be located in '''/tmp'''.
 
=Editing the website=
 
==Directory structure==
The website data is located in '''/var/www/localhost/htdocs'''. Documents available on the top-level of the server are found here (e.g. [http://bionmr.unl.edu/nmr.php http://bionmr.unl.edu/nmr.php] will be '''nmr.php'''). A few special subdirectories exist here that you need to know about.
 
===courses===
The '''courses''' directory contains files for courses, rather unsurprisingly. Each subdirectory of '''courses''', such as '''courses/chem116''' has a file called '''content.php''' and directories organizing course content into groups like '''exams''', '''lectures''' and '''information'''. The directory names there are not set in stone; you just have to edit the '''content.php''' file to link to them, as detailed below.
 
===files===
The '''files''' directory contains non-image files that can be downloaded from the website. This directory contains a subdirectory for each top-level page, so if I make a link to a file called '''mydoc.pdf''' in '''proteins.php''', the file will reside in '''files/proteins/myfile.pdf'''. More on this below.
 
===images===
The '''images''' directory contains image files. Images in each top-level page will be located in their own directory, named after the page, just like stuff in '''files'''. Sensing a theme, yet? ''':)'''
 
===include===
The '''include''' directory contains a library of [[:Wikipedia:PHP|PHP]] code that is used by pages in the top-level. Unless you're adding publication information to '''include/publication.php''', you probably won't need to edit anything here. Steer clear of here, ya hear?
 
==Template styling==
The pages in the website derive their style information from the [http://wdn.unl.edu UNL Templates], based on a [[:Wikipedia:PHP|PHP]] [[:Wikipedia:PEAR|PEAR]] framework provided by UNL. A good reference on the templates can be found [http://wdn.unl.edu/resources here]. However, while it's good to understand certain aspects of the UNL templates (e.g. content layouts), you ''will not be writing any [[:Wikipedia:HTML|HTML]]'', so don't bury yourself in the details there.

Revision as of 18:44, 25 June 2012

The group website is located on bionmr, in a typical LAMP configuration. The server has no NFS or Samba access, so the only way of editing pages is with vi via an ssh login. Also, as it has no FTP access, the only means of uploading files is scp. Fear not! These methods are more secure, and are just as simple as those you already use. This page details how to edit the group website.

ACHTUNG

Please edit files on the website with extreme caution and respect! Make sure you don't overwrite or delete files unless you're absolutely certain it's OK to do so.

General website access

You can log into the server and send files to the server with the ssh and scp commands, respectively. The following subsections detail how to do so.

Logging into the server

Logging into bionmr is identical to logging into bionmr-c1. You'll need the same RSA key, username and password. If you're on linux, you're already set up:

ssh bionmr.unl.edu

On windows, you'll need to copy the PuTTY session to a new name, and edit the hostname to bionmr instead of bionmr-c1.

Uploading files to the server

Pushing files to bionmr is done using the scp program, a remote file copy program similar to rsh, but secured through SSH. To send a file to the server, use the following command (from a linux workstation):

scp /path/to/local/file bionmr.unl.edu:/tmp

Once you've logged into the server, the file(s) will be located in /tmp.

Editing the website

Directory structure

The website data is located in /var/www/localhost/htdocs. Documents available on the top-level of the server are found here (e.g. http://bionmr.unl.edu/nmr.php will be nmr.php). A few special subdirectories exist here that you need to know about.

courses

The courses directory contains files for courses, rather unsurprisingly. Each subdirectory of courses, such as courses/chem116 has a file called content.php and directories organizing course content into groups like exams, lectures and information. The directory names there are not set in stone; you just have to edit the content.php file to link to them, as detailed below.

files

The files directory contains non-image files that can be downloaded from the website. This directory contains a subdirectory for each top-level page, so if I make a link to a file called mydoc.pdf in proteins.php, the file will reside in files/proteins/myfile.pdf. More on this below.

images

The images directory contains image files. Images in each top-level page will be located in their own directory, named after the page, just like stuff in files. Sensing a theme, yet? :)

include

The include directory contains a library of PHP code that is used by pages in the top-level. Unless you're adding publication information to include/publication.php, you probably won't need to edit anything here. Steer clear of here, ya hear?

Template styling

The pages in the website derive their style information from the UNL Templates, based on a PHP PEAR framework provided by UNL. A good reference on the templates can be found here. However, while it's good to understand certain aspects of the UNL templates (e.g. content layouts), you will not be writing any HTML, so don't bury yourself in the details there.