Bitnami HHVM Installer

NOTE: Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under "Start -> Bitnami APPNAME Stack -> Application console" (Windows). Learn more.
NOTE: When running the commands shown on this page, replace the installdir placeholder with the full installation directory for your Bitnami stack.

Description

HHVM is an open source virtual machine designed for executing programs written in Hack and PHP. HHVM achieves a superior performance while maintaining the development flexibility that PHP provides.

First steps with the Bitnami HHVM Stack

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

What are the system requirements?

Before you download and install your application, check that your system meets these requirements.

How do I install the Bitnami HHVM Stack?

Windows, OS X and Linux installer
  • Download the executable file for the Bitnami HHVM Stack from the Bitnami website.

  • Run the downloaded file:

    • On Linux, give the installer executable permissions and run the installation file in the console.
    • On other platforms, double-click the installer and follow the instructions shown.

Check the FAQ instructions on how to download and install a Bitnami Stack for more details.

The application will be installed to the following default directories:

Operating System Directory
Windows C:\Bitnami\APPNAME-VERSION
Mac OS X /Applications/APPNAME-VERSION
Linux /opt/APPNAME-VERSION (running as root user)
OS X VM
  • Download the OS X VM file for the Bitnami HHVM Stack from the Bitnami website.
  • Begin the installation process by double-clicking the image file and dragging the WordPress OS X VM icon to the Applications folder.
  • Launch the VM by double-clicking the icon in the Applications folder.

What credentials do I need?

You need application credentials, consisting of a username and password. These credentials allow you to log in to your new Bitnami application.

What is the administrator username set for me to log in to the application for the first time?

  • For Windows, Linux and OS X installers, the username was configured by you when you first installed the application.
  • For OS X VMs, the username can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

What is the administrator password?

  • For Windows, Linux and OS X installers, the password was configured by you when you first installed the application.
  • For OS X VMs, the password can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

How to start or stop the services?

Linux

Bitnami native installers include a graphical tool to manage services. This tool is named manager-linux-x64.run on Linux and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

      $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql, postgresql or apache:

      $ sudo installdir/ctlscript.sh restart mysql
      $ sudo installdir/ctlscript.sh restart postgresql
      $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

      $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

Mac OS X

Bitnami native installers include a graphical tool to manage services. This tool is named manager-osx on Mac OS X and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

    $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql or apache:

     $ sudo installdir/ctlscript.sh restart mysql
     $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

     $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

NOTE: If you are using the stack manager for Mac OS X-VM, please check the following blog post to learn how to manage services from its graphical tool.

Windows

Bitnami native installers include a graphical tool to manage services. This tool is named manager-windows.exe on Windows and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The Windows native installer creates shortcuts to start and stop services created in the Start Menu, under "Programs -> Bitnami APPNAME Stack -> Bitnami Service". Servers can also be managed from the Windows "Services" control panel. Services are named using the format APPNAMESERVICENAME, where APPNAME is a placeholder for the application name and SERVICENAME is a placeholder for the service name. For example, the native installer for the Bitnami WordPress Stack installs services named wordpressApache and wordpressMySQL.

These services will be automatically started during boot. To modify this behaviour, refer to the section on disabling services on Windows.

Which components are installed with the Bitnami HHVM Stack?

The Bitnami HHVM Stack is based on our LAMP stack, with the main difference that it includes HHVM configured to serve PHP files. Find out about the components included in the LAMP stack.

How can I get started with HHVM?

To get started, we suggest the following steps:

Step 1: Deploy your PHP application

The main directory to deploy your PHP application is installdir/apache2/htdocs. You can copy your PHP application files to that directory and access the application via your browser. If you do not have a PHP application yet, we suggest deploying the PHP info example.

Do you have issues trying to connect to your server? Check our FAQ.

Step 2: Access phpMyAdmin

phpMyAdmin is a PHP-based application intended to handle the administration of MySQL over the Web. Find out how to access it.

