Bitnami Ruby for Huawei Enterprise Cloud

Similar documents
Bitnami JRuby for Huawei Enterprise Cloud

Bitnami MEAN for Huawei Enterprise Cloud

Bitnami Apache Solr for Huawei Enterprise Cloud

Bitnami HHVM for Huawei Enterprise Cloud

Bitnami MySQL for Huawei Enterprise Cloud

Bitnami MariaDB for Huawei Enterprise Cloud

Bitnami Piwik for Huawei Enterprise Cloud

Bitnami Tiny Tiny RSS for Huawei Enterprise Cloud

Bitnami ez Publish for Huawei Enterprise Cloud

Bitnami Pimcore for Huawei Enterprise Cloud

Bitnami ProcessMaker Community Edition for Huawei Enterprise Cloud

Bitnami Spree for Huawei Enterprise Cloud

Bitnami Kafka for Huawei Enterprise Cloud

Bitnami Node.js for Huawei Enterprise Cloud

Bitnami Dolibarr for Huawei Enterprise Cloud

Bitnami TestLink for Huawei Enterprise Cloud

Bitnami Coppermine for Huawei Enterprise Cloud

Bitnami OroCRM for Huawei Enterprise Cloud

Bitnami Mantis for Huawei Enterprise Cloud

Bitnami Open Atrium for Huawei Enterprise Cloud

Bitnami Cassandra for Huawei Enterprise Cloud

Bitnami Moodle for Huawei Enterprise Cloud

Bitnami Re:dash for Huawei Enterprise Cloud

Bitnami ERPNext for Huawei Enterprise Cloud

Bitnami Phabricator for Huawei Enterprise Cloud

Bitnami OSQA for Huawei Enterprise Cloud

Bitnami Trac for Huawei Enterprise Cloud

Bitnami Magento for Huawei Enterprise Cloud

Bitnami DokuWiki for Huawei Enterprise Cloud

Bitnami JFrog Artifactory for Huawei Enterprise Cloud

Bitnami MediaWiki for Huawei Enterprise Cloud

Bitnami Subversion for Huawei Enterprise Cloud

Installing Open Project on Ubuntu AWS with Apache and Postgesql

How To Start Mysql Using Linux Command Line Client In Ubuntu

How To Start Mysql Use Linux Command Line Client In Xampp

Bitnami ELK for Huawei Enterprise Cloud

Open a browser and download the Apache Tomcat 7 and Oracle JDBC 6 JAR from these locations. The Oracle site may require that you register as a user.

Buzztouch Server 2.0 with Amazon EC2

BriCS. University of Bristol Cloud Service Simulation Runner. User & Developer Guide. 1 October John Cartlidge & M.

1. INTRODUCTION to AURO Cloud Computing

Topics. What is a RaspberryPi? Why should I want one? What is Raspbian? What is SSH? What is FTP? What is LAMP? Making a LAMP Stack!

Author A.Kishore/Sachin WinSCP

SUREedge MIGRATOR INSTALLATION GUIDE FOR HYPERV

SONOTON storage server

WinSCP. Author A.Kishore/Sachin

SUREedge MIGRATOR INSTALLATION GUIDE FOR NUTANIX ACROPOLIS

Enable SSH Access on the Tenable Virtual Appliance (4.4.x-4.7.x) Last Revised: February 27, 2018

PCoIP Connection Manager for Amazon WorkSpaces

LiveNX Upgrade Guide from v5.2.0 to v5.2.1

Flexible Engine. Startup Guide

Student Website Setup

Ftp Command Line Manual Windows User Password

Setting up VPS on Ovh public cloud and installing lamp server on Ubuntu instance

2. Installing OpenBiblio 1.0 on a Windows computer

Session 1: Accessing MUGrid and Command Line Basics

You can use the WinSCP program to load or copy (FTP) files from your computer onto the Codd server.

We want to install putty, an ssh client on the laptops. In the web browser goto:

KB How to upload large files to a JTAC Case

Tutorial 1. Account Registration

