Kamis, 01 Januari 2015

phpvirtualbox (Ubuntu 14.04 LTS)

1 Preliminary Note

I'm assuming that a headless VirtualBox is already installed on the local Ubuntu 14.04 server, e.g. as described in the tutorial VBoxHeadless - Running Virtual Machines With VirtualBox 4.3 On A Headless Ubuntu 14.04 Server.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su

2 Installing phpvirtualbox

First create a system user called vbox and add it to the vboxusers group:
useradd -m vbox -G vboxusers
Create a password for the vbox user:
passwd vbox
Create the file /etc/default/virtualbox and put the line VBOXWEB_USER=vbox in it (so that the VirtualBox SOAP API which is called vboxwebsrv runs as the user vbox):
vi /etc/default/virtualbox
VBOXWEB_USER=vbox
Next create the system startup links for vboxwebsrv and start it:
update-rc.d vboxweb-service defaults
service vboxweb-service start
We need a web server with PHP support to serve phpvirtualbox - I'm using Apache2 here. Install Apache2 and PHP5 as follows:
apt-get install apache2-mpm-prefork apache2-utils apache2.2-bin  apache2 apache2-doc apache2-suexec libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapr1 php5-common php5-mysql  php-pear wget
Restart Apache2:
service apache2 restart
I want to serve phpvirtualbox from Apache's default virtual host with the document root /var/www/html (I will install it in /var/www/html/phpvirtualbox) - if you have a different document root, you must adjust the following steps:
cd /var/www/html
wget http://downloads.sourceforge.net/project/phpvirtualbox/phpvirtualbox-4.3-1.zip?
Unzip phpvirtualbox and rename the phpvirtualbox-4.3-1 to phpvirtualbox for ease of use:
unzip phpvirtualbox-4.3-1.zip
mv phpvirtualbox-4.3-1 phpvirtualbox
Next go to the /var/www/phpvirtualbox/ directory...
cd /var/www/html/phpvirtualbox/
... and create the file config.php by copying it from config.php-example:
cp config.php-example config.php
Open config.php and fill in the password you created earlier for the vbox system user:
vi config.php
[...]
/* Username / Password for system user that runs VirtualBox */
var $username = 'vbox';
var $password = 'secret';
[...]
That's it already - you can now open a browser and access phpvirtualbox as follows:

sbr:https://www.howtoforge.com/managing-a-headless-virtualbox-installation-with-phpvirtualbox-on-ubuntu-14.04-lts

Tidak ada komentar:

Posting Komentar