Part I: Installing Ubuntu in Virtual-box
First step: Install Virtual-box, slightly
Step two: Download ubuntu-server-14.04.4
The address is as follows: http://125.39.35.135/files/5065000007B697A9/mirrors.yun-idc.com/ubuntu-releases/14.04.4/ Ubuntu-14.04.4-server-amd64.iso,
Step three: Create a new virtual environment in a virtual machine
Fourth Step: Select the downloaded Ubuntu.iso and start the installation
Fifth step: Start the installation
A: I chose the English environment here.
B: Configure the Administrator account password
Sixth step: Set the Internet mode after completion
The default NAT mode is modified to bridge mode, this place must be modified, otherwise you cannot log on to the SSH server
Restart after Setup is complete
Seventh Step: Update the source
sudo apt-get upgrade
Eighth Step: Install Ssh-server
A: First uninstall the SSH client that comes with the system, because the server installation depends on the client. If the server that will be installed does not match the existing client, the installation fails!
sudo apt-get remove openssh-client
B: Reinstall the SSH client
sudo apt-get install openssh-client
C: Install SSH server
sudo apt-get install Openssh-server
Nineth Step: View the list of processes
sudo ps-e | grep process Name
Tenth step: Login to host terminal access
sudo ssh user name @ virtual machine IP Address
Part II: Setting up the lamp environment in Ubuntu
First step: Install Apache2
sudo apt-get install apache2
After the installation is complete, the program is installed in:/etc/apache2
www directory chant installed in/var/www/html
Access Browser: The contents of/var/www/html/index.html will appear
Description: Apache only played the role of request forwarding, but also need a parser to parse the background script we wrote, if this time does not install PHP, we write in the HTML directory. The PHP file is delivered to the client in the form of the original file, without parsing
Step Two: Install PHP
sudo apt-get install php5
Description: PHP is a PHP script that we write to parse. When you go to the. php file in HTML, the file is parsed into HTML and sent to the client.
Step three: Install MySQL
sudo apt-get install Mysql-server
Set the password for the root account
The native test is installed successfully: mysql-h127.0.0.1-uroot-p123456
Configure remote access permissions: Ubuntu only allows local access by default after MySQL is installed
Change this file in the/etc/mysql directory my.cnf
sudo vim my.cnf, comment out bind-address
Esc+i, turn on vim input mode
esc+shift+:, exit Edit mode
Wq, write file and save
Restart MySQL server: sudo service mysql restart
Configure remote access Permissions in MySQL: Configure in my.cnf after configuration is complete in MySQL
mysql-uroot-p123456
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
Fourth step: Create a new site
A: Go inside the apache2 directory of Available-sites
B: Follow the content in 0000-default.conf, modify the following
Added: ServerName test.com www.test.com
Modified: DocumentRoot, map directory test
C: After saving, restart Apache, you will be prompted with a problem
Open the apache.conf in the Apache2 directory
Added: ServerName 127.0.0.1
D: Create a new test directory and write the testing file
Create a new test directory under the/var/www/html directory
sudo vim index.php
E: Modify the hosts of the physical machine
sudo vim/etc/hosts
Build a project development environment under Linux