SSH ACCESS INFO

SSH (secure shell) is enabled by default. If you have questions about SSH access with your account, please open a support request. Please include your IP address and your username, both found in your welcome email from us, in your ticket request so that we may assist you quickly and efficiently.

Commonly used SSH clients include PuTTY and XShell.

 

Posted under Uncategorized | Leave a comment

GET RUBY ON RAILS UP AND RUNNING

We use Ruby with Passenger while cPanel uses Ruby with Mongrel, so the cPanel Ruby app is not available. Below are the steps you need to take to get Ruby On Rails up and running.

Note: you will need SSH access, which is by default enabled on your account, and an SSH client (like PuTTY or XShell, or Terminal if you’re on a Mac).

To begin setting up Ruby On Rails:

  1. Move into your home directory (if you just logged in, you are already there)
  2. Setup the LANG environment variable so there’s proper UTF-8 support:
    cd ~
    echo "export LANG=en_US.UTF-8" >> ~/.bashrc
    source ~/.bashrc
  3. Create the directory that holds your Rails application:Note: MyApp can be changed to whatever you would like, but whatever you choose needs to stay the same wherever you type MyApp.
    rails new myapp
    rails new -h (to see all rails commands)
  4. Link your Rails application into your web directory so that you may access the Rails application on your website:
    cd public_html
    ​ln -s ../myapp/public myapp
    
    
  5. Let the server know about your Rails application by opening up the file located at myapp/public/.htaccess:Note: You can access this over FTP or using the nano or vi commands over SSH. This file shouldn’t already exist in the system. If it does, you can empty it’s contents.
  6. Put this as the entire contents of the file:
    PassengerRuby /usr/local/bin/ruby
    PassengerAppRoot /home/username/path/to/app

    Replace ‘username’ with your cPanel username and include the path to your app. If, for instance, your app is named ‘myapp’ in your home folder and your username is ‘example’, it will look like ‘/home/example/myapp’.

  7. RailsBaseURI /myapp
    
    
  8. Create your needed models, controllers, and views for your applicationNote: models are the objects, which will usually be linked to a table in your database.

    A model can be created used the following command:

    cd ../myapp
    script/generate model User (deprecated)
    rails generate model User

    Note: a controller is what moves data between the model (database) and your view.

    A controller can be created using the following code:

    script/generate controller User (deprecated)
    rails generate controller User

    Note: the view is where you will control what the user sees.

    The view can either be created manually or with help of the generator:

    script/generate controller User list (deprecated)
    rails  generate controller User list

    The above code would create the controller for the User object and the needed code for the list view.

  9. If you would like to manually create this, edit the User controller file, found at app/controllers/user_controller.rb, by entering the following code within the class (after class and before end):
    def list
    end​
    
    
  10. Create app/views/user/list.rhtml which will allow you to view the list action at http://www.example.com/myapp/user/list

Hopefully this will provide a small amount of help for you to get the application up and running! See below for some helpful tips from a user…

  • Ignore the Ruby on Rails Config panel on cPanel! ASO does not use Mongrel or WEBrick, we use Passenger. Follow the instructions above and ignore the Ruby on Rails config panel.
  • If you are developing a Facebook app you will probably see a 405 error. I believe this is because Facebook is using IIS, which does not like a redirect to a URL that refers to the default page for that URL.
    • For example: http://foobar.com/, which should make the server look for ‘index.html’.
RewriteRule ^/$ /my_default_controller [QSA]
Posted under Ruby on Rails | Leave a comment

Assign carriers to products with this Free PrestaShop Module

Assigning specific carriers to products is a long and cumbersome process, but this free PrestaShop module lets you do it in a single click for whole categories or chosen product lists. Learn More

Tags: , , | Posted under PrestaShop | Leave a comment