VirtrualBox builds a local lamp environment, virtrualboxlamp

Source: Internet
Author: User
Tags domain name server

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.