How to find the MySQL 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 HHVM from a different machine?

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

IMPORTANT: Bitnami Native Installers do not modify the firewall configuration of your computer, therefore the HHVM ports could be open which is a significant security risk. You are strongly advised to close the HHVM ports (refer to the FAQ for more information on this).

How to access phpMyAdmin?

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

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

How to reset the MariaDB root password?

Please note that depending on the version you have installed, you may find the MariaDB files at installdir/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 installdir/ctlscript.sh stop mariadb
    
  • Start MariaDB with the following command:

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

     $ sudo installdir/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:

$ installdir/mariadb/bin/mysqladmin -p -u root password NEW_PASSWORD

How can I run a command in the Bitnami HHVM Stack?

Load the Bitnami Console and then run the command as usual.

Which components are installed with the Bitnami HHVM Stack?

The Bitnami HHVM Stack is based on our LAMP stack, with the main difference that it includes HHVM configured to serve PHP files. Find out about the components included in the LAMP stack.

How to check the installed PHP modules?

The easiest way to check which PHP modules are installed is to create a test script using the phpinfo() function. Open your favorite text editor and type:

<?php phpinfo(); ?>

Save the file as phptest.php in installdir/apache2/htdocs/. Make sure Apache is up and running, open a browser and type http://localhost/phptest.php. You should then see a screen showing detailed information about the PHP version you are using and installed modules.

You can also run the following command:

$ installdir/php/bin/php -m

How to create a custom PHP application?

