Setting_up_a_Rails_Development_Server

556 views
515 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
556
On SlideShare
0
From Embeds
0
Number of Embeds
32
Actions
Shares
0
Downloads
28
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Setting_up_a_Rails_Development_Server

  1. 1. Setting up a Rails Development Server Robert Dempsey & Joe Block
  2. 2. Development Environment <ul><li>Ubuntu 5.10 </li></ul><ul><li>Ruby 1.8.4 / Ruby Gems </li></ul><ul><li>MySQL 5 </li></ul><ul><li>Rails 1.1.2 </li></ul><ul><li>Lighttpd a.k.a. Lighty </li></ul><ul><li>Subversion </li></ul>
  3. 3. Ubuntu 5.10
  4. 4. Why Choose Ubuntu 5.10 <ul><li>Good documentation </li></ul><ul><li>Apt-get and synaptic package manager </li></ul><ul><li>Strong device support </li></ul><ul><li>No viruses </li></ul><ul><li>Easy to install ruby and rails! </li></ul>
  5. 5. Installing Ubuntu 5.10 <ul><li>Download and burn the latest iso image </li></ul><ul><li>When you get to the installation prompt, hit enter </li></ul><ul><li>Wait a bit for the install to finish </li></ul><ul><li>Ready for customization </li></ul>
  6. 6. Customizing your install <ul><li>/etc/apt/sources.list </li></ul><ul><ul><li>Uncomment the universe repository </li></ul></ul><ul><ul><li>deb http://de.archive.ubuntu.com/ubuntu/ dapper main restricted </li></ul></ul><ul><ul><li>deb http://de.archive.ubuntu.com/ubuntu/ dapper universe multiverse </li></ul></ul><ul><li>Turn on ssh access to the server </li></ul><ul><ul><li>apt-get install openssh-server </li></ul></ul>
  7. 7. Created /etc/apt/preferences with: <ul><li>Package: * </li></ul><ul><li>Pin: release a=breezy, v=5.10 </li></ul><ul><li>Pin-Priority: 900 </li></ul><ul><li>Package: * </li></ul><ul><li>Pin: release a=breezy-security, v=5.10 </li></ul><ul><li>Pin-Priority: 900 </li></ul><ul><li>Package: * </li></ul><ul><li>Pin: release a=breezy-updates, v=5.10 </li></ul><ul><li>Pin-Priority: 900 </li></ul><ul><li>Package: * </li></ul><ul><li>Pin: release a=dapper </li></ul><ul><li>Pin-Priority: 90 </li></ul>
  8. 8. Additional Packages <ul><li>apt-get install gcc g++ libtool libreadline5 libreadline5-dev zlib1g-dev libssl-dev libgdbm-dev libgdbm3 libgdbm-dev zlibc zlib-bin libmysqlclient14-dev subversion subversion-tools libsvn0-dev libsvn0 xtail rrdtool mysql-server mytop make </li></ul>
  9. 9. Ruby 1.8.4 and Ruby Gems
  10. 10. Installing Ruby 1.8.4 <ul><li>apt-get install -t dapper irb irb1.8 libpgsql-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8 libruby libruby1.8 libyaml-ruby ruby1.8-examples rdoc1.8 ri1.8 libmysql-ruby1.8 libgdbm-ruby1.8 imagemagick librmagick-ruby1.8 librmagick-ruby-doc xml-core libmysqlclient14-dev </li></ul><ul><li>sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby </li></ul><ul><li>sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri </li></ul><ul><li>sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc </li></ul>
  11. 11. Installing Ruby Gems <ul><li>Download rubygems </li></ul><ul><li>Do “sudo ruby setup.rb&quot; in the source directory. </li></ul><ul><li>sudo gem update –include-dependencies </li></ul>
  12. 12. MySQL 5
  13. 13. Why Choose MySQL <ul><li>Easy to use and develop for </li></ul><ul><li>Lots of good documentation </li></ul><ul><li>Most hosting providers provide it free </li></ul>
  14. 14. Installing MySQL <ul><li>apt-get install -t dapper mysql-server mysql-client mytop </li></ul><ul><li>Set mysql password to “foo” </li></ul><ul><li>sudo mysqladmin -u root password foo </li></ul>
  15. 15. Rails 1.1.2
  16. 16. Installing Rails 1.1.2 <ul><li>sudo gem install rails --include-dependencies </li></ul>
  17. 17. Lighttpd a.k.a. Lighty
  18. 18. Why Choose Lighty <ul><li>FastCGI </li></ul><ul><li>Virtual hosts </li></ul><ul><li>Fast and secure application controlled downloads </li></ul><ul><li>Works on Linux, Unix and Windows </li></ul><ul><li>Flexible and configurable </li></ul><ul><li>Good docs and support </li></ul>
  19. 19. Installing Lighty <ul><li>apt-get install libfcgi-dev libfcgi-ruby </li></ul><ul><li>apt-get install libpcre3 libpcre3-dev bzip2 libbz2-dev </li></ul><ul><li>wget http://www.lighttpd.net/download/lighttpd-1.4.11.tar.gz </li></ul><ul><li>tar xvzf lighttpd-1.4.11.tar.gz </li></ul><ul><li>./configure </li></ul><ul><li>time make </li></ul><ul><li>sudo make install </li></ul>
  20. 20. Subversion
  21. 21. Why Versioning is Good <ul><li>Online backups </li></ul><ul><li>The “oh shit” factor </li></ul><ul><li>Supports multiple developers </li></ul><ul><ul><li>Mac: Subversion </li></ul></ul><ul><ul><li>Windows: Subversion / Tortoise SVN </li></ul></ul><ul><li>Most rails hosting companies have it built-in </li></ul>
  22. 22. Configuring Subversion <ul><li>adduser repouser </li></ul><ul><li>Log in as repouser </li></ul><ul><li>mkdir ~repouser/sources </li></ul><ul><li>svnadmin create ~repouser/sources </li></ul><ul><li>Edit the configuration file to change the access rules. Set ~repouser/sources/conf/svnserve.conf </li></ul>
  23. 23. Subversion continued… <ul><li>[general] </li></ul><ul><li>anon-access = read </li></ul><ul><li>auth-access = write </li></ul><ul><li>realm = YourName Rails Repouser </li></ul><ul><li>password-db = passwd </li></ul>
  24. 24. Setting up the repository <ul><li>mkdir -p foo/yourapp </li></ul><ul><li>mkdir -p foo/ yourapp/trunk </li></ul><ul><li>mkdir -p foo/ yourapp/branches </li></ul><ul><li>mkdir -p foo/ yourapp/tags </li></ul><ul><li>cd foo </li></ul><ul><li>svn import . file:///home/repository/sources </li></ul>
  25. 25. Results
  26. 26. What we got… <ul><li>A ready to go, stable and robust rails development server that supports multiple developers on mixed platforms </li></ul>
  27. 27. Conclusions
  28. 28. Life is good! <ul><li>Easy and worth it </li></ul><ul><li>Took about 10 minutes to install </li></ul><ul><li>Can use it to show clients your progress or for in-house testing </li></ul>
  29. 29. Resources
  30. 30. Resource List <ul><li>Ubuntu 5.10 </li></ul><ul><ul><li>http://www.ubuntu.com </li></ul></ul><ul><li>Ruby 1.8.4 / Ruby Gems </li></ul><ul><ul><li>http://www.ruby-lang.org </li></ul></ul><ul><ul><li>http://rubyforge.org </li></ul></ul><ul><li>MySQL 5 </li></ul><ul><ul><li>http://www.mysql.com </li></ul></ul><ul><li>Rails 1.1.2 </li></ul><ul><ul><li>http://www.rubyonrails.org </li></ul></ul><ul><li>Lighttpd a.k.a. Lighty </li></ul><ul><ul><li>http://www.lighttpd.net </li></ul></ul><ul><li>Subversion </li></ul><ul><ul><li>http:// subversion.tigris.org </li></ul></ul>
  31. 31. Thank You!

×