Virtual Appliances Quick Start Guide BitNami documentation

http://wiki.bitnami.org/Virtual_Appliances_Quick_Start_Guide#How_to_start_your_BitNami_Virtual_Appliance.3f

Virtual Appliances Quick Start Guide - BitNami documentation

BitNami Virtual Machine Images, also known as virtual appliances, contain a minimal Linux operating system and a fully installed and configured BitNami application Stack. This allows you to run the application without actually installing it on your computer’s operating system. Using a virtualization platform, you can simply start and stop the BitNami Virtual Machine Image whenever you want to use the application. This allows you to keep it completely isolated from software installed on your machine.

After you download and extract a BitNami Virtual Machine Image (the file is compressed to reduce the download size), it will be ready to be deployed in your virtualization infrastructure. If you don’t already have a virtualization platform, or ‘hypervisor’, installed, you can download either VMWare Player or VirtualBox free of charge. Once you have one installed, you’ll be able to run a BitNami Virtual Machine Image.

To download a BitNami Virtual Machine Image, visit our download page, select your application of choice and then click on the download link.

 

How to start your BitNami Virtual Appliance?

We currently offer BitNami Virtual appliances as VMWare virtual machines. In order to run them you need to have virtualization software from VMWare already installed, such as VMWare Server or VMWare Player. You can download them for free at www.vmware.com.

BitNami appliances are distributed inside a compressed file, and you will need to extract them before being able to run them. After that, simply launch your VMWare server-console or your VMWare Player and open the .vmx image that you can find into the extracted folder.

VMWare ESX or ESXi

If you want to run on VMWare ESX or ESXi you can use the "vmkfstool" command line that you can find in your server host to import/export the machine:

$ vmkfstools -i original.vmdk new.vmdk

Another option is to use the VMWare vCenter Converter Tool to convert the machine to the .OVF format.

  1. Choose the .vmx file from the uncompresed folder.
  2. Select the destination type "Virtual appliance" and the distribution format "Folder of files".
  3. Edit the Product Information and set the Product Name.

Virtual Box

