Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LimeSurvey - my notes on Bitnami-Stack for LimeSurvey.

Bitnami Limesurvey

  1. Update Virtual Box if necessary. Install the most recent Virtual Box Extension Pack.

  2. Download the VM from http://bitnami.com/stack/limesurvey. Unzip...

  3. Create a new VirtualBox VM

    • Guest OS: Ubuntu 64-bit
    • RAM: at least 512 MB RAM
    • Storage: select the VMDK file
    • Network: Enable NAT

    After everything is configured, the network adapter will be changed to Bridged Adaptor (had some problems with the Bridged Adaptor over WiFi, hence this choice). NAT can also be used if the Guest is to be accessed only from the Host.

  4. Start the VM. Prepare to install the Virtual Box Guest Additions (Devices --> Install Guest Additions)

  5. The default Linux login is bitnami/bitnami. In real life, the default users and passwords should be changed.

  6. Enable root:

    $  sudo passwd root
    

    In real life, the root password should not be enabled. (Instead of entering as root, use sudo instead).

  7. Change keyboard layout:

    $  sudo apt-get update
    $  sudo apt-get install console-data
    $  sudo dpkg-reconfigure keyboard-configuration
    $  sudo dpkg-reconfigure console-setup
    

    If later reconfiguration is required:

    $  sudo dpkg-reconfigure console-data
    
  8. Install the Virtual Box Guest Additions:

    $  sudo mount /dev/cdrom /mnt
    $  cd /mnt
    $  sudo ./VBoxLinuxAdditions.run
    $  sudo reboot
    

    If the build fails, check the log file:

    $ nano /var/log/vboxadd-install.log
    

    (Note that there is always be a fail message for windows system if no graphic interface is installed in the server):

    $  sudo apt-get update
    $  sudo apt-get install dkms              #if required
    $  sudo apt-get install build-essential   #if required
    $  sudo apt-get linux-headers-generic     # and/or
    $  sudo apt-get linux-headers-3.2.0-53-virtual # for example, if such is the version required...
    
  9. How to access the BitNami Virtual Appliance?

    http://bitnami.com/faq/virtual_machines

    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
    

    Note: There's a deprecation warning... If not on an remote access, alternatives are:

    $  sudo service networking stop
    $  sudo service networking start
    

    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:

    Stop the network:

    $ sudo ifdown eth0
    
    Your local network uses one of the following IP addresses:

    192.168.X.X 172.X.X.X 10.X.X.X

    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
    

    You can access the web application from any computer of your network at 192.168.1.234

  10. Using static IP with a Network Bridged Adaptor.

    Note: Bridging over WiFi may not work...

    https://forums.virtualbox.org/viewtopic.php?f=7&t=53895

    The Ubuntu installation inside of the VM needs to be set to use a static IP address. This is done in the /etc/network/interfaces file.

    Some information about the interfaces file can be found on this page: https://help.ubuntu.com/12.04/serverguide/network-configuration.html

    Here is an example interfaces file:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    

    auto lo iface lo inet loopback

    auto eth0 iface eth0 inet static

    address 192.168.10.99 netmask 255.255.255.0 broadcast 192.168.10.255 network 192.168.10.0 gateway 192.168.10.1

    After making modifications to /etc/network/interfaces, restart the VM.

VM Network Issues on Moving a Virtual Machine

http://academe.co.uk/2012/06/vm-network-issues-on-moving-the-machine/

I have been generating virtual machines (VMs) for a client to run on their laptops out in the field. The client needs to take these laptops to places where there is no Internet.

The issue is that Ubuntu runs something called a persistent net generator that creates rules for setting up the network. Each time it detects a new MAC address, i.e. a new network card, it generates a new rule and gives the network interface the next number up. So on first booting, the network card is called “eth0? and all works fine and dandy.

However, move the VM to another machine, and VirtualBox (or VMWare) will give the network card a new MAC address. This network then becomes eth1. Next time, if cloned, the VM will get network card eth2 etc.

Now, the OS is set up to use eth0, and only eth0. Only when eth0 comes up, will the VM be able to use it to access the Internet or local network. This was clearing not happening on cloned copies of the VM due to this persistence of the network rules. The problem manifests itself as the following messages as it boots up:

Waiting for network configuration.
Waiting up to 60 seconds for network configuration.

So what to do about it?

The network rules are stored in this file:

/etc/udev/rules.d/70-persistent-net.rules

The file can simply be deleted or the rules in it commented out. On next boot, a new rule for eth0 will be created and the network will work fine again. Two problems with this: firstly deleting the file is not something I would expect the end users to be messing on with. Secondly, the effect of deleting the file only takes place on the next boot, which is inconvenient.

The better approach is to prevent the OS from writing these persistent rules in the first place. Working out how took some digging, but the solution is actually straight-forward. The rules are generated by a shell script here:

/lib/udev/rules.d/75-persistent-net-generator.rules

Some sites suggest deleting this script. Don’t do that. It will be back on the next network upgrade. Instead, create an override script, which is like a customised version of that script. If the custom version exists (and it does not by default) then the OS will run that custom version instead. So we create a blank custom script:

$ sudo touch /etc/udev/rules.d/75-persistent-net-generator.rules

It will also not be touched by any updates to the OS, so it is safe there. Remember to comment out the rules that may already be in /etc/udev/rules.d/70-persistent-net.rules (or delete that file) then reboot, clone, boot again, and the network will be there and ready to use.

  1. How to start/stop the services?

    You can use the /opt/bitnami/ctlscript.sh file or the /etc/init.d/bitnami script to manage your servers:

    $ sudo /opt/bitnami/ctlscript.sh help
    

    usage: /opt/bitnami/ctlscript.sh help /opt/bitnami/ctlscript.sh (start|stop|restart|status) /opt/bitnami/ctlscript.sh (start|stop|restart|status) mysql /opt/bitnami/ctlscript.sh (start|stop|restart|status) apache

    help - this screen start - start the service(s) stop - stop the service(s) restart - restart or start the service(s) status - show the status of the service(s)

  2. How to shutdown or reboot the machine:

    $ sudo reboot
    $ sudo shutdown -h now
    
  3. Application login: user/bitnami

  4. MySQL - Enable phpMyAdmin

    Warning

    Haven't done this yet

    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 (using the nano editor) 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)

    Alias /phpmyadmin "/installdir/apps/phpmyadmin/htdocs"
    <Directory "/installdir/apps/phpmyadmin/htdocs">
    # AuthType Basic
    # AuthName phpMyAdmin
    # AuthUserFile "/installdir/apache2/users"
    # Require valid-user
    <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 accessible using localhost (127.0.0.1) as the hostname"
    </Directory>
    

    Then you should restart Apache to load the changes:

    $ cd installdir
    $ ./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.

  5. LimeSurvey & PHP - number of codes limit

    There was a new setting introduced in PHP 5.3.9: max_input_vars.

    This setting limits the maximum number of variables that can be POSTed (submitted) to the server. Default is set to 1000 but if you have a question with lots of answer options or a survey page with lots and lots of questions/answers this limit might be exceeded.

    You will need to set this in your PHP configuration file (php.ini). Then restart the services.

  6. LimeSurvey - code length limit.

    Limesurvey limits answer code lengths to 5 characters and question code lengths to 20. Some Eurostat alphanumerical codes are larger, so alternative ones must be used.

    See http://bugs.limesurvey.org/view.php?id=7593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.