BitNami AMP Stacks

    BitNami AMP Stacks greatly simplify the development and deployment of PHP applications. A BitNami stack is a preconfigured environment that is available as native installers, virtual machines and cloud images . AMP stands for Apache-MySQL-PHP and is the generic name for platform specific stacks, as described below. 

    How do I download and install AMP Stack?

    The name of the Stack depends on the platform. It is called WAMP for Windows, MAMP for OS X and LAMP for Linux. You can download the specific stack for your operating system at the following links:

    wampstack-stack-icon.png  mampstack-stack-icon.png  lampstack-stack-icon.png

     

     

     

     

    If you are interested in working with the PostgreSQL database instead of MySQL, there are also Stacks available that include PostgreSQL in place of MySQL:

    wappstack-stack-icon.png  mappstack-stack-icon.png  lappstack-stack-icon.png

     

     

     

     

    Which components are installed with AMP Stacks?

    The BitNami AMP 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:

    • PHP scripting languange
    • Apache Web server
    • MySQL database server
    • phpMyAdmin web application management tool for MySQL database
    • PostgreSQL database sever (optional)
    • phpPgAdmin web application management tool for PostgreSQL (optional)

    Optional frameworks for development:

    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

    How do I log in into my virtual machine or AMI?

    BitNami AMP Stacks can also be deployed as virtual machines. If you are using the virtual machine, please see our Virtual Appliances documentation for instructions on logging into the machine.

    The Stacks can be also deployed as AMIs in the Amazon cloud. Please take a look at our Amazon Cloud Images quick guide to see how to connect to the instance from your machine.

    BitNami AMP Stacks are distributed free of charge under the Apache 2.0 license.

    What is the default installation directory?

    When using native installers the default installation directory depends on the platform and can be changed during the installation:

    win_platform.png On Windows: C:\BitNami\wampstack-VERSION (On previous versions, the default installation directory was C:\Program Files\BitNami WAMP Stack)

    mac_platform.png On OS X: /Applications/mampstack-VERSION

    linux_platform.png On Linux: /home/user/lampstack-VERSION

    If you are using a virtual machine or the AMI, the default installation directory is "/opt/bitnami".

    How do I start and stop the servers?

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

    Graphical tool

    The Stacks include a graphical tool to manage the servers easily. You can find the "manager-windows.exe", "manager-osx" or "manager-linux" tool in your installation directory. Using this tool, you can Start, Stop or Restart the servers and check the log files. You can click on the icon to start it.

    manager-servers.png

     

    manager-osx.png

     

     

     

     

     

     

     

     

     


    win_platform.png

    On Windows: You can also start the Manager tool from shortcuts: Start -> Program Files -> BitNami Stack -> Manager tool

    Command line tool

    If you prefer, you can use the "ctlscript.sh" utility from the command line. This script is in the installation directory.

    linux_platform.png

    On Virtual Machines and Cloud images:

    $ sudo /opt/bitnami/ctlscript.sh start

    A native installer on Linux:

    $ cd ~/application-version
    $ ./ctlscript.sh start
    

    mac_platform.png

     

    On OS X: You can start the Manager tool from the installation directory or you can use the "ctlscript.sh" utility from a Terminal.

    host:~ user$ cd /Applications/application-version
    host:~ user$ ./ctlscript.sh start

    How can I check the PHP configuration with phpinfo?

    Once the installation or deployment finishes, you can access the welcome page from your browser. If you have installed the stack on a local machine as a regular user, you can access it at http://localhost on Windows or http://localhost:8080 on OS X and Linux. If not, you can specify the IP address of the server where you installed the Stack.

    You should see something similar to this page:

    welcome-lamp.png

     

    In recent versions of AMP Stacks, there is a "docs" folder in the installation directory that contains some PHP examples. There is a "phpinfo.php" script file that shows the current PHP configuration and is typically used to check that PHP was installed correctly. In order to be able to access it, you first need to place it in a publicly accessible location. Copy the installdir/docs/phpinfo.php file into the installdir/apache2/htdocs folder and go to your browser to check the enabled PHP modules. by accessing http://localhost/phpinfo.php (or http://localhost:8080/phpinfo.php if running in port 8080) You should see something similar to this page:

    phpinfo.png

    How can I add applications on top of AMP?

    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 BitNami application (For example: WordPress, Joomla!, Drupal, SugarCRM...) on top of an existing BitNami AMP stack deployment. Depending on your platform, you can download modules from:

    WAMP: http://bitnami.com/stack/wamp/modules

    LAMP: http://bitnami.com/stack/lamp/modules

    MAMP: http://bitnami.com/stack/mamp/modules

    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 of your installed AMP stack. If you are using the virtual machine or AMI, the default installation directory is "/opt/bitnami".

    module-installdir.png

    You will also need to specify the MySQL root password. This password is the same as the one that you specified in your AMP installation. If you are using the virtual machine or AMIs, 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 OS X or Linux. Substitute localhost for the right 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

    If you are using a BitNami AMP Stack in a machine without a graphical interface, 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-*
    

    What are the "development" and "production" modes?

    Some applications are able to be configured in different ways:

    - Production:  File permissions and configuration settings will be set with security and performance in mind. Installing certain plugins, themes and updates may require manual changes or installing additional services like FTP.  Recommended if this stack will be deployed on a public server.

    We configured applications using the "production" mode for Bitnami Virtual Machines and Cloud Images by default. These servers already include a local FTP server (vsftpd) that it is only available for local connections (not remote connections). Some applications like WordPress, Joomla!, Magento or Drupal are configured to use this server to download and install plugins, themes or any extension.

    If you install a module or a stack and you select the "production" mode, these applications will request a FTP account in order to download any extension. If you already have configured a FTP server in your machine you can use this mode.

    - Development: Enables changes to file permissions and configuration settings that make it easy to install plugins, themes and updates for certain applications, but that are not optimal from a security standpoint. Recommended if you are using this stack for development purposes or within your company.

    If you want to develop locally, this mode is easier for you so do not want to worry about permissions in your installation.

    How can I create a custom PHP application?

    Many users run BitNami AMP stacks as development environments for their own PHP projects (as opposed to running third-party applications such as Joomla! or WordPress). If you want your PHP application to be accessible at the root URL ( http://localhost/ ), you can simply copy your PHP files into the installdir/apache2/htdocs folder. For an example, take a look at phpinfo.

    If you want to have several applications running on top of AMP Stack, we suggest that you create the same structure that we use when installing BitNami PHP applications. Recent versions of AMP Stack ship a demo application with this structure that can help you get started. Simply copy the installdir/docs/demo folder into the installdir/apps directory and add the following line at the end of the installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf file:

    Include "installdir/apps/demo/conf/httpd-prefix.conf"
    

     

    Substitute installdir with the actual installation directory for your deployment.

    Once you are done with the above, restart the Apache server. If you are running the stack in your desktop or laptop, you can use the bundled graphical Manager tool that is included in your installation directory.

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

    You can learn more about the BitNami PHP application structure here.

    How can I access phpMyAdmin or phpPgAdmin?

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

    For security reasons, these applications will be accessible only when using 127.0.0.1 as the hostname. If you are using a native installer you can access from your own machine but if you are using a Virtual Machine, Amazon cloud image or Windows Azure cloud image, please check the connection steps below.

    Amazon cloud / BitNami Hosting

    By default phpMyAdmin and phpPgAdmin are not accessible from the outside for security reasons. In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:

    1. Get your SSH private key if you don't have it already. More info

     

    Note: Below we use port 8888 as an example, in most cases this port will be available and you will be able to use it. If that port is already used by other application in your local machine you can replace the port 8888 with any other port number greater than 1024.

     

    2. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

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

    Note: If everything is ok you will not get an output and the command will be running in your command prompt while the tunnel is active.

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "8888"
      • Destination: "localhost:80" 
    • Click Open

    3. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is:

    • username: root ("administrator" for legacy versions) for MySQL or postgres for PostgreSQL database.
    • password: bitnami (for BitNami AMIs), <application password> (for BitNami Cloud Hosting)

    Take a look at this link about how to get your application password for BCH servers

     

    Note: If you have enabled Varnish, it is possible that you changed the Apache port to 81. In this case you should specify this port to access phpMyAdmin

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

    Native Installer

    To test your phpMyAdmin installation, first make sure that your Apache and MySQL servers are up and running.  For phpPgAdmin you should check that the PostgreSQL database is running.
     
    To do so, you can use the included "ctlscript.sh" utility. The installdir for Virtual Appliances and AMIs is "/opt/bitnami".
    $ cd your_installdir
    $ ./ctlscript.sh status
    

    If you need to start or stop the servers, you just have to follow the steps described here.

    You can access your phpMyAdmin installation by opening a browser and typing http://127.0.0.1:8080/phpmyadmin or http://127.0.0.1/phpmyadmin. And to access phpPgAdmin, you can type the following urls instead: http://127.0.0.1:8080/phppgadmin or http://127.0.0.1/phppgadmin

    phpmyadmin.png

    For phpMyAdmin the default root user is root, and for phpPgAdmin the default database root user is postgres. The password is the same that you set during the installation.

    Virtual Machine

    If you are running the Virtual Appliance in a secure environment, you can enable it by editing the "/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf" file and replace "Allow from 127.0.0.1" with "Allow from all" (if your server is running Apache 2.2) or "Require local" with "Require all granted" (if you server is running Apache 2.4 or later) :

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

    Then you should restart Apache to load the changes:

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

    Then you can access at the same URL with "/phpmyadmin" or "/phppgadmin", for example http://YOUR_IP/phpmyadmin

    For phpMyAdmin the default root user is root, and for phpPgAdmin the default database root user is postgres. For Virtual Appliances the password is "bitnami" (or "bitnami1" in the Magento case)

    Azure cloud

    By default phpMyAdmin and phpPgAdmin are not accessible from the outside for security reasons. In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:

    1. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    $ ssh -N -L 8888:127.0.0.1:80 your_azure_user@xxx.cloudapp.com
    

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "8888"
      • Destination: "localhost:80" 
    • Click Open

    2. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is:

    • username: root for MySQL or postgres for PostgreSQL database.
    • password: bitnami (for BitNami Azure images) or bitnami1 in the Magento case.

    Tabs end

    How can I run a command in the AMP Stack?

    All of the 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 when you want to invoke commands to access different binaries, as explained below. Note that in virtual machines or AMIs, the environment is already loaded for the "bitnami" user automatically and the below is not necessary.

    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, rake among others. 

    linux_platform.png On Linux:

    $ cd installdir
    $ ./use_application
    

    For instance, in Wordpress Stack:

    $ cd /opt/wordpress-3.0
    $ ./use_wordpress
    

    win_platform.png On Windows:

    There is a shortcut in Start -> BitNami Application Stack -> "Application console" or "Use Application Stack"

    mac_platform.png On OS X:

    Open a Terminal and type the following:

    hostname:~ user$ cd /Applications/application-version
    hostname:~ user$ ./use_application
    

    For instance, in Wordpress Stack:

    hostname:~ user$ cd /Applications/wordpress-3.0
    hostname:~ user$ ./use_wordpress
    

    Note: If you are using BitNami Cloud Hosting, a virtual machine or a Cloud image the Stack environment is loaded by default and you don't need to start the console.

    How to run a system command without the stack environment?

    Bitnami stacks ship all the requirements and libraries necessary for deploying a web application. All the binaries in the stack are linked to these libraries and they require to use that version. It is usual the same libraries but different version are already installed in your system, f.e. libjpeg.so or libpng.so. 

    If you want to run a system command that is not included in the stack, it is possible that this binary requires to use the system library instead of the stack library version. It is possible you see a similar error like the following:

    Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /opt/local/lib/libJPEG.dylib

    or

    Can't load '/opt/bitnami/perl/lib/5.8.8/x86_64-linux/auto/File/Glob/Glob.so' for module File::Glob: /opt/bitnami/perl/lib/5.8.8/x86_64-linux/auto/File/Glob/Glob.so: undefined symbol: PL_sv_undef at /opt/bitnami/perl/lib/5.8.8/x86_64-linux/XSLoader.pm line 70.

    In this case it is useful to run the command using "env -i" to clear the environment. For example, if you want to run a system command from a PHP application (f.e. "sendmail"):

    sendmail_path = "env -i /usr/sbin/sendmail -t -i"

     


     

    Comments

    You must login to post a comment.