Setting up PuTTY. Version Updated for 2015 Fall (with corrections)

Setting up PuTTY. Software* Downoad PuTTY. Download PuTTY Download the putty.zip file. It contains several programs for SSH, SFTP, and SCP.

Apache Manual Install Ubuntu Php Mysql. Phpmyadmin No >>>CLICK HERE<<<

Apache Install Instructions Win7 7 Php Mysql. Phpmyadmin Linux >>>CLICK HERE<<<

Automated Installation Guide for CentOS (PHP 7.x)

Cloud Computing II. Exercises

SUREedge MIGRATOR INSTALLATION GUIDE FOR VMWARE

Installing and Upgrading Cisco Network Registrar Virtual Appliance

Software Installation Manual

SIMICART USER GUIDE SERIES. SimiCart Install SimiConnector

Installing Oxwall completely in Amazon Cloud

Installing MediaWiki using VirtualBox

SOA Software API Gateway Appliance 6.3 Administration Guide

Quick Start Guide for Intel FPGA Development Tools on the Microsoft* Azure* Platform

Configuring the WebDAV Folder for Adding Multiple Files to the Content Collection and Editing Them

Kollaborate Server. Installation Guide

CSCI 201 Lab 1 Environment Setup

How To Start Mysql Use Linux Command Line Client In Ubuntu

Parallel Programming Pre-Assignment. Setting up the Software Environment

Amazon Web Services Hands on EC2 December, 2012

Ftp Command Line Manual Windows Username Password Linux

Deployment Guide. 3.1 For Windows For Linux Docker image Windows Installation Installation...

Winscp System Error. Code 3. The System Cannot Find The Path Specified

Ftp Command Line Commands Linux Example Windows Put

DogeCash Masternode Setup Guide Version 1.2 (Ubuntu 16.04)

Below are the steps to install Orangescrum Self Hosted version of Cloud Edition in Ubuntu Server Last Updated: OCT 18, 2018

Setting up PuTTY. CTEC1767 Data Communications & Networking CTEC1863 Operating Systems CTEC1906 Internet Computing

Virtual Machine. Release 1.0. Howard Chivers

Using Blackboard Drive to upload/manage content in Blackboard Learn

Metasploit. Installation Guide Release 4.4

Live Data Connection to SAP Universes

Altova CbC Reporting Solution. Installation Guide

Telnet/SSH. Connecting to Hosts. Internet Technology 1

SCCM Plug-in User Guide. Version 3.0

1Integrate for ArcGIS Installation Guide. Server Edition

Zadara Enterprise Storage in

Illustrated Steps to create greggroeten.net with AWS

LB Cache Quick Start Guide v1.0

SUREedge Migrator Installation Guide for Amazon AWS

Nagios Core AMI Setup Guide

Creating a Yubikey MFA Service in AWS

Transcription:

Bitnami Ruby for Huawei Enterprise Cloud Description Bitnami Ruby Stack provides a complete development environment for Ruby on Rails that can be deployed in one click. It includes most popular components for building Rails applications. Which components are installed with the Bitnami Ruby Stack? The Bitnami Ruby Stack ships the components listed below. If you want to know which specific version of each component is bundled in the stack you are downloading, check the README.txt file on the download page or in the stack installation directory. You can also find more information about each component using the links below. Main components Ruby scripting language Rails framework Apache Web server MySQL database server Git RVM Subversion Memcache PHP scripting language (optional) phpmyadmin web application management tool for MySQL database (optional) Dependencies and additional components Varnish proxy cache server ImageMagick tool SQLite database ModSecurity module XDebug module Xcache module OAuth module

