Using the ECN Web Group Server

This document describes how to create and maintain an “entity” web site under the Purdue University Engineering Web Cluster, https://engineering.purdue.edu.

The Engineering web cluster serves pages for individual users, as well as research and academic groups. Web pages for research and academic groups are called “entities”. This document focuses on the “entities” aspect of serving web pages on a server that has strong provisioning for file and execution security.

The first step toward creating and maintaining an entities web site is requesting the creation of an entity from the ECN webmasters or ECN site specialists. Requests can be made using the ECN Web Hosting Request form.

Applications can be developed for an entity in two ways: Apache served applications using CGI programming, or Ruby-on-Rails served applications. Be sure to indicate which type of application environment is needed when making the request for a new entity.

URL Structure

The Engineering Web Cluster uses a unified addressing scheme for user and entity type web pages. User web pages have a URL that begins with a “tilde” character, then the user's login-ID:

https://engineering.purdue.edu/~user/

Research and academic groups have a URL that begins with an entity identifier, without the “tilde” character:

https://engineering.purdue.edu/entity/

Directory Structure

Entity web pages are stored in the filesystem using a path to a web group directory located at /web/groups. The full name of the directory will include the entity name, such as /web/groups/entity.

Inside of the entity directory will be three types of directories:

  • A public_html or railsapp directory for all files that will be made publicly available by the web server,
  • A private directory for private storage,
  • A var/logs directory that will contain the log files for all web server file transfers (access_log) and error messages (error_log).

The directory structure looks like this:

Directory Structure Guide

Both Apache and Ruby-on-Rails runs as the user-ID of the entity - Any files stored in the public_html or railsapp directory will need to be readable by the entity's user-ID. For security purposes the top level directory, /web/groups/entity, is set to be accessible only by the entity's user-ID.

Apache serves up web pages based on the files stored in the /web/groups/entity/public_html directory, where entity is the name of the entity. Ruby-on-Rails serves up web pages based on the application development stored in /web/groups/entity/railsapp directory.

Web Page Management Hints

The Engineering Web Cluster servers web pages out to the Internet based on the files and scripts stored in the public_html or railsapp directory. In order to update a web site, place the files into the right directory and check that the web page works successfully.

In order to control the behavior of the web server, log on to the host templeton.ecn.purdue.edu using a secure shell window (such as slogin templeton.ecn.purdue.edu). This will allow for controlling whether the server is running or not, and whether the server will be started automatically when the system is booted. Use the help command to see a list of options for controlling the web server.

Below are sections showing how to add files and adjust service by the Apache or by Ruby-on-Rails web server.

Apache Hints

Private data files should take advantage of storing the files into the private directory whenever possible. This will help avoid accidental disclosure should the permissions on the public_html be set incorrectly. Places where a private htpasswd is needed could use the private directory to store the password file.

When using the remote console, commands such as accesslog and errorlog show the last set of log file lines so you can debug web applications.

Ruby-on-Rails Hints

Ruby-on-Rails is can be run in “development”, “production”, or “test” mode. Development or testing of a Ruby-on-Rails application should be performed on a separate host before loading the files to the Ruby-on-Rails server.

Development of Ruby-on-Rails applications may be accomplished on any ECN supported Red Hat Enterprise Linux 5 host. A new Ruby-on-Rails application should be created with a directory named railsapp so it will match the production environment directory name. To create the directory, use the standard rails command:

$ rails new railsapp

Note the default database type will be “sqlite”. To use MySQL as the database, use an additional flag on the command line:

$ rails new railsapp -d mysql

Be sure to update the config/database.yml file with the credentials to use MySQL. Set the MySQL host name to mysql.ecn.purdue.edu. Requests for creating a MySQL database account for a Ruby-on-Rails application can be made using the ECN Database Request Form form. You may need to create more than one database so development and production data are separate.

Once the Ruby-on-Rails application is ready for production, copy the entire railsapp directory to the web group directory path /web/groups/entity/railsapp. This can be done with an “rsync” command:

$ rsync -aH railsapp/ /web/groups/entity/railsapp/

Once the railsapp directory is updated, be sure to start the Ruby-on-Rails server by logging on to templeton.ecn.purdue.edu and issuing a start (or restart) command.

Last modified: 2014/03/14 11:42:28.016274 GMT-4 by christopher.n.deckard.1
Created: 2009/03/23 13:52:9.937000 GMT-4 by curtis.f.smith.1.

Categories

Search

Type in a few keywords describing what information you are looking for in the text box below.

Admin Options: Edit this Document