| Home » Categories » Multiple Categories |
How To Install Rails, Apache, and MySQL on Ubuntu with Passenger |
|
Article Number: 152 | Rating: Unrated | Last Updated: Tue, Sep 23, 2025 at 11:19 PM
|
IntroInstalling Ruby on Rails and MySQL on an apache virtual private server is the first step toward getting Ruby applications live and online. Three useful installers make the task of building this server easier than ever before.SetupThis tutorial requires you to have a server up and running. Additionally, the rails ready script needs to be performed by a user with sudo privileges. If you don't have a user like that on your server, you can check out how to do that in steps 3 and 4 of this tutorial.Step One—Install Rails ReadyOnce you are logged in on your virtual server with your user with root privileges, type in the command to install Rails Ready:wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh Rails Ready can be installed either from the source or with RVM, the Ruby Version Manager. I would recommend using RVM—it's an easy installation and will later let you to switch between multiple versions of Ruby if needed. Overall the installation does take a while—be prepared to wait. However, once Rails Ready finishes the process, your server will be fully equipped with Ruby, Gems, and Rails. Then, following the instructions on screen, "logout and back in to access Ruby" Step Two—Install Apache with Phusion PassengerOnce RVM is set up, you can use it to install rails:rvm install 1.9.3 And set RVM to use Ruby 1.9.3 by default: rvm use --default 1.9.3 Then install the passenger gem: gem install passenger As a useful bonus, RailsReady comes packaged with Phusion Passenger, which we can use to then automatically install and configure Apache on our server. Use this command to start the apache installation: passenger-install-apache2-module Step Three—Update the Apache configurationPassenger will display this text after Apache installs:The Apache 2 module was successfully installed. Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so PassengerRoot /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12 PassengerRuby /home/username/.rvm/wrappers/ruby-1.9.3-p194/ruby To finish the process, open up the Apache config and paste the three required lines into the file: sudo nano /etc/apache2/apache2.confSave and Exit. Step Four—Install MySQLBefore we conclude the installation, we should add one more useful program to our virtual server.MySQL is a powerful database management system used for organizing and retrieving data. To install MySQL, open terminal and type in these commands: sudo aptitude update sudo aptitude install mysql-server During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell with this command: UPDATE mysql.user SET Password = PASSWORD('password') WHERE User = 'root';Congratulations! WIth the help of three useful installers, we now have Ruby on Rails, Apache, and MySQL on our Ubuntu server!
|
Attachments
There are no attachments for this article.
|
How To Install and Secure phpMyAdmin on Ubuntu 12.04
Viewed 3648 times since Mon, Dec 23, 2013
How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS
Viewed 4289 times since Mon, Dec 23, 2013
How to Setup Additional Entropy for Cloud Servers Using Haveged
Viewed 3431 times since Sat, Jan 4, 2014
How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNS
Viewed 3507 times since Thu, Dec 26, 2013
How To Use Top, Netstat, Du, & Other Tools to Monitor Server Resources
Viewed 7672 times since Sat, Jan 4, 2014
How To Use WP-CLI to Manage your WordPress Site from the Command Line
Viewed 11101 times since Sat, Jan 4, 2014
How To Setup ownCloud 5 On Ubuntu 12.10
Viewed 6463 times since Sat, Jan 4, 2014
How To Set Up an NFS Mount on Ubuntu 12.04
Viewed 11383 times since Tue, Dec 24, 2013
How To Setup uWSGI On Ubuntu 12.10
Viewed 2869 times since Sat, Jan 4, 2014
Docker Explained: How To Containerize Python Web Applications
Viewed 5326 times since Sat, Jan 4, 2014
|