Memcache module FastCGI module GD library OpenSSL library CURL library OpenLDAP library PEAR and PECL package manager tools How to find a specific component? Find the different components of the stack in these directories. Note that some components may not be available on all platforms. /opt/bitnami/mysql/: MySQL Database. /opt/bitnami/ruby/: Ruby, Ruby gems, Rails /opt/bitnami/git/: Distributed version control system /opt/bitnami/sqlite/: SQLite database server /opt/bitnami/apache2/: Apache Web server /opt/bitnami/memcached/: Distributed memory object caching system /opt/bitnami/nginx/: NGinx Web server /opt/bitnami/sphinx/: Sphinx search engine /opt/bitnami/perl/: Perl scripting language /opt/bitnami/varnish/: Varnish cache server /opt/bitnami/licenses/: License files /opt/bitnami/php/: PHP /opt/bitnami/apps/phpmyadmin: Management tool for MySQL How can I get started with Ruby? To get started, we suggest the following steps: Step 1. Create a new Rails application. To create a new Rails application, initialize a new project as below. Remember to replace the APPNAME placeholder with the actual name of your project. rails new APPNAME For more information, refer to these instructions. Step 2. Install gems.

You might need to install gems for your project. You can do this easily with the gem install command. For example, run the following command to install Rake: sudo gem install rake For more information, refer to these instructions. Step 3. Deploy your Rails application. To deploy your application, start the Rails server by running the following command: bundle exec rails s This will start the Rails server for your application on port 3000. Find more information about how to access the application using your Web browser. For a production environment, we recommend configuring Apache or Nginx with Passenger before starting to serve your application. For more information, refer to these instructions. How to start or stop the services? Each Bitnami stack includes a control script that lets you easily stop, start and restart services. The script is located at /opt/bitnami/ctlscript.sh. Call it without any service name arguments to start all services: sudo /opt/bitnami/ctlscript.sh start Or use it to restart a single service, such as Apache only, by passing the service name as argument: sudo /opt/bitnami/ctlscript.sh restart apache Use this script to stop all services: sudo /opt/bitnami/ctlscript.sh stop Restart the services by running the script without any arguments: sudo /opt/bitnami/ctlscript.sh restart

Obtain a list of available services and operations by running the script without any arguments: sudo /opt/bitnami/ctlscript.sh How can I run a command in the Bitnami Ruby Stack? Log in to the server console as the bitnami user and run the command as usual. The required environment is automatically loaded for the bitnami user. For example, this command executes a simple Ruby program: ruby -e 'print 1+1' You can also use other commands, including rvm, as shown below: rvm info How to access a Ruby server application? For security reasons, Ruby server applications are accessible only when using 127.0.0.1 as the hostname. To access the application, it is necessary to create an SSH tunnel by forwarding port 3000 on the Ruby server to port 3000 on the local host. Refer to the FAQ for platform-specific instructions to create the SSH tunnel. An example of configuring the SSH tunnel using PuTTY on Windows is displayed below.

How to upload files to the server with SFTP? NOTE: Bitnami applications can be found in /opt/bitnami/apps. When uploading files via SFTP, you must have the server's IP address, username and password or, if you chose to deploy the server with an SSH key instead of a password, you must have the server username and corresponding SSH private key in.ppk format (for Windows) or in.pem format (for Linux and Mac OS X). To obtain the IP address for your server, follow these steps: Log in to the Huawei Cloud Server Console. Navigate to the "Computing -> Elastic Cloud Server" section. Note the public IP address for the server you wish to connect to.

Once you have confirmed that you have the IP address and correct SSH credentials for your server, follow the instructions below depending on the platform you wish to use. Although you can use any SFTP/SCP client to transfer files to your server, this guide documents FileZilla (Windows, Linux and Mac OS X), WinSCP (Windows) and Cyberduck (Mac OS X). Using an SSH Key Once you have your server's SSH key, choose your preferred application and follow the steps below to connect to the server using SFTP. FileZilla IMPORTANT: To use FileZilla, your server private key should be in PPK format. Follow these steps: Download and install FileZilla. Launch FileZilla and use the "Edit -> Settings" command to bring up FileZilla's configuration settings. Within the "Connection -> SFTP" section, use the "Add keyfile" command to select the private key file for the server. FileZilla will use

