Bitnami Ruby Stack

    The Bitnami Ruby Stack greatly simplifies the development and deployment of Ruby on Rails and its runtime dependencies. It includes ready-to-run versions of Ruby, Rails, MySQL, Git, Subversion, RVM and other components.

    How do I download and install Ruby Stack?

    The Bitnami Ruby Stack is available as a native installer for Windows, Mac OS X and Linux operating systems, as a virtual machine and as a cloud image for Bitnami Cloud Hosting, Google Cloud Platform, Microsoft Azure, VMware vCloud Air and DigitalOcean Cloud.

    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

    You can download all these versions from http://bitnami.com/stack/ruby. Please review the Quick Start Guide for your platform to get started with the Bitnami Ruby Stack:

    The Bitnami Ruby Stack also includes RVM and it is possible to install any Ruby version on top of the Bitnami Ruby Stack. Refer to the RVM guide for more information.

    The Bitnami Ruby Stack is distributed free of charge under the Apache 2.0 license.

    Which components are installed with 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 in 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
    • APC module
    • GD library
    • OpenSSL library
    • CURL library
    • OpenLDAP library
    • PEAR and PECL package manager tools

    What is the default installation directory?

    The installation directory for the Bitnami Ruby Stack differs depending on your chosen platform.

    Bitnami Cloud Hosting

    The default installation directory is /opt/bitnami.

    Microsoft Azure

    The default installation directory is /opt/bitnami.

    Google Cloud Platform

    The default installation directory is /opt/bitnami.

    VMware vCloud Air

    The default installation directory is /opt/bitnami.

    DigitalOcean Cloud

    The default installation directory is /opt/bitnami.

    Virtual Machine

    The default installation directory is /opt/bitnami.

    Native Installer

    The default installation directory is listed below for each platform

    • Windows: C:\BitNami\rubystack-VERSION (On previous versions, the default installation directory was C:\Program Files\BitNami Ruby Stack)
    • Mac OS X: /Applications/rubystack-VERSION
    • Linux: /home/USER/rubystack-VERSION

    Tabs end

    How do I start and stop the servers?

    The Bitnami Ruby Stack ships several servers that must be started before you will be able to work with them. By default, the MySQL database and Apache Web servers are automatically started after installation.

    You can use either the graphical manager tool or the command-line tool to start and stop the servers.

    Graphical Tool

    Bitnami stacks include a graphical tool to manage the servers easily (native installers only). Using this tool, you can start, stop and restart the servers and check the log files.

    manager-servers.png

     

     

     

     

     

     

     

     

     

     

    On Windows:

    • Double-click the "manager-windows.exe" file in your installation directory.  
    • You can also start the Manager tool using the Start Menu path Start -> Program Files -> Bitnami Stack -> Manager.

    On Linux and Mac OS X:

    • Double-click the "manager-osx" or "manager-linux-*" tool in your installation directory. 
    Command-line Tool

    Each Bitnami stack includes a control script that lets you easily stop, start and restart servers. Refer to the section for your platform to learn more.

    Cloud Server

    The script is located at /opt/bitnami/ctlscript.sh. Call it without any arguments to restart all services:

    $ sudo /opt/bitnami/ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ sudo /opt/bitnami/ctlscript.sh restart mysql
    

    Virtual Machine

    The script is located at /opt/bitnami/ctlscript.sh. Call it without any arguments to restart all services:

    $ sudo /opt/bitnami/ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ sudo /opt/bitnami/ctlscript.sh restart mysql
    

    Native Installer

    The control script is only available for Linux and Mac OS X native installers. The script is located in your installation directory and named ctlscript.sh. Call it without any arguments to restart all services.

    On Linux:
    If your installation directory is /home/USER/wordpress-4.0.1-0, call the control script with the ‘start’ argument to start all servers. For example:

    $ cd /home/USER/wordpress-4.0.1-0
    $ ./ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ cd /home/USER/wordpress-4.0.1-0
    $ ./ctlscript.sh restart mysql
    

    On Mac OS X:
    If your installation directory is /Applications/wordpress-4.0.1-0, call the control script with the ‘start’ argument to start all servers. For example:

    $ cd /Applications/wordpress-4.0.1-0
    $ ./ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ cd /Applications/wordpress-4.0.1-0
    $ ./ctlscript.sh restart mysql
    

    Tabs end

    How can I run a command in the Ruby Stack?

    Select your platform for instructions on how to run commands in your stack.

    Bitnami Cloud Hosting

    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
    

    Microsoft Azure

    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
    

    Google Cloud Platform

    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
    

    VMware vCloud Air

    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
    

    DigitalOcean Cloud

    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
    

    Virtual Machine

    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
    

    Native Installer

    All native installers for Bitnami Stacks are completely self-contained and run independently of the rest of the software or libraries installed on your system. To work correctly, certain environment variables need to be set before accessing different binaries in the stack.

    The Bitnami console is a script to load the stack environment. This console is useful to run any command included in the stack: mysql, php, openssl, ruby, rvm, rake among others.

    On Linux:
    At the server console, enter the following commands:

    $ cd ~/rubystack-VERSION
    $ ./rubyconsole
    

    On Windows:

    From the Start Menu, click the Start -> Bitnami Ruby Stack -> Use Ruby Stack shortcut. Alternatively, execute the use_ruby.bat script from your stack installation directory.

    On OS X:

    Open a Terminal and type the following commands:

    $ cd /Applications/rubystack-VERSION
    $ ./rubyconsole
    

    Once the Ruby console has loaded, execute a Ruby command as you normally would. 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
    

     

    IMPORTANT: The Bitnami Ruby Stack can co-exist nicely with other existing Ruby installations on your system. Running a Ruby command through the Bitnami console will use the components/files that are part of the Bitnami Ruby Stack. Running a Ruby command outside the Bitnami console will use your existing Ruby installation. To illustrate, if you run the command gem install rails through the Bitnami console, it will install the Rails gems into the Bitnami Ruby Stack. However, if you run the same command outside the console, it will be install the Rails gems into your other (non-Bitnami) Ruby environment.

    Tabs end

    How to install gems in your Ruby Stack?

    Select your platform for instructions on how to install gems in your stack. If you are installing a gem that requires compilation, you will need compilation tools like make, g++ and others. On cloud images and virtual machines, these compilation tools are already pre-installed. For native installers, you must separately install these tools.

    Bitnami Cloud Hosting

    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
    

    Microsoft Azure

    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
    

    Google Cloud Platform

    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
    

    VMware vCloud Air

    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
    

    DigitalOcean Cloud

    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
    

    Virtual Machine

    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
    

    Native Installer

    If you want to install a gem in the Bitnami Ruby Stack, run the gem install command. Note that this command should be run only after loading the Bitnami console, as described here. For example, use this sequence of commands to install Rake:

    $ ./rubyconsole
    $ gem install rake
    

    If you are installing a gem that requires compilation, you will need compilation tools like make, g++ and others. On native installers, these compilation tools can be installed separately as discussed below.

    On Linux:
    If you are using Ubuntu, install the "build-essential" package via apt as shown below:

    $ sudo apt-get install build-essential
    

    If you are using a different Linux distribution, install g++ and build packages separately following the instructions provided by your distribution.

    On Windows:
    The Bitnami Ruby Stack already includes a Development Kit for Windows users. It is a MSYS/MinGW-based toolkit that enables you to build many of the native C/C++ extensions available for Ruby.

    On OS X:
    On OS X, either install Xcode 4.1 (preferred), use the osx-gcc-installer from Kenneth Reitz, or use Xcode 4.2+.

    NOTE: The osx-gcc-installer is a stripped-down version of Xcode 4.1, which only includes GCC and the required libraries. The limitation of this solution is that it does not include certain headers (such as the Carbon/Cocoa headers found in the main Xcode installation) because of licensing restrictions. This means that some native gems will fail to compile. Registered Apple developers can get the necessary header packs from Apple.

    NOTE: Xcode 4.2+ versions use a non-compatible version of GCC. To use these, first install Xcode 4.1 and then upgrade to your desired version, answering "no" when asked to remove prior versions. Once the upgrade is complete, compile using the binary at /usr/bin/gcc-4.2.

    Tabs end

    How to start with the sample Rails project?

    NOTE: The steps below are only applicable to native installers. For cloud servers and virtual machines, you should create a new Rails project as described here.

    When using a native installer, the sample project is located in the installdir/projects/sample folder. Follow these steps:

    1. Load the Bitnami console.

    $ cd installdir
    $ ./rubyconsole
    

    2. Start the Rails server with the sample application.

    $ cd installdir/projects/sample
    $ ruby bin/rails server (for Rails 3.x)
    $ 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 at http://localhost:3000/ from your browser.

    How to create your own Rails project?

    Select your platform below to learn how to initialize a new Rails project.

    Bitnami Cloud Hosting

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.


    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com
    

    Remember to replace 'bitnami-hosting.pem' in the previous commands with the path to your private key file, and 'xyz.bitnamiapp.com' with the public IP address or hostname of your server. Note that if successful, this command 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 your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.

    Microsoft Azure

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 bitnami@xyz.cloudapp.com
    

    Remember to replace 'bitnami' with the SSH username from your credentials pair and 'xyz.cloudapp.net' with the public IP address or hostname of your server. Enter your SSH password when prompted. Note that if successful, this command 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 your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.


    Google Cloud Platform

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 -i bitnami-gce-project-name.pem bitnami@100.101.102.103

    Remember to replace 'bitnami-gce-project-name.pem' in the previous commands with the path to your private key file, and '100.101.102.103' with the public IP address or hostname of your server. Note that if successful, this command 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 your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.

    VMware vCloud Air

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 bitnami@100.101.102.103
    

    Remember to replace '100.101.102.103' with the public IP address or hostname of your server. Enter your SSH password when prompted. Note that if successful, this command 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 your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.

    DigitalOcean Cloud

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 -i bitnami-do-unique-id.pem bitnami@100.101.102.103

    Remember to replace 'bitnami-do-unique-id.pem' in the previous commands with the path to your private key file, and '100.101.102.103' with the public IP address or hostname of your server. Note that if successful, this command will create an SSH tunnel but will not display any output on the server console.

    hile the tunnel is active, you should be able to access your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.

    Virtual Machine

    To create a new Rails project, 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.

    To access the application using your Web browser, create an SSH tunnel to port 3000, as described below.

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server. In the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the Rails application by forwarding source port "3000" to destination port "localhost:3000".
    • Click the "Add" button to add the secure tunnel configuration to the session.

      tunnel.png

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 3000:127.0.0.1:3000 bitnami@192.168.56.101

    Remember to replace '192.168.56.101' with the network IP address or hostname of your server. Enter the password when prompted. Note that if successful, this command 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 your Rails application through the secure SSH tunnel you created, by browsing to http://localhost:3000/.


    Native Installer

    To create a new Rails project, load the Bitnami console, change to the installdir directory and initialize a new project as below. Remember to replace the APPNAME placeholder with the actual name of your project.

    $ cd installdir
    $ ./rubyconsole
    $ rails new APPNAME
    

    Next, start the Rails server by running the following command:

    $ cd installdir/APPNAME
    $ bundle exec rails s
    

    This will start the Rails server for your application on port 3000. You can now access the application by browsing to http://localhost:3000 using your Web browser.

    TIP: If you see an error on Linux stating "Could not find a JavaScript runtime", you must add the rubyracer gem (already included in the Bitnami Ruby Stack) into the Gemfile, as below:

    ...
    gem 'sqlite3'
    gem 'therubyracer'
    ...
    


    Tabs end

    Here is an example of what you will see:

    welcome.png

    How to create a MySQL database for my new Rails application?

    Select your platform below for more information.

    Bitnami Cloud Hosting

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    

    Microsoft Azure

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    


    Google Cloud Platform

    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
    

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    

    VMware vCloud Air

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    

    DigitalOcean Cloud

    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
    

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    

    Virtual Machine

    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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /opt/bitnami/mysql/tmp/mysql.sock
    

    Native Installer

    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.

    $ cd installdir/mysql
    $ 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: mysql2
      database: DBNAME_development
      username: APPNAME
      password: PASSWORD
      host: localhost
      socket: /installdir/mysql/tmp/mysql.sock
      #port: 3306
    test:
      adapter: mysql2
      database: DBNAME_test
      username: APPNAME
      password: PASSWORD
      socket: /installdir/mysql/tmp/mysql.sock
      #port: 3306
    production:
      adapter: mysql2
      database: DBNAME_production
      username: APPNAME
      password: PASSWORD
      socket: /installdir/mysql/tmp/mysql.sock
      #port: 3306
    

     

     NOTE: For Linux and Mac OS X installers, use the 'socket' configuration parameter. For Windows installers, use the 'port' parameter.


    Tabs end

    How can I add applications on top of Ruby Stack?

    Bitnami Native Installers come in two formats: stand-alone Stacks and Modules. If you only want to install one Bitnami-packaged application, then just download and install the Stack. It will contain everything you need to run the application.

    If you want to run more than one application, you can install several application Modules on top of it. That way, all of the Bitnami-packaged applications you want to run will share a single instance of Apache, MySQL and PHP, which will save space and improve performance.

    nuevo_php_stacks.jpg 

    You can download and install any PHP-based or Ruby-based Bitnami applications (eg. WordPress, Joomla!, Redmine, SugarCRM and others) on top of an existing Bitnami Ruby Stack deployment. You can do so by downloading and installing a module. You can download the available modules for the Bitnami Ruby Stack at http://bitnami.com/stack/ruby/modules

    IMPORTANT: PHP is optional for the Bitnami Ruby Stack. If you want to install a PHP-based application on top of the Bitnami Ruby Stack, you should enable PHP during the installation priocess.

    Once you have downloaded the module, click on it to start the installation process. During the installation process, you will need to specify the  installation directory for your Ruby Stack.

    module-installdir.png

    You will also need to specify the MySQL root password. This password is the same as the one during the Bitnami Ruby Stack installation (for native installers) or generated during the deployment process (for cloud servers). On virtual machines, the default password is "bitnami".

    module-password.png

    After the installation process is complete, you can access the installed application from your browser. For example, if you have installed WordPress, you can access it at http://localhost/wordpress on Windows or http://localhost:8080/wordpress on Mac OS X or Linux. Substitute localhost with the correct IP address or domain name if you are using a virtual machine or cloud server. The username and password is specified during the installation of the module. You will see something similar to:

    module-link.png

    NOTE: If you are using a Bitnami Ruby Stack in a machine without a graphical interface, note that you can run the module installer in text mode. You can use the following command to download and install any Bitnami module from the command line:

    $ wget http://bitnami.com/... (Link to the module)
    $ chmod 755 bitnami-*
    $ ./bitnami-*
    

    How can I deploy my 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 Stack is with Apache and Passenger. Select your platform below for the steps involved.

    Bitnami Cloud Hosting

    To use this method, follow the steps below:

    1. 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 /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your cloud server's host name.

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


    Microsoft Azure

    To use this method, follow the steps below:

    1. 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 /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your cloud server's host name.

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


    Google Cloud Platform

    To use this method, follow the steps below:

    1. 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 /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your cloud server's host name.

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


    VMware vCloud Air

    To use this method, follow the steps below:

    1. 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 /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your cloud server's host name.

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


    DigitalOcean Cloud

    To use this method, follow the steps below:

    1. 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 /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your cloud server's host name.

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


    Virtual Machine

    To use this method, follow the steps below:

    1. 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 or IP address of your virtual machine and the /home/bitnami/APPNAME path with the correct path to your Rails application.

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

    3. Restart the Apache server.

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to your virtual machine's IP address or host name.

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


    Native Installer

    To use this method, follow the steps below:

    1. Create a new file at installdir/httpd-vhosts.conf and fill it with the following content.

    <VirtualHost *:80>
       ServerName HOST_NAME
       DocumentRoot "installdir/APPNAME/public/"
        <Directory "installdir/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 "installdir/APPNAME/"
        </Directory>
    </VirtualHost>
    

    Remember to replace the HOST_NAME placeholder with the host name of your cloud server and the installdir/APPNAME path with the correct path to your Rails application.

    2. Next, edit the installdir/apache2/conf/bitnami/bitnami-apps-vhosts.conf file and add the following line to the end of the file:

    Include installdir//httpd-vhosts.conf
    

    3. Restart the Apache server.

    $ installdir/ctlscript.sh restart apache
    

    After restarting Apache, the application should be accessible by browsing to http://localhost.

    Tabs end

    Using Nginx with Passenger

    This guide will work for our Cloud Instances, Bitnami Cloud Hosting and Virtual Machines. If you have installed RubyStack in your system, you must override "/opt/bitnami" with your installation directory.

    To configure Nginx to run at port 80, you must stop the apache service before. To do it, you must run:

    /opt/bitnami/ctlscript.sh stop apache

    Once the apache service has been stopped, you must modify the server configuration of /opt/bitnami/nginx/conf/nginx.conf  and be sure that your configuration is similar to this:

    server {
        listen 80;
        server_name example.com;
        root /opt/bitnami/apps7;
        passenger_enabled on;
    
        pagespeed on;
        pagespeed FileCachePath /opt/bitnami/nginx/var/ngx_pagespeed_cache;
    
        #  Ensure requests for pagespeed optimized resources go to the pagespeed
        #  handler and no extraneous headers get set.
        location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
        location ~ "^/ngx_pagespeed_static/" { }
        location ~ "^/ngx_pagespeed_beacon$" { }
        location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
        location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
    }

    With that code, you will be running your Ruby on Rails application on the root of your domain, and will be running through the default HTTP port (80). Before restart Nginx to apply this configuration, we recommend to disable apache from the RubyStack default services.

    To do it, you only need to run this commands:

    /opt/bitnami/ctlscript.sh stop apache
    mv /opt/bitnami/apache2/scripts/ctl.sh /opt/bitnami/apache2/scripts/ctl.sh.disabled
    mv /opt/bitnami/config/monit/conf.d/apache.conf /opt/bitnami/config/monit/apache.conf.disabled
    

    Now, you must restart the Nginx service to apply the new configuration

    /opt/bitnami/ctlscript.sh restart nginx

    And with the last step, you will be able to access to your Ruby on Rails applications with Nginx + Passenger on http://example.com/ 

    How can I access phpMyAdmin?

    phpMyAdmin and phpPgAdmin are popular web-based management tools for the MySQL and PostgreSQL databases.

    For security reasons, these applications are accessible only when using 127.0.0.1 as the hostname. To access them 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 have an SSH private key and 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/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.

     

    Follow the steps below for your platform.

    Bitnami Cloud Hosting

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server and in the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the phpMyAdmin application by forwarding source port "8888" to destination port "localhost:80".
    • Click the "Add" button to add the secure tunnel configuration to the session.

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 8888:127.0.0.1:80 -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com
    

    Remember to replace 'bitnami-hosting.pem' in the previous commands with the path to your private key file, and 'xyz.bitnamiapp.com' with the public IP address or hostname of your server. Note that if successful, this command 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 phpMyAdmin and phpPgAdmin through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin and http://127.0.0.1:8888/phppgadmin respectively.

    To log in, use username 'root' for phpMyAdmin or 'postgres' for phpPgAdmin. For the application password, refer to the "Servers -> Manage Server" page of your Bitnami Cloud Hosting dashboard, under the "Application Password" section.

    Refer to this page for more information on obtaining application credentials.

    Microsoft Azure

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server and in the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the phpMyAdmin application by forwarding source port "8888" to destination port "localhost:80".
    • Click the "Add" button to add the secure tunnel configuration to the session.

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 8888:127.0.0.1:80 bitnami1@xyz.cloudapp.net
    

    Remember to replace 'bitnami1' with the SSH username from your credentials pair and 'xyz.cloudapp.net' with the public IP address or hostname of your server. Note that if successful, this command 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 phpMyAdmin and phpPgAdmin through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin and http://127.0.0.1:8888/phppgadmin respectively.

    To log in, use username 'root' for phpMyAdmin or 'postgres' for phpPgAdmin and password 'bitnami'.

    Google Cloud Platform

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server and in the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the phpMyAdmin application by forwarding source port "8888" to destination port "localhost:80".
    • Click the "Add" button to add the secure tunnel configuration to the session.

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 8888:127.0.0.1:80 -i bitnami-gce-project-name.pem bitnami@100.101.102.103

    Remember to replace 'bitnami-gce-project-name.pem' in the previous commands with the path to your private key file, and '100.101.102.103' with the public IP address or hostname of your server. Note that if successful, this command 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 phpMyAdmin and phpPgAdmin through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin and http://127.0.0.1:8888/phppgadmin respectively.

    To log in, use username 'root' for phpMyAdmin or 'postgres' for phpPgAdmin. For the application password, follow the steps below:

    • 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 Bitnami AMP Stack server from the resulting list.
    • Obtain credentials by selecting "Show" under "Credentials".

    Refer to this page for more information on obtaining application credentials.

    Virtual Machine

    On Windows:

    • Make sure you can log in to the server using PuTTY. Refer to these instructions for more information.
    • Open a new SSH session to the server and in the PuTTY settings for the new session, click "Connection → SSH → Tunnels" section and create a secure tunnel for the phpMyAdmin application by forwarding source port "8888" to destination port "localhost:80".
    • Click the "Add" button to add the secure tunnel configuration to the session.

    • Go back to the "Session" section and save your changes by clicking the "Save" button.
    • Click the "Open" button to open a new SSH session to the server.

    On Linux and Mac OS X:

    $ ssh -N -L 8888:127.0.0.1:80 bitnami@192.168.1.1
    

    Remember to replace '192.168.1.1' with the network IP address or hostname of your virtual server. Note that if successful, this command 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 phpMyAdmin and phpPgAdmin through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin and http://127.0.0.1:8888/phppgadmin respectively.

    Alternative Approach: Allow Access from All Hosts

    Alternatively, if you are running the virtual machine in a secure environment, you can enable access to phpMyAdmin and phpPgAdmin from hosts other than 127.0.0.1 by editing the /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf file and modifying the Allow and Require directives as below:

      Default directive Modified directive
    Apache 2.2 Allow from 127.0.0.1 Allow from all
    Apache 2.4+ Require local Require all granted

    You can also use the example configuration file below if you wish:

     <IfDefine USE_PHP_FPM>
        <Proxy "unix:/opt/bitnami/php/var/run/phpmyadmin.sock|fcgi://phpmyadmin-fpm" timeout=300>
        </Proxy>
    </IfDefine>
    <Directory "/opt/bitnami/apps/phpmyadmin/htdocs">
    
    # AuthType Basic                                                                                                                                          
    # AuthName phpMyAdmin                                                                                                                                     
    # AuthUserFile "/opt/bitnami/apache2/users"                                                                                           
    # Require valid-user                                                                                                                                      
    AllowOverride None
    
    <IfModule php5_module>
            php_value upload_max_filesize 80M
    php_value post_max_size 80M
    </IfModule>
    
    <IfVersion < 2.3 >
    Order allow,deny
    Allow from all
    Satisfy all
    </IfVersion>
    <IfVersion >= 2.3>
    Require all granted
    </IfVersion>
    ErrorDocument 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname"
    
    
        <IfDefine USE_PHP_FPM>
           <FilesMatch \.php$>
             SetHandler "proxy:fcgi://phpmyadmin-fpm/"
           </FilesMatch>
        </IfDefine>
    
    </Directory>
    

    Restart Apache to have the changes take effect:

    $ cd /opt/bitnami
    $ sudo ./ctlscript.sh restart apache
    

    You should now be able to access phpMyAdmin and phpPgAdmin by browsing to http://[virtual-machine-IP-address]/phpmyadmin and http://[virtual-machine-IP-address]/phppgadmin respectively.

    To log in, use username 'root' for phpMyAdmin or 'postgres' for phpPgAdmin. The default password is 'bitnami'.

    Native Installer

    You should be able to access phpMyAdmin directly, by browsing to http://127.0.0.1:8080/phpmyadmin or http://127.0.0.1/phpmyadmin.

    You should be able to access phpPgAdmin by browsing to http://127.0.0.1:8080/phppgadmin or http://127.0.0.1/phppgadmin.

    The username is 'root' for phpMyAdmin and 'postgres' for phpPgAdmin, and the password is the one specified by you during the installation process.

    Tabs end

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    261649 view(s), 47 edit(s) and 69606 character(s)

    Comments

    You must login to post a comment.