BitNami RubyStack Stack 1.1-0 ============================= 1. OVERVIEW The BitNami Project was created to help spread the adoption of freely available, high quality, open source web applications. BitNami aims to make it easier than ever to discover, download and install open source software such as document and content management systems, wikis and blogging software. You can learn more about BitNami at http://bitnami.org Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. You can learn more about Ruby at http://www.ruby-lang.org Ruby on Rails is a full-stack MVC framework for database-backed web applications that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration. You can learn more about Ruby at http://www.rubyonrails.org The BitNami RubyStack is an installer that greatly simplifies the installation of Ruby on Rails and its runtime dependencies. It includes ready-to-run versions of Ruby, Rails, MySQL and Subversion. RubyStack is distributed for free under the Apache 2.0 license. Please see the appendix for the specific licenses of all open source components included. You can learn more about BitNami Stacks at http://bitnami.org/stacks/ 2. FEATURES - Easy to Install BitNami Stacks are built with one goal in mind: to make it as easy as possible to install open source software. Our installers completely automate the process of installing and configuring all of the software included in each Stack, so you can have everything up and running in just a few clicks. - Independent BitNami Stacks are completely self-contained, and therefore do not interfere with any software already installed on your system. For example, you can upgrade your system's MySQL or Apache without fear of 'breaking' your BitNami Stack. - Integrated By the time you click the 'finish' button on the installer, the whole stack will be integrated, configured and ready to go. - Relocatable BitNami Stacks can be installed in any directory. This allows you to have multiple instances of the same stack, without them interfering with each other. 3. COMPONENTS BitNami RubyStack ships with the following: - Ruby 1.8.6 - RubyGems 1.0.1 - Rails 2.0.2 - ImageMagick 6.3.6 - Subversion 1.4.6 - SQLite 3.5.1 - MySQL 5.0.51a - Apache 2.2.8 - PHP 5.2.6 - phpMyAdmin 2.11.2.2 - Git @@BITROCK_GIT_VERSION@@ - Nginx @@BITROCK_NGINX_VERSION@@ 4. REQUIREMENTS To install BitNami RubyStack you will need: - Intel x86 or compatible processor - Minimum of 512 MB RAM - Minimum of 150 MB hard drive space - TCP/IP protocol support - Compatible operantig systems: - An x86 Linux operating system. - A 32-bit Windows operating system such as Windows 2000, XP, Vista or Windows Server 2003. - An OS X operating system (PowerPC or x86). 5. INSTALLATION The BitNami RubyStack is distributed as a binary executable installer. It can be downloaded from: http://www.bitnami.org/stacks/ The downloaded file will be named something similar to: bitnami-rubystack-1.1-0-windows-installer.exe on Windows or bitnami-rubystack-1.1-0-linux-installer.bin on Linux or bitnami-rubystack-1.1-0-osx-x86-installer.bin on OS X x86 or bitnami-rubystack-1.1-0-osx-powerpc-installer.bin on OS X PowerPC. Double click the file and follow the on-screen instructions. If you receive an error message during installation, please refer to the Troubleshooting section. 5. STARTING AND STOPPING BITNAMI RUBYSTACK You can start and stop BitNami RubyStack on Windows using the shortcuts created in the Start Menu, under Programs -> BitNami -> BitNami Service on Windows. To start/stop/restart application on Linux or OS X you can use the ctlscript.sh utility: ./ctlscript.sh (start|stop|restart) ./ctlscript.sh (start|stop|restart) mysql ./ctlscript.sh (start|stop|restart) apache ./ctlscript.sh (start|stop|restart) subversion start - start the service(s) stop - stop the service(s) restart - restart or start the service(s) 5.1. MAKING RUBY ON RAILS AND NGINX TO WORK TOGETHER For make Ruby on Rails and Nginx to work together, we need to do the following steps: 5.1.1. At firts, we need to run Mongrel server into rubyconsole cd ~/rubystack-1.1-0 ./rubyconsole cd projects/rubystack ruby script/server Now we will have running our rubystack project over mongrel server. We can access to it at http://localhost:3000. 5.1.2. The second step will be configurate nginx such as a proxy server. So we edit nginx/conf/nginx.conf and we will add the following lines into it: location / { proxy_pass http://localhost:3000/; proxy_redirect off; port_in_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } Previous lines must be added between server { ... } environment. Now we will check nginx.conf syntax with: nginx/sbin/nginx -t -c ../nginx/conf/nginx.conf It must be correct. 5.1.3. The last step will be to run Nginx server: ~/rubystack-1.1-0/nginx/sbin/nginx By default, nginx server uses 1234 port but we can change it (for example: 8081). Now we can access to our ruby project through nginx at http://localhost:1234/. All HTTP queries to this address will be redirected to mongrel cluster. 5.2. CREATING THE FIRST REPOSITORY WITH GIT. Git is an open source version control system designed to handle very large projects with speed and efficiency. 5.2.1. At first, we need to run the rubyconsole: cd ~/rubystack-1.1-0 ./rubyconsole 5.2.2. The second step will be to create a new empty repository, we need to type the following: git init And this will create an empty repository called .git. Now we can use this repository adding new files and committing them. For example: echo "Git working over BitNami RubyStack" > test.txt git add test.txt git commit test.txt -m "Initial upload" 5.2.3. The last step will be to do a checkout for a external repository: git clone git://git.kernel.org/pub/scm/git/git.git 5.3 USING RUBY 1.9 INTO BITNAMI RUBYSTACK Ruby-1.9 is included into BitNami RubyStack too, but if you want to use it you must do some changes into scripts/setenv.sh. 5.3.1 Update PATH variable to: PATH="/home/user/rubystack-1.1-0/git/bin:/home/user/rubystack-1.1-0/perl/bin:/home/user/rubystack-1.1-0/nginx/sbin:/home/user/rubystack-1.1-0/sqlite/bin:/home/user/rubystack-1.1-0/php/bin:/home/user/rubystack-1.1-0/mysql/bin:/home/user/rubystack-1.1-0/apache2/bin:/home/user/rubystack-1.1-0/subversion/bin:/home/user/rubystack-1.1-0/ruby19/bin:/home/user/rubystack-1.1-0/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" 5.3.2 Update LD_LIBRARY_PATH variable to: LD_LIBRARY_PATH="/home/user/rubystack-1.1-0/git/lib:/home/user/rubystack-1.1-0/perl/lib:/home/user/rubystack-1.1-0/nginx/lib:/home/user/rubystack-1.1-0/sqlite/lib:/home/user/rubystack-1.1-0/mysql/lib:/home/user/rubystack-1.1-0/apache2/lib:/home/user/rubystack-1.1-0/subversion/lib:/home/user/rubystack-1.1-0/ruby19/lib:/home/user/rubystack-1.1-0/common/lib:" 5.3.3. Update DYLD_LIBRARY_PATH variable to: DYLD_LIBRARY_PATH="/home/user/rubystack-1.1-0/git/lib:/home/user/rubystack-1.1-0/perl/lib:/home/user/rubystack-1.1-0/nginx/lib:/home/user/rubystack-1.1-0/sqlite/lib:/home/user/rubystack-1.1-0/mysql/lib:/home/user/rubystack-1.1-0/apache2/lib:/home/user/rubystack-1.1-0/subversion/lib:/home/user/rubystack-1.1-0/ruby19/lib:/home/user/rubystack-1.1-0/common/lib:" 5.3.4 Update RUBYHOME RUBY_HOME="/home/user/rubystack-1.1-0/ruby19" 5.3.4 Update RUBYLIB to: RUBYLIB="/home/user/rubystack-1.1-0/ruby19/lib:/home/user/rubystack-1.1-0/ruby19/lib/ruby:/home/user/rubystack-1.1-0/ruby19/lib/ruby/1.9.0:/home/user/rubystack-1.1-0/ruby19/lib/ruby/1.9.0/i686-linux:/home/user/rubystack-1.1-0/ruby19/lib/ruby/site_ruby:/home/user/rubystack-1.1-0/ruby19/lib/ruby/site_ruby/1.9.0:/home/user/rubystack-1.1-0/ruby19/lib/ruby/site_ruby/1.9.0/i686-linux" *IMPORTANT: Ruby-1.9 is a development version. It doesn't active by default. 6. DIRECTORY STRUCTURE The installation process will create several subfolders under the main installation directory: mysql/: MySQL Database. ruby/: Ruby, Rubygems, Rails and SQLite. img/: Additional image files. imagemagick/: ImageMagick image proccessor. license/: License files. subversion/: Subversion revision control system. scripts/: Simple scripts for launching rails applications. sqlite/: SQLite files. Apache2/: Apache2 files. php/: PHP files. apps/phpmyadmin: phpMyAdmin files. nginx/: nginx files. git: git files. 8. TROUBLESHOOTING This version of the BitNami RubyStack is a preview version, and as such, may contain a number of bugs and be a little bit rough around the edges. We are working on the next release, which will contain several improvements along with expanded documentation. In addition to the resources provided below, we encourage you to post your questions and suggestions at: http://bitnami.org/forums/ We also encourage you to sign up for our newsletter, which we'll use to announce new releases and new stacks. To do so, just register at: http://www.bitnami.org/catalog/newsletter. 8.1 Installer # Installer Payload Error If you get the following error while trying to run the installer from the command line: "Installer payload initialization failed. This is likely due to an incomplete or corrupt downloaded file" The installer binary is not complete, likely because the file was not downloaded correctly. You will need to download the file and repeat the installation process. 8.2 MySQL The following are some common problems: # Access denied when trying to connect to MySQL. If you get an Access Denied message while trying to connect to MySQL, make sure you are using the correct username and password. # "Can't connect to server" message. Make sure that the MySQL daemon is up and running. Remember also that if during installation you selected a different listening port for MySQL, you may need to pass that as an extra command line option. For help in troubleshooting MySQL errors, you may want to reference the "Problems and Common Errors" section of the MySQL manual, which you will find at http://dev.mysql.com/doc/ 8.3 Apache If you find any problem starting Apache, the first place you should check is the Apache error log file: /home/user/drupal/apache2/logs/error.log on Linux and OS X or C:\Program Files\BitNami RubyStack\apache2\logs\error.log. Most errors are related to not being able to listen to the default port. Make sure there are no other server programs listening at the same port before trying to start Apache. Some programs, such as Skype, may also use port 80. For issues not covered in this Quick Start guide, please refer to the Apache documentation, which is located at http://httpd.apache.org/docs/ 9. LICENSES MySQL is distributed under the GNU General Public License v2, which is located at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Ruby is released under the Ruby License and GPL, wich is located at http://www.ruby-lang.org/en/LICENSE.txt Rails is released under the MIT license, which is located http://www.opensource.org/licenses/mit-license.php Apache Web Server is distributed under the Apache License v2.0, which is located at http://www.apache.org/licenses/LICENSE-2.0 PHP and related libraries are distributed under the PHP License v3.01, which is located at http://www.php.net/license/3_01.txt phpMyAdmin is distributed under the GNU General Public License v2, which is located at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Subversion is released under Subversion License / released under the terms of the Apache License, which is located at http://subversion.tigris.org/license-1.html RubyGems is released under the Ruby License, which is located at http://www.ruby-lang.org/en/LICENSE.txt Rake is released under the Ruby License, which is located at http://www.ruby-lang.org/en/LICENSE.txt Mongrel Web Server (Mongrel) is released under the Ruby License, which is located at http://www.ruby-lang.org/en/LICENSE.txt Capistrano is released under the MIT/X Consortium License, whic is located at http://dev.rubyonrails.org/browser/tools/capistrano/MIT-LICENSE?rev=5270 SQLite is released under the Public Domain license, which is located at http://en.wikipedia.org/wiki/Public_Domain ImageMagick has its own license, which is located at https://www.imagemagick.org/subversion/ImageMagick/trunk/LICENSE Rmagick is released under the MIT license, which is located http://www.opensource.org/licenses/mit-license.php OpenSSL is released under the terms of the Apache License, which is located at http://www.openssl.org/source/license.html Zlib is released under the zlib License (a free software license/compatible with GPL), which is located at http://www.gzip.org/zlib/zlib_license.html Libiconv is released under the LGPL license, which is located at http://www.gnu.org/licenses/lgpl.html