this private key to log in to the server. Use the "File -> Site Manager -> New Site" command to bring up the FileZilla Site Manager, where you can set up a connection to your server. Enter your server host name and specify bitnami as the user name.

Select "SFTP" as the protocol and "Ask for password" as the logon type. Use the "Connect" button to connect to the server and begin an SFTP session. You might need to accept the server key, by clicking "Yes" or "OK" to proceed. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. If you have problems accessing your server, get extra information by use the "Edit -> Settings -> Debug" menu to activate FileZilla's debug log.

WinSCP IMPORTANT: To use WinSCP, your server private key should be in PPK format. Follow these steps: Download and install WinSCP. Launch WinSCP and in the "Session" panel, select "SFTP" as the file protocol.

Enter your server host name and specify bitnami as the user name. Click the "Advanced " button and within the "SSH -> Authentication -> Authentication parameters" section, select the private key file for the server. WinSCP will use this private key to log in to the server.

From the "Session" panel, use the "Login" button to connect to the server and begin an SCP session. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. If you need to upload files to a location where the bitnami user doesn't have write permissions, you have two options: Once you have configured WinSCP as described above, click the "Advanced " button and within the "Environment -> Shell" panel, select sudo su - as your shell. This will allow you to upload files using the administrator account. Upload the files to the /home/bitnami directory as usual. Then, connect via SSH and move the files to the desired location with the sudo command, as shown below: sudo mv /home/bitnami/uploaded-file /path/to/desired/location/ Cyberduck

IMPORTANT: To use Cyberduck, your server private key should be in PEM format. Follow these steps: Select the "Open Connection" command and specify "SFTP" as the connection protocol. In the connection details panel, under the "More Options" section, enable the "Use Public Key Authentication" option and specify the path to the private key file for the server.

Use the "Connect" button to connect to the server and begin an SFTP session. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. Using a Password Once you have your server's SSH credentials, choose your preferred application and follow the steps below to connect to the server using SFTP. FileZilla Follow these steps: Download and install FileZilla. Launch FileZilla and use the "File -> Site Manager -> New Site" command to bring up the FileZilla Site Manager, where you can set up a connection to your server. Enter your server host name. Select "SFTP" as the protocol and "Ask for password" as the logon type. Use bitnami as the server username and the password generated

during the server deployment process. Use the "Connect" button to connect to the server and begin an SFTP session. You might need to accept the server key, by clicking "Yes" or "OK" to proceed. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. If you have problems accessing your server, get extra information by use the "Edit -> Settings -> Debug" menu to activate FileZilla's debug log.

WinSCP Follow these steps: Download and install WinSCP. Launch WinSCP and in the "Session" panel, select "SFTP" as the file protocol.

Enter your server host name and set bitnami as the server username. From the "Session" panel, use the "Login" button to connect to the server and begin an SCP session. Enter the password when prompted. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. Cyberduck Follow these steps:

Select the "Open Connection" command and specify "SFTP" as the connection protocol. In the connection details panel, enter the server IP address, bitnami as the username, and the password generated during the deployment

process. Use the "Connect" button to connect to the server and begin an SFTP session. You should now be logged into the /home/bitnami directory on the server. You can now transfer files by dragging and dropping them from the local server window to the remote server window. How to install gems in the Bitnami Ruby Stack? Log in to the server console as the bitnami user and run the gem install command. For example, run the following command to install Rake: sudo gem install rake What versions are available of the Bitnami Ruby Stack?

Currently available versions include: Ruby Stack v1.9.3: Includes the latest version of Ruby 1.9.x and Rails 3.2.x Ruby Stack v2.0.0: Includes the latest version of Ruby 2.0.x and Rails 4.x Ruby Stack v2.1.6: Includes the latest version of Ruby 2.1.x and Rails 4.x Ruby Stack v2.2.2: Includes the latest version of Ruby 2.2.x and Rails 3.2.x The Bitnami Ruby Stack also includes RVM and it is possible to install any Ruby version on top of the Bitnami Ruby Stack. Read more about RVM. How to start with the sample Rails project? The sample project is located in the /opt/bitnami/projects/sample folder. Start the Rails server with the sample application. cd /opt/bitnami/projects/sample sudo ruby bin/rails server (for Rails 3.x) sudo ruby bin/server (for Rails 2.x) You should see something like this: => Booting WEBrick => Rails 4.2.2 application starting on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [ ] INFO WEBrick 1.3.1 [ ] INFO ruby 2.0.0 (2015-04-13) [x86_64-darwin10.0.0] [ ] INFO WEBrick::HTTPServer#start: pid=3061 port=3000 You should now be able to access the sample application. How to create a new Rails application?

