【发布时间】:2017-07-09 16:32:46
【问题描述】:
在virtualbox上安装了centos7系统。主机是 linux mint。我也安装了 centos7 httpd、mariadb、php 和 phpadmin 7。在centos7虚拟机上可以。 我想从主机(linux mint)连接到 phpadmin 和 mariadb,我有 IDE 来开发我的应用程序。
这是centos7的ip地址(ip地址命令):
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever
inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:0e:9b:d8 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 85621sec preferred_lft 85621sec
inet6 fe80::db89:b43e:da69:530d/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
link/ether 52:54:00:8d:17:89 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
link/ether 52:54:00:8d:17:89 brd ff:ff:ff:ff:ff:ff
这是centos7上的phpmyadmin.conf:
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
# Require ip 127.0.0.1
Require ip 192.168.122.1
# Require ip 10.0.2.15
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
# Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
# Allow from 192.168.122.1
Order Allow,Deny
Allow from All
# Allow from 10.0.2.15
Allow from 192.168.122.1
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
# Require ip 127.0.0.1
Require ip 192.168.122.1
# Require ip 10.0.2.15
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
Allow from 192.168.122.1
# Allow from 10.0.2.15
Allow from ::1
</IfModule>
</Directory>
# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
configuration on virtualbox:
network
attached to: NAT
adapter type: Intel PRO 1000/MT Desktop 82540EM
promiscuosous: deny
Mac Address: 0800270E9BD8
cable connected: checked
port forwarding configuration:
name:centos7
protocol:tcp
host ip: empty
host port:3022
guest ip: empty:
guest port:22
file-->preferences-->network
Tab NAT: NatNetwork
port forwarding configuration: empty
Tab Only Host: ip address 192.168.122.1
我尝试从主机 linux mint 连接,但连接不正常。 我认为宿主机在虚拟机上看不到centos7....
你知道吗?
谢谢...
【问题讨论】:
-
给你的问题一个真正的标题,不要使用全部大写(因为它被认为是大喊大叫和粗鲁)。
标签: phpmyadmin virtualbox centos7