Many users run a Bitnami stack as a development environment for their own PHP projects (as opposed to running third-party applications such as Joomla! or WordPress). To deploy your PHP application in this environment, you have two options:

  • To make a single PHP application accessible at the root URL of the Web server (for example, http://localhost), simply copy the PHP files into the installdir/apache2/htdocs folder. For an example, take a look at the phpinfo example.

  • To have several applications running, create the same structure used by Bitnami when installing Bitnami PHP applications. Recent versions of Bitnami stacks ship a demo application with this structure to help you get started. To use this, follow the steps below:

    • Copy the installdir/docs/demo folder into the installdir/apps directory.

      $ sudo cp -r installdir/docs/demo installdir/apps
      
    • Add the following line to the end of the installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf file:

      Include "installdir/apps/demo/conf/httpd-prefix.conf"
      
    • Restart the Apache server using the command-line tool.

      $ sudo installdir/ctlscript.sh restart apache
      

    You should now be able to access the demo application at http://localhost/demo. You should see a "Hello world" message in your browser.

  • If your stack does not include a demo application, or if you prefer to create a custom PHP application from scratch, follow the steps below. These steps assume that your application will live in the installdir/apps/myapp/ directory:

    • Run the following commands to create the directories:

      $ sudo mkdir installdir/apps/myapp
      $ sudo mkdir installdir/apps/myapp/htdocs/
      $ sudo mkdir installdir/apps/myapp/conf
      
    • Create and edit the installdir/apps/myapp/conf/httpd-prefix.conf file and add the line below to it:

      Alias /myapp/ "installdir/apps/myapp/htdocs/"
      Alias /myapp "installdir/apps/myapp/htdocs/"
      Include "installdir/apps/myapp/conf/httpd-app.conf"
      
    • Create and edit the installdir/apps/myapp/conf/httpd-app.conf file and add the content below to it. This is the main configuration file for your application, so modify it further depending on your application's requirements.

      <Directory installdir/apps/myapp/htdocs/>
          Options +FollowSymLinks
          AllowOverride None
          <IfVersion < 2.3 >
          Order allow,deny
          Allow from all
          </IfVersion>
          <IfVersion >= 2.3>
          Require all granted
          </IfVersion>
      </Directory>
      
      NOTE: If your application uses .htaccess files, you should change the AllowOverride None option to AllowOverride All. Find out how to move the .htaccess file content to the main server configuration file.
    • Once you have created the files and directories above, add the following line to the end of the main Apache configuration file at installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:

      Include "installdir/apps/myapp/conf/httpd-prefix.conf"
      
    • Restart the Apache server:

      $ sudo installdir/ctlscript.sh restart apache
      

      You should now be able to access the application at http://localhost/myapp.

How can I deploy my PHP application?

The main directory to deploy your PHP application is installdir/apache2/htdocs. You can copy your PHP application files to that directory and access the application via your browser at http://localhost/.

How to create a full backup of HHVM?

The Bitnami HHVM 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.

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

Backup on Linux and Mac OS X

Follow these steps:

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

     $ cd /your/directory
    
  • Stop all servers.

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

     $ sudo tar -pczvf application-backup.tar.gz installdir
    
  • Start all servers.

     $ sudo installdir/ctlscript.sh start
    
  • Download or transfer the application-backup.tar.gz file to a safe location.

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

Backup on Windows

Follow these steps:

  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Create a compressed file with the stack contents. You can use a graphical tool like 7-Zip or WinZip or just right-click the folder, click "Send to", and select the "Compressed (zipped) folder" option.

  • Download or transfer the compressed file to a safe location.

  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

Restore on Linux and Mac OS X

Follow these steps:

  • Change to the directory containing your backup:

    $ cd /your/directory
    
  • Stop all servers.

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

    $ sudo mv installdir /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directory:

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

    $ sudo installdir/ctlscript.sh start
    
IMPORTANT: When restoring, remember to maintain the original permissions for the files and folders. For example, if you originally installed the stack as the root user on Linux, make sure that the restored files are owned by root as well.

Restore on Windows

  • Change to the directory containing your backup:

       $ cd /your/directory
    
  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Uninstall the previous services by executing the following command:

        $ serviceinstall.bat
    
  • Create a safe folder named Backups in the desktop and move the current stack to it. Remember to replace PATH with the right location of your folder:

        $ move installdir \PATH\Backups
    
  • Uncompress the backup file using a tool like 7-Zip or Winzip or just double-click the .zip file to uncompress it, and move it to the original directory.
  • Install services by running the following commands from an elevated command prompt:

      $ cd installdir
      $ serviceinstall.bat INSTALL
    
  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

How to debug errors in your database?

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

When installing an application module with the native installer, you can execute the installation script from the server console.

  • Change to the directory containing the downloaded module and make it executable. Then, execute the installation script. For example, if you're installing WordPress, you would use commands similar to the following:

      $ cd /tmp
      $ chmod +x ./bitnami-wordpress-*-module-linux-x64-installer.run
      $ sudo ./bitnami-wordpress-*-module-linux-x64-installer.run
    
  • During the installation process, you will need to specify the installation directory of your Bitnami HHVM Stack. The installation directory is the one selected by you during the Bitnami HHVM Stack installation process.

  • During the installation process, you will also need to specify the database administrator's password (the password for user root for MySQL databases and user postgres for PostgreSQL databases). The password is the one specified by you during the Bitnami stack installation process.

  • During the installation process, you will also be prompted to create an administrator account for the application, by providing a user name and/or an email address. Some application modules may also ask you to specify a password.

    NOTE: If not specifically prompted for a password, the default administrator password for the application is automatically set to the same value as the database administrator's password provided in the previous step. This default administrator password can be changed at any time through the application's Web administration panel or Web dashboard, after the module has been successfully installed.

After the installation process is complete, access the installed application by browsing to http://localhost/APPNAME. For example, if you have installed WordPress, you can access it at http://localhost/wordpress. To access the application's administration panel or Web dashboard, use the application administrator account credentials set during the module installation process.

To run the installed application module using a virtual host instead of at http://localhost/APPNAME, use the conf/httpd-vhosts.conf Apache configuration file included with the module following the instructions to configure your application to use a virtual host.

nativeInstaller

Bitnami Documentation