Refer to the node.js tutorial from Geek Academy
Installed software:
VirtualBox
Virtual machine CentOS
xShell and xFtp
Node.js
MongoDB
Redis
Subline Text
WebStorm
1. Install VirtualBox
Simply go to the next step, the warming will pop up, reminding you to install the network card, and you can continue to the next step.
New-"
Name: node.js
Type: Linux
Version: other Linux (64-bit)
Next step
Memory: 1024M
Next step:
Create a virtual hard disk (direct next step)
Next step:
Virtual hard disk file format: VDI (direct next step)
Next step:
Stored on physical hard disk: Dynamic allocation (direct next step)
Next step:
File location and size: you can choose the default disk or place it elsewhere
create
2. Download the CentOS image
select DVDISO
After the download is complete
return visualBox
Set up the virtual machine you just created
"Storage"--"No disc--"Assign CD-ROM-"Find the downloaded centos image
"Network"-->NAT
3. Setting up the virtual machine
Start the virtual machine---"install CentOS 7
1. Select language: default language
2.software selection -->basic webserver-->developer tools-->done
3.installation destination-->click the hard disk to uncheck it and then click check-->done
4. Click Install
When installing: set password: root password: try to choose pure English? I tried a few times before, but when I got there, they said my password was incorrect.
I don't know if it's my reason or not. . . .
Fourth, the installation of Xshell and xFtp
Enter simple information to get download link
Choose Free Home, School
Five, after centos installation is complete
reboot
Start by default
login:root
ps: password
1. Modify the virtual machine network
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
Modify the last line: onboot=no
change to yes
Enter lowercase i to enter edit mode
change no to yes
Press esc to exit editing
Enter a colon: enter the command line
Enter wq to save the changes
2. Restart the virtual machine network
systemctl restart network
3. Check the network card
ifconfig
remember this url
4. Test external network links
ping www.baidu.com
Ctrl+C to end
5. Fixed virtual machine IP address
Find the hosts of c/windows/system32/drivers/etc on the physical machine
Add the URL obtained by ifconfig above and enter the domain name geek
6. Open xShell
New --"
Name: geek_node.js
Host: geek
--"connect
Enter username and password
--"Use the menu to open the virtual machine
virtual machine complete
Sixth, in Linux installation. . . . .
In the just opened geek_node.js
1. Install epel
yum install epel-release
2. Install node.js
yum install nodejs
Check if the installation is successful: node --version
3. Install mongodb server side
yum install mongodb-server
4. Install mongodb client
yum install mongodb
Detection: mongo --version
5. Install redis
yum install redis
redis-cli --version
7. hello world
on xshell
Create a file: vim test.js
i enter edit
console.log("hello world");
esc
:wq
node test.js
==" works fine