Ubuntu 7.1 Server to build a Jsp/php/rails almighty web production Environment from scratch (v)

Source: Internet
Author: User

V. Installing the RAILS Environment

Rails environment uses mongrel erection.
1. Install Ruby
TAR-ZXVF ruby-1.8.6.tar.gz
CD ruby-1.8.6
./configure–prefix=/usr/local/ruby
Make
Make install

Add Ruby to Path
Vi/etc/profile
Ruby_home=/usr/local/ruby
Path= "${ruby_home}"/bin: "${java_home}"/bin:/usr/local/mysql/bin: "${path}"
Export PATH

Exit root, re-log in root to verify that Ruby is installed successfully
Ruby-v
Displays the version number indicating that the installation was successful

2. Install Gem
TAR-ZXVF rubygems-0.9.4.tgz
CD rubygems-0.9.4
Ruby Setup.rb

rubygems-0.9.5 seems to have a problem, no matter what the gem package is said SSL is not installed, reinstall a rubygems-0.9.4 is no problem.
3. Installation Rails/mongrel/termios
Apt-get Install Libssl-dev
Gem Install Rake–include-dependencies
Gem Install Rails–include-dependencies
Gem Install Termios–include-dependencies
Gem Install Mongrel–include-dependencies
Gem Install Mongrel_cluster–include-dependencies

To create a default site (or upload a Web site that has already been developed and configure a database), go to the Site Directory
Mongrel_rails cluster::configure-e production-p 8000-n 3-c/home/dingl/rails-web/-a 127.0.0.1
Configure the database in Database.yml, here is the production environment, configure production segment.
If you need to use socket to connect to MySQL, add:
Socket:/tmp/mysql.sock
You can also specify the data transfer encoding:
Encoding:utf8

4, start mongrel:
Mongrel_rails Cluster::start

If the following error occurs:
Cannot find gems for Rails ~>1.2.3.0:
Install the missing gem with ' Gem install-v=1.2.3 rails '
You can change the version number of rails in config/environment.rb.

5, configure Apache and mongrel:

To modify the Apache configuration file:
Vi/usr/local/apache/conf/httpd.conf
Add a virtual host at the end of the file:
<virtualhost *:80>
ServerName http://www.111cn.net/
Rewriteengine on
documentroot/home/dingl/rails-web/
Proxyrequests off
<proxy balancer://mongrel_cluster>
Balancermember http:/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.