Deploy your Bitnami Ruby Stack on Google Cloud Platform now! Launch Now

Bitnami Ruby for Google Cloud Platform

Description

Ruby on Rails is a full-stack development environment optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.

First steps with the Bitnami Ruby Stack

Welcome to your new Bitnami application running on Google Cloud Platform! Here are a few questions (and answers!) you might need when first starting with your application.

What credentials do I need?

You need two sets of credentials:

  • The application password that allows you to log in to your new Bitnami application.
  • The server credentials that allow you to log in to your Google Cloud Platform server using an SSH client and execute commands on the server using the command line. These credentials consist of an SSH username and key.

What SSH username should I use for secure shell access to my application?

SSH username: bitnami

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

What are the default ports?

A port is an endpoint of communication in an operating system that identifies a specific process or a type of service. Bitnami stacks include several services or servers that require a port.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Port 22 is the default port for SSH connections.

Bitnami opens some ports for the main servers. These are the ports opened by default: 80, 443.

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

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 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.

PuTTY tunnel config

How to upload files to the server with SFTP?

NOTE: Bitnami applications can be found in /opt/bitnami/apps.
  • If you are using the Bitnami Launchpad for Google Cloud Platform, obtain your server SSH key by following these steps:

    • Browse to the Bitnami Launchpad for Google Cloud Platform dashboard and sign in if required using your Bitnami account.
    • Select the "Virtual Machines" menu item.
    • Select your cloud server from the resulting list.
    • Download the SSH key for your server in PPK or PEM format. Note the server IP address on the same page.

Server information

NOTE: Replace USERNAME in the commands below with your Google Cloud platform username.
	$ sudo su USERNAME
	$ ssh-keygen -t rsa -f ~/.ssh/my-ssh-key -C USERNAME
  • Enter the passphrase twice. The SSH key pair will be generated and saved in /home/USERNAME/.ssh/my-ssh-key and /home/USERNAME/.ssh/my-ssh-key.pub.

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.

Watch the following video to learn how to upload files to your Google Cloud server with SFTP using FileZilla. The example below shows a server launched using the Bitnami launchpad, but this video is applicable to those servers launched using the GCP Marketplace.

Or you can 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.

    FileZilla configuration

  • 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.

    FileZilla configuration

  • 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.

FileZilla 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 "SCP" as the file protocol.
  • Enter your server host name and specify bitnami as the user name.

    WinSCP configuration

  • 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.

    WinSCP configuration

  • 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.

    WinSCP configuration

  • 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.

    Cyberduck configuration

  • 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.

    Cyberduck configuration

  • 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 connect instances hosted in separate virtual networks or VPCs?

The Google Cloud Platform makes it possible to connect instances hosted in separate Virtual Private Clouds (VPCs), even if those instances belong to different projects or are hosted in different regions. This feature, known as VPC Network Peering, can result in better security (as services do not need to be exposed on public IP addresses) and performance (due to use of private, rather than public, networks and IP addresses).

Learn more about VPC Network Peering.

How to find the MySQL database credentials?

How to find the PostgreSQL database credentials?

How to connect to the MySQL database?

You can connect to the MySQL database from the same computer where it is installed with the mysql client tool.

$ mysql -u root -p

You will be prompted to enter the root user password. This is the same as the application password.

How to connect to the PostgreSQL database?

You can connect to the PostgreSQL database from the same computer where it is installed with the psql client tool.

$ psql -U postgres