To create a new Rails application, change to the /home/bitnami directory and initialize a new project as below. Remember to replace the APPNAME placeholder with the actual name of your project. cd /home/bitnami rails new APPNAME Next, start the Rails server by running the following command: cd /home/bitnami/appname bundle exec rails s This will start the Rails server for your application on port 3000. Find more information about how to access the application using your Web browser. How to deploy a new Rails application? There are different ways to deploy a Rails application. Using Apache with Passenger The most common way to deploy a Rails application with the Bitnami Ruby/JRuby Stack is with Apache and Passenger. Follow the steps below: Create a new file at /home/bitnami/httpd-vhosts.conf and fill it with the following content. <VirtualHost *:80> ServerName HOST_NAME DocumentRoot "/home/bitnami/appname/public/" <Directory "/home/bitnami/appname/public/"> Options -MultiViews <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3>

Require all granted </IfVersion> RailsEnv development PassengerEnabled on PassengerAppRoot "/home/bitnami/appname/" </Directory> </VirtualHost> Remember to replace the HOST_NAME placeholder with the host name of your cloud server and the APPNAME placeholder with the correct directory for your Rails application. Next, edit the /opt/bitnami/apache2/conf/bitnami/bitnami-appsvhosts.conf file and add the following line to the end of the file: Include /home/bitnami/httpd-vhosts.conf Restart the Apache server. sudo /opt/bitnami/ctlscript.sh restart apache After restarting Apache, the application should be accessible by browsing to http://server-ip/. NOTE: Remember that you might need to adjust the permissions of your application directory and sub-directories to make them accessible to the user that the Apache server runs as - for example, with the command sudo chown bitnami.daemon /home/bitnami/appname. Using Nginx with Passenger Follow these steps: To configure Nginx to run at port 80, stop the Apache service. To do this, run the command below: sudo /opt/bitnami/ctlscript.sh stop apache Once the Apache service has been stopped, modify the server configuration at /opt/bitnami/nginx/conf/nginx.conf to be similar to this.

server { listen 80; root /opt/bitnami/appname/public; passenger_enabled on; rails_env development; } NOTE: The configuration above runs Passenger in development mode because, by default, Passenger starts in production mode which requires a secret to be configured. Using development mode bypasses this requirement and lets you test that everything is working correctly. When deploying to production, remember to change this value and provide a secret. Before restarting Nginx to apply this configuration, disable Apache as shown below: sudo /opt/bitnami/ctlscript.sh stop apache sudo mv /opt/bitnami/apache2/scripts/ctl.sh /opt/bitnami/apache2/ scripts/ctl.sh.disabled sudo mv /opt/bitnami/config/monit/conf.d/apache.conf /opt/bitnami /config/monit/apache.conf.disabled Restart the Nginx service to apply the new configuration: sudo /opt/bitnami/ctlscript.sh restart nginx With this, your Ruby on Rails application will run at the root of your domain through the default HTTP port (80). You should now be able to access your Ruby on Rails applications with Nginx and Passenger on http://server-ip/. How to create a new MySQL database for a Rails application? To create a new MySQL database for a Rails application: Start the MySQL command line client, as shown below. Enter the password for the MySQL root user.