You can also start these machines on Virtual Box (http://www.virtualbox.org/). Virtual Appliances ship with an OVF file which makes it easy to import the machine in VirtualBox.

If the Virtual Appliance has this file, you can follow these steps:

  1. Go to File -> Import Appliance... and select the .ovf file
  2. Then go to Settings -> System -> Processor -> Enable PAE

And that's all, you can start the machine and access to the application from any computer on your Local Network.

If you are using Virtual Box 4 or later, it is necessary to convert the Application to the .OVF format. To be able to convert to this format you can follow the same steps to convert the machine that you can see in the previous ESX section.

If you would like to import the Virtual Appliance manually, you can do it following these steps:

  1. Create a new Virtual Machine and set that it is a Linux (Ubuntu or SuSE) machine.
  2. Configure RAM to 512 or higher.
  3. Choose "existing hard disk" and select the BitNami "vmdk" file.
  4. Once the machine creation finishes, go to Settings -> System -> Processor -> Enable PAE
  5. Go to Storage -> IDE Controller -> Add a new controller and select the BitNami vmdk file.  Remove the SATA hard disk.
  6. Start your machine

How to log into the BitNami Virtual Machine?

BitNami applications are started by default upon boot, but you will still need to log into the operating system to stop or restart the servers, edit configuration files and so on. Once you have started your BitNami Virtual Machine you will get an username prompt. The default user is "bitnami" and the password is "bitnami" by default (some older versions include "root" user instead). This info is showed during the first boot.

Once you have logged in the first time, the machine will request a new user password automatically and you should modify it for security reasons. If you want remote shell access to the virtual machine, you will need to enable the SSH server, which is disabled by default. You can find how to enable it in the Virtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f section.

How to access the BitNami Virtual Appliance?

The bundled BitNami application is automatically started upon boot. You can access it from your browser at http://aaa.bbb.ccc.ddd/. You will need to substitute 'aaa.bbb.ccc.ddd' with the actual IP address picked up by your machine. This address is typically assigned to it by a DHCP server in your network. The IP address will be displayed on screen at the end of the boot process.

Regarding the web application itself, the default user and password for the administrator of your application is "user" and the password "bitnami" in most cases. The exact username and password are provided at the end of the boot process and it is recommended that you change these values. You can do so from the application itself, as it varies from program to program.

You can also see your IP address by typing "ifconfig" in the command prompt after login in. If the machine does not show any IP logging in address try to force reloading the IP:

$ sudo /etc/init.d/networking force-reload

If your machine can not get a valid IP it is possible that you do not have a DHCP address or it is not configured to give IP addresses to unknown machines. In this case you have two options: you can use the VMWare DHCP server, or you can configure the network manually.

If you want to use the VMWare DHCP server, you can stop the machine, change the network settings to "NAT" instead of "BRIDGE" and start the machine. This IP is internal so you have only access to the application from the same computer where the Virtual Machine is running.

If you prefer to configure the network manually you can run the following commands in the Virtual Machine:

  1. Your local network uses one of the following IP addresses:
      192.168.X.X
      172.X.X.X
      10.X.X.X
    
  2. Depending on your network configuration you should use a different netmask. If you know a free IP address in your local network that the Virtual Machine could use, you can configure the network manually, for example:
    $ sudo ifconfig eth0 192.168.1.234 netmask 255.255.255.0 up 
    
  3. You can access the web application from any computer of your network at 192.168.1.234.

How to change the user password?

It is recommended that you change the default user password in the Virtual Machine. This password is automatically requested when you log into the virtual machine for the first time so it is likely that you have already changed it. You can also do so by logging into the console and typing "passwd" at the shell prompt.

How to enable sshd?

The "ssh" server is disabled by default. You can enable the "ssh" server as follows:

  • For Ubuntu
    $ sudo mv /etc/init/ssh.conf.back /etc/init/ssh.conf
    $ sudo start ssh
    
  • For openSUSE
    $ sudo chkconfig sshd on
    $ sudo /etc/init.d/sshd start
    

Now you can login from a different machine using "ssh" and the IP address of your Virtual Machine.

If you want to disable it you can use the reverse method:

  • For Ubuntu
    $ sudo stop ssh
    $ sudo mv /etc/init/ssh.conf /etc/init/ssh.conf.back
    
  • For openSUSE
    $ sudo /etc/init.d/sshd stop
    $ sudo chkconfig sshd off
    

IMPORTANT: Before enabling the sshd server you should modify your default user password for security reasons. In the next section, you can find more information on how to increase the server security.

How to copy files in the Virtual Appliance?

There are several ways to do that. You can install a FTP server in the virtual appliance using the package manager but this could not be easy and it is not secure neither. We encourage to use SCP (Secure Copy Protocol) to move your files to the Virtual Appliance.

This protocol requires to enable SSH in the machine which is not enabled for security reasons by default. You can find more info about how to do that atVirtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f

Then you can connect to the Virtual Appliance using the "bitnami" user credentials.

Try to use the following tools:

How to configure your sshd server to support key based authentication?

You need to create the pair of keys (public and private keys) using the following command in the Virtual Machine:

  $ ssh-keygen
  Generating public/private rsa key pair.
  Enter file in which to save the key (/home/bitnami/.ssh/id_rsa):
  Enter passphrase (empty for no passphrase):
  Enter same passphrase again:
  Your identification has been saved in /home/bitnami/.ssh/id_rsa.
  Your public key has been saved in /home/bitnami/.ssh/id_rsa.pub.
  The key fingerprint is:
  XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX bitnami@linux

We strongly recommend that you set a long passphrase. Once you have executed this command, you can check that there are two files in the /home/bitnami/.ssh/ folder:

  $ ls /home/bitnami/.ssh
  id_rsa  id_rsa.pub

Save your private key (id_rsa file) in a secure location and do not share it with anybody.

Once you have the key pair ready, you need to enable access to the machine. It is only necessary to write the public key into the /home/bitnami/.ssh/ file.

 
  $ cd /home/bitnami/.ssh
  $ cat id_rsa.pub >> /home/bitnami/.ssh/authorized_keys

Now edit the "/etc/ssh/sshd_config" file using the vi editor and uncomment (or add if not already present) the following lines:

  RSAAuthentication yes
  PubkeyAuthentication yes

To disable the basic authentication it is necessary to configure the following lines:

  ChallengeResponseAuthentication no
  PasswordAuthentication no
  UsePAM no

Then reload the server configuration:

  • For Ubuntu
      $ sudo /etc/init.d/ssh force-reload
    
  • For openSUSE
      $ sudo /etc/init.d/sshd force-reload
    

copy your private key "id_rsa" file in the client machine from which you will access the server.

  $ mkdir /home/user/.ssh
  $ cp /path/to/id_rsa /home/user/.ssh
  $ chmod 0600 -R /home/user/.ssh

and try to access to the Virtual Machine:

  $ ssh bitnami@IP_address
  Enter passphrase for key '/home/user/.ssh/id_rsa':


And that's all. If you do not want to repeat the passphrase you can run ssh-agent and ssh-add commands to save it during the session.

How to increase the RAM memory?

You can increase the RAM memory for the Virtual Machines using the settings tools in your VMWare application. All machines have 512 MB by default but it is recommended that you increase it depending of the number of users and the application performance. Recent versions of the Virtual Appliances include PAE kernel, which allows you to increase assigned RAM memory to more than 4Gb. The optimal setting will also depend on the host machine capabilities and the number of Virtual Machines running at the same time. A good practice is to share the RAM memory between the host and the Virtual Machine. For example, if your host machine has 2 GB of RAM and you are only running one virtual machine, you can increase the RAM of the Virtual Machine to 1 GB. It is not advisable to increase it more because at one point the host machine may run out of physical memory and use swap, decreasing overall performance.

How to configure the Firewall?

The SuSe Firewall is enabled by default and the only ports open are 80, 443 and 22. In the RubyStack and JRubyStack virtual appliances port 3000 is also open for development purposes by default.

In order to open a different port:

  • For Ubuntu
    You should run:
      $ sudo ufw allow $port
    
    If you need to modify the firewall configuration you can find more information about it at https://help.ubuntu.com/community/UFW.
  • For openSUSE
    You should include the port in the following line in the "/etc/sysconfig/SuSEfirewall2" file:
      FW_SERVICES_EXT_TCP="22 80 443"
    

    Then it is necessary to restart the firewall:
      $ sudo /etc/init.d/SuSEfirewall2_init restart
      $ sudo /etc/init.d/SuSEfirewall2_setup restart
    

    You can find more information about firewall configuration at http://en.opensuse.org/SuSEfirewall2.

How to ensure that my BitNami Virtual Appliance is accessible from other machines?

Some BitNami applications require you to reconfigure the IP/hostname if it changes during the boot.

If your Virtual Appliance seems to not be accessible from other machines, you should configure the application IP/hostname using the 'updateip' tool.


  $ sudo /opt/bitnami/updateip

How to configure the application IP/hostname?

By default, BitNami applications update their internal IP/hostname at boot time. However you may want to change it manually if the Virtual Machine has changed its IP. For doing that, execute:

  $ sudo /opt/bitnami/updateip --machine_hostname < ip or hostname >

or if you want the tool setting the current Virtual Machine IP you can type only:

  $ sudo /opt/bitnami/updateip

Then try to access from a remote machine. Please ensure that your Virtual Machine network configuration is "Bridged". You can see the /Virtual_Appliances_Quick_Start_Guide#How_to_access_the_BitNami_Virtual_Appliance.3f.

How to install VMWare tools on BitNami Virtual Appliances?

Before starting your Virtual Appliance, you should add a cdrom device to the machine if this device does not exist. If you have VMWare Workstation, VMWare Player or you simply are using a web interface you can add easily a new cdrom device from your Control Panel. The commands below are specific for openSUSE Virtual Appliances.

You should install the latest kernel, in case a new one has been released since the virtual machine was created. You can do so issuing the following command:

$ sudo zypper update kernel-default

If no newer version is found, the command will not take effect. If the zypper package tool installed a new kernel, you will need to reboot the machine:

$ sudo reboot

Once the machine is started using the new Linux kernel, you can access the VMWare tools. In the version of VMWare that we tested there is an option in the Control Panel: VM -> Install VMWare tools

This action simulates mounting a cdrom that includes the tools. Now it is necessary to mount the cdrom to install them:

$ sudo mkdir /mnt/cdrom
$ sudo mount /dev/cdrom /mnt/cdrom
$ cd /mnt/cdrom
$ sudo rpm -i VMWareTools-*.rpm 

Before running the VMWare configuration tool it is necessary to install some dependencies:

$ sudo zypper install gcc make tar kernel-source 

Finally you can configure the VMWare tools installed in the BitNami Virtual Appliance.

$ sudo vmware-config-tools.pl 

These steps are specific for openSUSE based appliances. If you are using the Ubuntu Virtual Appliance, there is no "rpm" tool installed by default. Instead of using "rpm", you can uncompress the tarball: 

$ sudo tar -xzvf VMWareTools*.tar.gz -C /tmp

Check your current kernel version:

$ uname -a
Linux linux 2.6.35-28-virtual #32-Ubuntu SMP Fri Mar 28 08:10:02 UTC 2011 i686 GNU/Linux

Then install the same packages using the "apt-get" command:

$ sudo apt-get update
$ sudo apt-get install gcc make tar linux-source linux-headers-kernel_version
$ cd /tmp/VMWare*
$ sudo ln -s /lib/modules/kernel_version/build/include/generated/utsrelease.h /lib/modules/kernel_version/build/include/linux/utsrelease.h
$ sudo ln -s /lib/modules/kernel_version/build/include/generated/autoconf.h /lib/modules/kernel_version/build/include/linux/autoconf.h
$ sudo ./vmware-config-tools.pl

How to install a FTP server?

Some applications use a FTP connection to download and install modules. IMPORTANT: This server should not be used to copy files into the machine, for remotely connection it is advisable to connect through SFTP or SCP for security reasons. Most of the Virtual Appliances already included the "vsftpd" server configured to be accessed locally.

If you want to use it from your application these are the setting that you should use:

Hostname: 127.0.0.1
Username: bitnami
Password: the bitnami user password
Connection method: FTP

If your Virtual Appliance does not include FTP, you can install vsftpd server following these steps:

On Ubuntu:

$ sudo apt-get update
$ sudo apt-get install vsftpd

On openSuSE:

$ sudo zypper update
$ sudo zypper install vsftpd

Now the FTP server is running on your machine. For security reasons you should modify the configuration file to only listen requests from the local machine. Add the following line at the end of the configuration file "/etc/vsftpd.conf". You can add it running the following command:

$ echo -e "write_enable=YES\nlisten_address=127.0.0.1" | sudo tee -a /etc/vsftpd.conf

Then restart the service and that is all.

On Ubuntu:

$ sudo restart vsftpd

On openSuSE:

$ sudo /etc/init.d/vsfptd restart

The FTP credentials for the application will be the following:

Hostname: localhost
Port: 21
Username: bitnami
Password: bitnami user password in your machine
FTP Root: /opt/bitnami/apps/your_application/htdocs

How to install Webmin?

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more.

The steps below walk you through the process of installing and configuring Webmin in a Virtual Appliance or an AMI.

$ wget http://downloads.sourceforge.net/project/webadmin/webmin/1.550/webmin-1.550.tar.gz
  • Install the dependencies and uncompress the tarball by doing the following:
$ sudo apt-get install perl5 libnet-ssleay-perl
$ tar -xzvf webmin-*
$ cd webmin-*
  • Run the installer and follow the installation steps. To start the installer:
$ sudo sh setup.sh
  • Once Webmin is installed, you can access it with the user/password that you set during the installation at http://YOUR_URL:10000 by default. Note that if you are running a Virtual Appliance, you should open the 10000 port in the firewall by doing the following:
$ sudo ufw 10000
  • If you are installing Webmin on a cloud instance using a BitNami AMI, you should also enable this port in the Amazon firewall. You can find more info in the BitNami Cloud Hosting FAQ.


Once you can access the Webmin application, you must configure it to manage the BitNami servers. These are the configuration files for MySQL and Apache servers:

/etc/webmin/mysql/config

date_subs=0
max_text=1000
perpage=25
stop_cmd=/etc/init.d/bitnami stop mysql >/dev/null 2>&1
mysqldump=/opt/bitnami/mysql/bin/mysqldump
nodbi=0
mysql_libs=/opt/bitnami/mysql/lib
max_dbs=50
start_cmd=/etc/init.d/bitnami start mysql >/dev/null 2>&1 &
mysql_data=/var/lib/mysql
mysqlimport=/opt/bitnami/mysql/bin/mysqlimport
access=*: *
style=0
my_cnf=/opt/bitnami/mysql/my.cnf
mysqlshow=/opt/bitnami/mysql/bin/mysqlshow
mysql=/opt/bitnami/mysql/bin/mysql
nopwd=0
add_mode=1
passwd_mode=0
blob_mode=0
mysqladmin=/opt/bitnami/mysql/bin/mysqladmin

/etc/webmin/apache/config

link_dir=/opt/bitnami/apache2/conf/sites-enabled
test_manual=0
show_list=0
mime_types=/opt/bitnami/apache2/conf/mime.types
access_conf=/opt/bitnami/apache2/conf/access.conf
auto_mods=1
stop_cmd=/etc/init.d/bitnami stop apache
virt_file=/opt/bitnami/apache2/conf/sites-available
test_apachectl=1
max_servers=100
srm_conf=/opt/bitnami/apache2/conf/srm.conf
httpd_dir=/opt/bitnami/apache2
start_cmd=/etc/init.d/bitnami start apache
show_order=0
test_always=0
httpd_conf=/opt/bitnami/apache2/conf/httpd.conf
defines_file=/opt/bitnami/apache2/bin/envvars
apachectl_path=/opt/bitnami/apache2/bin/apachectl
show_names=0
test_config=1
apply_cmd=/opt/bitnami/bin/apachectl graceful
httpd_path=/opt/bitnami/apache2/bin/httpd

You can then access the Webmin application and click the "Refresh Modules" button. You can now see the "Apache Webserver" and "MySQL Database Server" in the Servers tag.

原文地址:https://www.cnblogs.com/lexus/p/2367352.html