暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

在centos上安装phpvirtualbox

原创 2023-03-10
490

在CentOS 7配置vboxweb-service:

phpVirtualBox admin communicate to our VirtualBox server using vboxweb-service. Therefore, we have to configure vboxweb-service before installing phpVirtualBox.

Create a user that will run the vboxweb-service process.

# useradd vbox
# passwd vbox
Changing password for user vbox.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

Create a configuration file for vboxweb-service.

# echo "VBOXWEB_USER=vbox" > /etc/default/virtualbox
# echo "VBOXWEB_HOST=localhost" >> /etc/default/virtualbox

Restart vboxweb-service.

# systemctl restart vboxweb-service.service

Allow vboxweb-service port in Linux firewall.

# firewall-cmd --permanent --add-port=18083/tcp
success
# firewall-cmd --reload
success

 

安装phpVirtualBox on CentOS 7:

phpVirtualBox is a PHP based web application. Therefore, it can be deployed on a web server with PHP language support.

We are installing Apache HTTP server and PHP 5.4 along with other required packages using yum command.

# yum install -y httpd php php-soap php-xml

Enable and start Apache service.

# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
# systemctl start httpd.service

Allow HTTP service in Linux firewall.

# firewall-cmd --permanent --add-service=http
success
# firewall-cmd --reload
success

phpVirtualBox is free and open source web interface for VirtualBox. phpVirtualBox is available at Github.

# cd /tmp
# wget https://github.com/phpvirtualbox/phpvirtualbox/archive/master.zip

Extract master.zip file to Apache document root.

# unzip master.zip -d /var/www/html/

Rename /var/www/html/phpvirtualbox-master directory for easy accessibility.

# mv /var/www/html/phpvirtualbox-master /var/www/html/phpvirtualbox

Rename phpVirtualBox configuration file as follows.

# mv /var/www/html/phpvirtualbox/config.php-example /var/www/html/phpvirtualbox/config.php

Obtain the username and password defined in config.php file.

# grep -e \$username -e \$password /var/www/html/phpvirtualbox/config.php
var $username = 'vbox';
var $password = 'pass';

The above values must match with the OS user vbox, that we have created above.

We have already created the OS user with the same username and password, otherwise you have to edit config.php to match it.

(Note: We are using an easy password for the sake of simplicity, but you are recommended to set a strong password here.)

Set SELinux boolean, so the Apache can access other network services.

# setsebool -P httpd_can_network_connect on

Browse URL http://virtualbox-01.example.com/phpvirtualbox/ in a client's browser.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论