[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ruby in cpanel

Posted on 2011-10-29
1
Medium Priority
?
724 Views
Last Modified: 2012-05-12
Hello. I have a ruby app I am trying to install on a shared server with linux on it through cpanel version 11.30.4.6.

there is a .rb file and a config.yaml file. I am attaching the yaml file and also a screenshot of the cpanel interface. It seems that the host support don't know how to install this.
I wonder if anyone else knows how I do this. Where should I put the .rb file and the .yaml file and what changes do I need to make to the yaml file. I know I need to set up the user name password database and server but not sure about any other stuff.

Thanks very much.

 cpanel ruby control cpanel ruby control cpanel ruby control
 
this is the config.yaml file:

---
# General configuration
##########################

# Number of tweets until the configuration file is refreshed, specifically to 
# determine if Save_to_database has been changed without needing to restart the script
tweets_until_refresh: 200

# Twitter account credentials
##########################

Twitter: {
	Username: twitter_username,
	Password: twitter_password
}

# Database configuration
##########################

Save_to_database: true
Database: {
	# Connection info
	Server: 'localhost',
	Database: db_name,
	User: db_user,
	Password: password,
	
	# Table where the tweets are to be saved
	Table: tweets,
	
	# To increase performance, database saves occur in batches
	# Flush_rate determines after how many tweets a database
	# insert occurs
	Flush_rate: 10
}

# Flat file information
##########################

File_path: ./
File_name: tweets
Rows_per_file: 50000

# Tweet fields to save
# Note: the field names of compound fields (i.e., entities or user)
#		in the csv file and database will be the main field plus sub
#		field, joined with an underscore.
#		e.g., for urls under entities, the field name will be entities_urls
		
##########################
Fields: {
	contributors: true,
	coordinates: true,
	created_at: true,
	entities: {
		urls: true,
		hashtags: true
	},
	favorited: true,
	geo: true,
	id: true,
	id_str: true,
	in_reply_to_screen_name: true,
	in_reply_to_status_id: true,
	in_reply_to_status_id_str: true,
	in_reply_to_user_id: true,
	in_reply_to_user_id_str: true,
	place: true,
	retweet_count: true,
	retweeted: true,
	source: true,
	text: true,
	truncated: true,
	user: {
		profile_background_color: true,
	    utc_offset: true,
	    contributors_enabled: true,
	    created_at: true,
	    screen_name: true,
	    description: true,
	    profile_text_color: true,
	    profile_image_url: true,
	    statuses_count: true,
	    default_profile: true,
	    id_str: true,
	    show_all_inline_media: true,
	    time_zone: true,
	    profile_link_color: true,
	    profile_background_image_url: true,
	    listed_count: true,
	    profile_sidebar_border_color: true,
	    verified: true,
	    protected: true,
	    url: true,
	    is_translator: true,
	    default_profile_image: true,
	    profile_use_background_image: true,
	    profile_background_tile: true,
	    notifications: true,
	    follow_request_sent: true,
	    friends_count: true,
	    lang: true,
	    profile_sidebar_fill_color: true,
	    name: true,
	    geo_enabled: true,
	    id: true,
	    favourites_count: true,
	    following: true,
	    followers_count: true,
	    location: true
	}
}

Open in new window

0
Comment
Question by:onyourmark
1 Comment
 
LVL 7

Accepted Solution

by:
Jayachandran Palanisamy earned 2000 total points
ID: 37072543
Hi,
Creating a Ruby on Rails Application

After you are sure your website's server has a working version of Ruby that is accessible to you, you can create and deploy a Ruby on Rails environment. Ruby on Rails runs on its own server so the setup requires a little extra work.

   1. Log into cPanel.
   2. Navigate to the Software/Services section of your cPanel interface.
   3. Click the Ruby on Rails icon.
          * This step will open the Ruby on Rails management interface.
   4. Specify your application's name in the App Name field.
          * Remember: To set your application to load when the server is booted, click the Load on Boot? checkbox.
   5. Assign the application path in the Application Path field.
          * Note: If you set an application path in your public_html/ directory, your source code and configuration files can be viewed by anyone on the web.
   6. Use the Environment drop-down menu to select the type of Ruby on Rails environment you wish to run.
   7. Click Create.

Once the application has been installed, you can activate your Ruby on Rails environment by clicking Run in the Available Ruby on Rails Applications table.

Creating a Rewrite

Because Ruby on Rails uses its own server, users visiting your website (and subsequently your Ruby on Rails application) will need to be redirected to the appropriate port.

Ruby does not respond on the standard HTTP port number, 80. Thus, visitors would need to specify the port number with the domain — for example, example.com:12001.

PICK Remember: Ruby application port numbers increment automatically with every new application. This means that, if you are on a shared server, you will simply be assigned the next available port number. Your first application will not necessarily run on port 12001.

To configure Ruby to respond without visitors having to specify a port number, you will need to configure a rewrite.

To configure a rewrite:

   1. Log into cPanel.
   2. Navigate to the Software/Services section of your cPanel interface.
   3. Click the Ruby on Rails icon.
          * This step will open the Ruby on Rails management interface.
   4. Click the Create Rewrite button corresponding to the appropriate application in the Create A Rewrite table.
   5. From the drop-down menu, select the domain, subdomain, or addon domain on which you wish to run your Ruby application.
          * If you wish to run the application from a new page within your domain, type the page name you wish to use into the available text field.
   6. Click the Save button.

Additional Applications and Rewrites

If you intend to run multiple Ruby applications, you will need to configure additional ports to respond using Ruby on Rails and, if necessary, additional rewrites to disguise the port change. To do so, simply add an application as described in the Deploying a Ruby on Rails Environment section. By default, the new application will respond on the next available port number — for example, if your first application runs on port 12001, the second may run on port 12002 or higher.

Remember: Ruby application port numbers increment automatically with every new application. This means that if you are on a shared server you will simply be assigned the next available port number. Your first application will not necessarily run on port 12001. This also means that your application port numbers may not be consecutive.

To configure an additional rewrite, simply follow the steps outlined above. You will need to use a new domain, addon domain, subdomain, or page (for example: example.com/RubyApplication) for the rewrite. You will not be able to configure 2 Ruby applications to respond on the same domain, subdomain, addon domain, or page.

I hope the following links will help you further.
http://forums.glowhost.com/knowledge-base/how-create-ruby-rails-application-using-cpanel-932.html
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/RubyonRails/DeployingRuby

Regards,
Jay
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question