You will be prompted to enter the *postgres* user password. This is the same as the [application password](/google/faq#how-to-find-application-credentials).

How to connect to Ruby from a different machine?

For security reasons, the Ruby ports in this solution cannot be accessed over a public IP address. To connect to Ruby from a different machine, you must open port 80, 443 for remote access. Refer to the FAQ for more information on this.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

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 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 Web and database 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 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.

Accessing phpMyAdmin on Windows

Watch the following video to learn how to easily access phpMyAdmin on Windows through an SSH tunnel:

TIP: Refer to these instructions to learn how to obtain your private key.

In order to access phpMyAdmin via SSH tunnel you need an SSH client. In the instructions below we have selected PuTTY, a free SSH client for Windows and UNIX platforms. The first step is having PuTTY configured. Please, check how to configure it in the section how to connect to the server through SSH using an SSH client on Windows.

Once you have your SSH client correctly configured and you tested that you can successfully access to your instance via SSH, you need to create an SSH tunnel in order to access phpMyAdmin. For doing so, follow these steps:

  • In the "Connection -> SSH -> Tunnels" section, add a new forwarded port by introducing the following values:

    • Source port: 8888
    • Destination: localhost:80

    This will create a secure tunnel by forwarding a port (the "destination port") on the remote server to a port (the "source port") on the local host (127.0.0.1 or localhost).

  • Click the "Add" button to add the secure tunnel configuration to the session. (You'll see the added port in the list of "Forwarded ports").

    PuTTY configuration

  • In the "Session" section, 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.
  • Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin.
  • Log in to phpMyAdmin by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

Access phpMyAdmin

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):

PuTTY configuration

Accessing phpMyAdmin on 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 that you have your SSH credentials (.pem key file) in hand.
  • Run the following command to configure the SSH tunnel. Remember 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 command will create an SSH tunnel but will not display any output on the server console.
  • Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin.
  • Log in to phpMyAdmin by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

Access phpMyAdmin

How to access phpPgAdmin?

For security reasons, phpPgAdmin 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 PostgreSQL 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.

Accessing phpPgAdmin on Windows

In order to access phpPgAdmin via SSH tunnel you need an SSH client. In the instructions below we have selected PuTTY, a free SSH client for Windows and UNIX platforms. The first step is having PuTTY configured. Please, check how to configure it in the section how to connect to the server through SSH using an SSH client on Windows.

Once you have your SSH client correctly configured and you tested that you can successfully access to your instance via SSH, you need to create an SSH tunnel in order to access phpPgAdmin. For doing so, follow these steps:

  • In the "Connection -> SSH -> Tunnels" section, add a new forwarded port by introducing the following values:

    • Source port: 8888
    • Destination: localhost:80

    This will create a secure tunnel by forwarding a port (the "destination port") on the remote server to a port (the "source port") on the local host (127.0.0.1 or localhost).

  • Click the "Add" button to add the secure tunnel configuration to the session. (You'll see the added port in the list of "Forwarded ports").

    PuTTY configuration

  • In the "Session" section, 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.
  • Access the phpPgAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phppgadmin.
  • Log in to phpPgAdmin by using the following credentials:

    • Username: postgres
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

phpPgAdmin

If you are unable to access phpPgAdmin, verify that the SSH tunnel was created by checking the PuTTY event log (accessible via the "Event Log" menu):

PuTTY configuration

Accessing phpPgAdmin on 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 that you have your SSH credentials (.pem key file) in hand.
  • Run the following command to configure the SSH tunnel. Remember 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 command will create an SSH tunnel but will not display any output on the server console.
  • Access the phpPgAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phppgadmin.
  • Log in to phpPgAdmin by using the following credentials:

    • Username: postgres
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

phpPgAdmin

How to reset the MariaDB root password?

Please note that depending on the version you have installed, you may find the MariaDB files at /opt/bitnami/mysql

If you don't remember your MariaDB root password, you can follow the steps below to reset it to a new value:

  • Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):

     UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
     FLUSH PRIVILEGES;
    
  • Stop the MariaDB server:

     $ sudo /opt/bitnami/ctlscript.sh stop mariadb
    
  • Start MariaDB with the following command:

     $ sudo /opt/bitnami/mariadb/bin/mysqld_safe --defaults-file=/opt/bitnami/mariadb/my.cnf --pid-file=/opt/bitnami/mariadb/data/mysqld.pid --init-file=/home/bitnami/mysql-init 2> /dev/null &
    
  • Restart the MariaDB server:

     $ sudo /opt/bitnami/ctlscript.sh restart mariadb
    
  • Remove the init script

     $ rm /home/bitnami/mysql-init
    

How to change the MariaDB root password?

You can modify the MariaDB password using the following command at the shell prompt:

$ /opt/bitnami/mariadb/bin/mysqladmin -p -u root password NEW_PASSWORD

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 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 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-apps-vhosts.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'@'localhost' 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 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 create a full backup of Ruby?

Backup

The Bitnami Ruby Stack is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

Follow these steps:

  • Change to the directory in which you wish to save your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Create a compressed file with the stack contents:

      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    
  • Restart all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

You should now download or transfer the application-backup.tar.gz file to a safe location.

Restore

Follow these steps:

  • Change to the directory containing your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Move the current stack to a different location:

      $ sudo mv /opt/bitnami /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directoryv

      $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

How to debug errors in your database?

The main log file is created at /opt/bitnami/mysql/data/mysqld.log on the MySQL database server host.

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.

google

Bitnami Documentation