Node.js now how much fire, how important, not to say more, here is a description of his development environment installation, usually, we are in the window environment for development, or in the MAC environment for development, but our project actually run the environment is generally on Linux, so we let our development environment and production ring Can be as unified as possible, and can facilitate our development, we usually install the necessary environment on the server, and then on the window through the xshell,securecrtportable and other tools to connect to the window on the use of convenient IDE software development, Then sync the files through FTP, so here's how to install node in the server environment, and then how we develop on the window.
1. Because there is no server here, we build a Linux environment locally through the virtual machine, so we need to download Virtuabox, Baidu or Google search virtuabox download. Attached Download Address:
Https://www.virtualbox.org/wiki/Downloads
After you go in, you can choose from your operating system, and take window for example.
2. Create a virtual machine, VirtualBox installation is not difficult, the next step can be installed, after the installation, create a virtual machine, click New, and then set as shown, because we install here CENTOS64 bit, if you install other Linux, you can choose the corresponding All the way back is the next step, choose Default on it
Memory can be set according to your computer's memory
3. After the creation of the virtual machine, you need to install a mirror, that is, the operating system, here to install CentOS, go online next on it.
Http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso
If you are using a router to surf the Internet, select Bridge here
Then start, language selection default, try not to choose Chinese, so as not to appear some unnecessary problems, software selection
Install the hard drive, point in, first Cancel, then select the
Then the wait can be installed, during the installation process, you can choose to set the root of the user's password, or add other users, and set the password
After installation, to set the virtual machine network card settings,
Through VI to open the configuration file, vi use, open the file, the keyboard press I, you can enter the modified mode, the Onboot property modified to Yes, press esc,shitf+:, and then Wq exit save on it.
Restart the network card by command, if there is a distribution address, it is OK,
The above steps do not understand, you can own Baidu virtual machine installation, and CentOS installation and so on, you can have detailed introduction and specific parameter configuration
4. Install the necessary software, after the installation process, will let the choice, y/n, are the choice Y, the following software installation are the same
Install Nodejs,
Installing the Mongodb-server service side
Install MongoDB
Install Redis
5. The basic environment is installed and you can enter node directly from the command line. Then we see how to link development under window, where the use of securecrtportable, you can download Xshell, is the same.
After clicking on the connection, you can use this command line to operate.
Then open sublime Text, download the sftp plugin, this plugin can map the local project directory and the project directory on the server to sync,
The following settings, but to note that the Remote-path corresponding server directory, to the existing directory can be, and then there are some other parameters of the configuration, you can configure when the synchronization upload and so on and so on, detailed understanding can go to GitHub search SFTP
{//the TAB key would cycle through the settings when created//Visit http://wbond.net/sublime_packages/sftp/s Ettings for help//SFTP, FTP or FTPs "type": "SFTP",//Connection mode "Save_before_upload": true,//upload "Upload_on_save" before saving: true,//upload "Sync_down_on_open" when saved: false, "sync_skip_deletes": false, "sync_same_age": True, "Confirm_downloads" : false, "Confirm_sync": True, "Confirm_overwrite_newer": false, "host": "Nodejs",//host name or address "user": "root",//connected user Name "password": "Sunlandong",//Password//"Port": "", "Remote_path": "/home/nodejs/",//local directory and Server directory mapping directory, here need to pay attention, the server's directory to save in advance In "ignore_regexes": ["\\.sublime-" (project|workspace) "," Sftp-config (-alt\\d?)? \\.json "," Sftp-settings\\.json ","/venv/"," \\.svn/"," \\.hg/"," \\.git/"," \\.bzr "," _darcs "," CVS "," \ ". Ds_store "," thumbs\\.db "," desktop\\.ini "],//ignore rule//" file_permissions ":" 664 ",//" dir_permissions ":" 775 ",//" ext Ra_list_connections ": 0," connect_timeout ":",//"keepalive": 120,
"Ftp_passive_mode": true,//"Ftp_obey_passive_host": false,//"Ssh_key_file": "~/.ssh/id_rsa",//"Sftp_flags": ["F", "/path/to/ssh_config"],//"Preserve_modification_times": false,//"remote_time_offset_in_hours": 0,//"remote _encoding ": Utf-8",//"Remote_locale": "C",//"Allow_config_upload": false,}
The above is a small set to introduce the Linux environment installation Node.js development environment to build a picture and text tutorial, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!