294
edits
Changes
no edit summary
{{outdated}}
[[Category:How-To]] [[Category:Computers]] [[Category:WSO]]
[http://wso.williams.edu WSO's web site] is a work in progress. You can always see "the next step" at http://wso.williams.edu:3000, where the latest "stable" (stable being a relative term) version of the next update to the site lives. If you're impatient about the new facebook, or you know web design or Ruby, or if you just want to see how it's done, you're welcome to check out a copy of the code and go to work. This page will tell you how to get started.
== Get a Subversion account ==
== Choose your environment == Working on the WSO site will require running your own development copy of the site. There are two basic ways to go about this. 1. Run your development server in your account on WSO's user server. This requires the following:* A WSO shell account.* A WSO subversion account.* A computer with an ssh client (ssh on *nix or Mac OS X, PuTTY on Windows).* Some familiarity with the command line.2. Run your development server on your machine. This requires the following:* A WSO subversion account.* A computer.* Familiarity with installing command line software (preferably via a package manager). Though setting up a dev server on your own machine may require more investment of time up front, it is ultimately more flexible, since you have more control over and easier access to your environment. ==Option 1: Set up a development server in your WSO account== ===SSH to WSO=== If you don't have a WSO account, email root at wso.williams.edu. One of them will hook you up. A WSO account is not your 06abc or abc1 account. It is the first letter of your first name followed by up to seven letters of your last name. Once you have an account, go ahead and log in:
'''Windows''': get yourself a copy of [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty]. wso.williams.edu is the host.
where username is your WSO username (remember, not your 06abc OIT id).
===Check out the code===
Once you've logged in with SSH, you're ready to check out your very own copy of the WSO code. In your home directory, or wherever you'd like to keep your copy of the WSO site, run the following command to use Subversion to check out the code. (Don't forget the dot at the end!) This will spew a whole log of output onto your screen, listing all the files it's checking out. You can replace "wso-devel" with whatever name you want for your local copy of the code.
svn co filecheckout svn://wso.williams.edu/var/svnwso-on-rails/wso trunk wso-devel
Now change directory into the code directory:
Now your site is ready to run! If you just want to poke around you can do that without starting the server (check out [[How to transfer files to WSO]]), but if you want to make changes and see what happens, keep reading.
===Start the server===
But first you need your own personal port to run it on. Find this by running the following command. You'll want to save the output of this for future reference.
If you see something like the following, then you're in business.
=> Booting Mongrel (use 'script/server webrick' to force WEBrick...) => Rails application started starting on http://0.0.0.0:3001your_port => Call with -d to detach => Ctrl-C to shutdown server; call with --help for options [2006-11-29 21** Starting Mongrel listening at 0.0.0.0:15:31] INFO your_port WEBrick 1** Starting Rails with development environment...3 ** Rails loaded.1 [2006-11-29 21:15:31] INFO ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. ruby 1INT => stop (no restart).8 ** Rails signals registered.5 HUP => reload (2006-08-25without restart) [powerpc-darwin8.8 It might not work well. ** Mongrel available at 0.0.0].0:your_port [2006** Use CTRL-11-29 21:15:32] INFO WEBrick::HTTPServer#start: pid=9210 port=3001C to stop.
Before breaking out the champagne, we need to check to see that the server actually works. Unfortunately, you can't just pop open a web browser and surf to your new site. WSO's servers are behind a firewall. The firewall only allows connections on certain ports. Yours is not one of them.
===Setting up port forwarding== The way through the firewall is to pretend that the web server is running on your computer and not on WSO. We'll use a technology called ''port forwarding'' to send web requests to your machine ''through an SSH connection'' to your server on WSO. This is, simply, awesome.=
====Mac/Linux====
Open up a Terminal on your own machine, and type
ssh -N -p 22 -f -2 -L 80003000/127.0.0.1ursula/your_port username@wso.williams.edu
EXCEPT instead of your_port, put the port number that you wrote down, and instead of "username", type your WSO account name. Unfortunately, you'll have to run this command somewhat frequently, since SSH connections close when your computer reboots or goes to sleep (or WSO crashes, or whatever...). To make this a little less tedious, open the file called .bashrc in your home directory on your own machine and add this line:
alias wso8000wso3000='ssh -N -p 22 -f -2 -L 80003000/127.0.0.1ursula/your_port username@wso.williams.edu'
Again, make the substitutions for your_port and username. Close the Terminal window and open a new one. Now, if you need to establish the connection, just type "wso8000wso3000" in a terminal window. You can pick a different alias, of course.
====Windows====
Putty lets you do port forwarding, too. You can read more about it here:
Here are the settings you'll need:
Source port: 80003000
Destination port: (your special port)
Destination host: localhostursula Continue to the Common Instructions. == Option 2: Run on your own machine==
Using your favorite package manager, install the following:
Nice work getting this far. So now you actually want to ''do'' something with the code. For now, come to a WSO meeting Tuesdays at 9:30pm in the vicinity of TCL 202, or email wso at wso.williams.edu with questions/interest. With the new Facebook finished, our next big prospect is rewriting old PageKit services (Factrak!) in Ruby on Rails.
svn update