VirtrualBox builds a local lamp environment, virtrualboxlamp
1. Install Centos6.8 minimal in VirtrualBox
Create a new virtual machine in VirtrualBox, configure the memory size and hard disk size, and install it;
The network mode is NAT (default) and bridge mode. It is best to set the network mode before installation. NAT is mainly used to connect to the Internet, and bridging can be accessed through the lan ip address;
Settings-Network-nic 1 (NAT) is already set by default. Click Enable Nic 2 and select bridge Nic for connection mode;
2. Configure lan ip 2.1 and modify the IP address
Run the command cd/etc/sysconfig/newwork-scripts/to view two eth0 (NAT) eth1 (bridging)
Set ONBOOT of eth0 to yes, which means starting the instance
The bridging settings are as follows:
DEVICE = "eth1"
BOOTPROTO = "static". Here, the static IP address is used.
ONBOOT = "yes" is set to auto start
IPADDR = 192.168.231.200 sets the IP address of the virtual machine. It must be in the same network segment as the host machine, but cannot be renamed.
NETMASK = 255.255.255.0 set the subnet mask
GATEWAY = 192.168.231.1 configure GATEWAY
2.2 modify the Gateway
Run vi/etc/sysconfig/network to modify the file content as follows:
NETWORKING = yes
HOSTNAME = localhost. localdomain
GATEWAY = 192.168.231.1 set the GATEWAY here, that is, the ip address of the virtual network card
2.3 modify DNS
Run vi/ect/resolv. conf to modify the file as follows:
Add a Domain Name Server for nameserver 192.168.231.1
2.4 restart the network service network restart
Test whether the Internet can be accessed:
Can I ping 192.168.231.200?
OK. The network is set!
3. Configure the 163 source for Centos6.8
First install wget: yum-y install wget
Then press 163 official help to: http://mirrors.163.com/.help/centos.html
4. Install the lamp Environment
Reference: http://www.cnblogs.com/liulun/p/3535346.html
I set to start apache and mysql at startup.
Chkconfig -- level 2345 httpd on
Chkconfig -- level 2345 mysqld on
Build complete!