294
edits
Willipedia is now back online as of 5/5/2019 |
It has been several years since Willipedia closed. Please help get it updated! |
Go to the Willipedia 2.0 Project to learn more. |
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 PerlRuby, 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 ==
We need to create a log file for your site so it doesn''Write that number down for latert complain directly to you.''
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 Terminalon your own machine, and type
ssh -N -p 22 -f -2 -L 80003000/127.0.0.1ursula/53717 emilleryour_port username@wso.williams.edu
EXCEPT instead of 53717your_port, put the port number that you wrote down, and instead of "emillerusername", 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/53717 emilleryour_port username@wso.williams.edu'
Again, make the substitutions for your own port 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== Disclaimer: The author has done this on various flavors of *nix and on Mac OS X, but knows nothing about Windows. It is possible on Windows, but no guarantees that it will just work. Google is your friend. ===Install software=== ====With your package manager==== Using your favorite package manager, install the following: * subversion* sqlite3* ruby (1.8.6)* ruby ldap (rb-ldap 0.9.1)* ImageMagick* ruby gems, a package manager for ruby packages =====Notes=====Make sure that these appear in your $PATH. On Mac OS X Leopard, the built-in ruby comes with ruby gems installed, so you may be able to skip those two. On Tiger and earlier, use MacPorts to install all of the above (mongrel is still optional). ====With ruby gems==== Using gem install the following: * rails* RedCloth* simple-rss* sqlite3-ruby* rmagick* optional: mongrel You can install all of this with the command gem install rails RedCloth simple-rss sqlite3-ruby mongrel -y On any *nix system or Mac OS X, you'll probably need to run this with sudo. No idea about Windows. If you have any trouble with this, post to [[Talk:WSO web development]] or email bwood at wso. ===Check out the 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. 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 checkout svn://wso.williams.edu/wso-on-rails/trunk wso-devel Now change directory into the code directory: cd wso-devel We need to create a log file for your site so it doesn't complain directly to you. touch log/development.log Now your site is ready to run! ===Start the server=== To start the server run the following command in the wso-devel directory. script/server If you see something like the following, then you're in business. (This is what you'll see if you installed mongrel, otherwise, you'll see similar output from WEBrick, the default server.) => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel available at 0.0.0.0:3000 ** Use CTRL-C to stop. ==Common Instructions== ===Build your database=== The development version of the WSO site uses SQLite, a file-based database to make it easy to deploy anywhere. To create your database and setup the structure we'll need, just run rake db:schema:load in the root directory of your copy of the code (e.g. wso-devel). ===Add yourself as a user=== Also in the root directory of your site, run rake data:dev:addusers ===Optional: update caches=== On the production server, these scripts are run every so often to keep the info on the front page up to date. You get some pregenerated caches with the code, but if you want something more realistic, run these.
===Making changes===