Run ruby on rails on apache-mongrel use apach mongrel to collaborate to create virtualhost with multiple domain names

Source: Internet
Author: User
Tags ruby on rails

I wrote this article a long time ago. I can't find where the post is. I will try again. Because Google cannot search articles on oe.monweb.cn (this is a feature called Anti search engine)

However, I declare that ASE has nothing to do with the recent Google events, but I think users may not want their articles to be searched by others before release. Happy write website is only a professional writing tool, not a blog website.

This is a way to run Ruby on Rails, since rails will never support FastCGI.

All operation is following the nice artile http://wiki.rubyonrails.org/deployment/apache-mongrel

Pre-requisites

Mod_proxy and mod_rewrite enabled.

Step 1 create vhost


Serveradmin jackie.ju@gmail.com
Servername oe.monweb.cn
DocumentRoot/var/www/OE/Public
Errorlog/var/log/httpd/oe-error_log
Customlog/var/log/httpd/oe-access_logs combined

Rewriteengine on

  Balancermember http: // 127.0.0.1: 6010 retry = 10
Balancermember http: // 127.0.0.1: 6011 retry = 10
Balancermember http: // 127.0.0.1: 6012 retry = 10

# Performance: If no static file exists, let mongrel handle the request
Rewritecond % {document_root}/% {request_filename }! -F
Rewriterule ^/(. *) $ balancer: // mongrel_cluster % {request_uri} [p, QSA, l]


 

Step 2 install mongre-Cluster

 sudo gem install mongrel_cluster

You can start/stop/restart by commands

$ mongrel_rails cluster::start$ mongrel_rails cluster::stop
$ mongrel_rails cluster::restart

Step 3 Start app

In rails dir

mongrel_rails cluster::configure -e production -p 6010 -N 3

OK! Done

This article is created by happy writers

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.