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 three ways: Apache served applications using CGI programming, Plone served applications, 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.
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:
Research and academic groups have a URL that begins with an entity identifier, without the “tilde” character:
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”, “plone” or “railsapp” directory for all files that will be made publicly available by the web server,
- A “private” directory for private storage,
- For Apache, a “var/logs” directory that will contain the log files for all web server file transfers (“access_log”) and error messages (“error_log”). Plone and Ruby-On_Rails have their own log files.
The directory structure looks like this:
Any of Apache, Plone and Ruby-on-Rails runs as the user-ID of the entity - Any files stored in the “public_html”, “plone” 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 or group-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. Plone serves up web pages based on the application development stored in “/web/groups/entity/plone/” directory. 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”, “plone” 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.
Type 'help' for list of available commands web> help Available commands: accesslog Show the most recent messages in the access log1 buildout Re-run buildout on a Plone instance2 disable Disable the web server from starting automatically enable Enable the web server to start automatically environment Set type of server environment (test/development/production)3 errorlog Show the most recent messages in the error log1 exit Same as quit help Show a list of available commands initialize Initialize a Plone instance2 list List entities quit Quit the command shell restart Restarts the web server if already running select Select current entity start Start the web server if not already running status Show the current status of the web server stop Stops the web server if currently running
1 - Apache only
2 - Plone only
3 - Ruby-On-Rails only
Below are sections showing how to add files and adjust service by the Apache, Plone or by Ruby-on-Rails web server.
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.
Plone instances need to be created using the console command “initialize”. The initialize command will create a zinstance directory suitable for configuration. If there is already an instance, use “initialize force” to overwrite the current configuration.
When Plone needs an upgrade due to new Zope or Plone modules, a buildout command will need to be run. Use the command “buildout” to update the module list.
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 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: 2015/02/12 09:13:38.552226 US/Eastern by
Created: 2009/03/23 13:52:9.937000 GMT-4 by curtis.f.smith.1.
Type in a few keywords describing what information you are looking for in the text box below.