mysql -u root -p At the MySQL prompt, run the following commands. Remember to replace the DBNAME, APPNAME and PASSWORD placeholders with actual values for your database name, application name and database user password. mysql> CREATE DATABASE IF NOT EXISTS DBNAME_production; mysql> CREATE DATABASE IF NOT EXISTS DBNAME_development; mysql> CREATE DATABASE IF NOT EXISTS DBNAME_test; mysql> GRANT ALL PRIVILEGES on DBNAME_test.* to 'APPNAME'@'localh ost' identified by 'PASSWORD'; mysql> GRANT ALL PRIVILEGES on DBNAME_production.* to 'APPNAME'@' localhost'; mysql> GRANT ALL PRIVILEGES on DBNAME_development.* to 'APPNAME'@ 'localhost'; mysql> FLUSH PRIVILEGES; Edit the config/database.yml file in your Rails project directory and update the database configuration. You can also copy the database.yml file from a sample or fresh project and modify the database details as needed: development: adapter: jdbc driver: com.mysql.jdbc.driver url: jdbc:mysql://localhost:3306/dbname_development username: APPNAME password: PASSWORD test: adapter: jdbc driver: com.mysql.jdbc.driver url: jdbc:mysql://localhost:3306/dbname_test

username: APPNAME password: PASSWORD production: adapter: jdbc driver: com.mysql.jdbc.driver url: jdbc:mysql://localhost:3306/dbname_production username: APPNAME password: PASSWORD How to access phpmyadmin? For security reasons, phpmyadmin is accessible only when using 127.0.0.1 as the hostname. To access it from a remote system, you must create an SSH tunnel that routes requests to the Apache Web server from 127.0.0.1. This implies that you must be able to connect to your server over SSH in order to access these applications remotely. IMPORTANT: Before following the steps below, ensure that your Apache and MySQL servers are running. NOTE: The steps below suggest using port 8888 for the SSH tunnel. If this port is already in use by another application on your local machine, replace it with any other port number greater than 1024 and modify the steps below accordingly. Similarly, if you have enabled Varnish, your stack's Apache Web server might be running on port 81. In this case, modify the steps below to use port 81 instead of port 80 for the tunnel endpoint. Windows To access the application using your Web browser, create an SSH tunnel, as described below. Download PuTTY and make sure you can log in to the server console with it following the instructions in the FAQ. Once you have confirmed you are able to log in successfully, log back out. Reconnect to the server using PuTTY, this time adapting the steps to include an additional SSH tunnel. When configuring the new SSH session in PuTTY, additionally navigate to the "Connection -> SSH ->

Tunnels" section and create a secure tunnel by forwarding port 80 on the server to port 8888 on the local host (127.0.0.1 or localhost). Click the "Add" button to add the secure tunnel configuration to the session. Here is an example: Go back to the "Session" section and save your changes by clicking the "Save" button. Click the "Open" button to open an SSH session to the server. The SSH session will now include a secure SSH tunnel between the two specified ports. While the tunnel is active, you should be able to access the phpmyadmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin. To log in, use username root for MySQL and the application password from the detail page for your cloud server. If you are unable to access phpmyadmin, verify that the SSH tunnel was created by checking the PuTTY event log (accessible via the "Event Log" menu):

Linux and Mac OS X To access the application using your Web browser, create an SSH tunnel, as described below. Open a new terminal window on your local system (for example, using "Finder -> Applications -> Utilities -> Terminal" in Mac OS X or the Dash in Ubuntu). Make sure you can log in to the server console following the instructions in the FAQ. Once you have confirmed you are able to log in successfully, log back out. Run the following command to configure the SSH tunnel. Remember to replace SERVER-IP with the public IP address or hostname of your server. Enter your SSH password when prompted. ssh -N -L 8888:127.0.0.1:80 bitnami@server-ip If you are using a private key to connect to the server, use the following command instead, remembering to replace KEYFILE with the path to your private key and SERVER-IP with the public IP address or hostname of your server: ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@server-ip NOTE: If successful, the above commands will create an SSH tunnel but will not display any output on the server console. While the tunnel is active, you should be able to access the phpmyadmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin. To log in, use username root for MySQL and the application password from the detail page for your cloud server.