How can I use Linux in a development environment?

Source: Internet
Author: User

How can I use Linux in a development environment?

1. Why should I write this article?

I have always wanted to learn more about Linux, So I installed my home laptop with a Linux system. However, it is really laborious to create a suitable development environment for my own system, in addition, some inexplicable problems often occur. With my own experience, I think that if you want to use Linux as a development environment, you need to understand every software. Otherwise, it will be difficult to solve some problems, other words, that is, it takes a long time to solve the driver problem.

After I installed Linux on my computer, I had been experiencing high temperatures. I found some ways on the Internet. I couldn't do much if I turned off the dedicated display. The temperature reached 70-90 degrees after I started the system for 2 hours, I have tried many release versions, such as Debian, Ubuntu, CentOS, and Fedora, but they have not solved the problem. As for Gentoo and others, I am scared when I look at the comments. Every time I have to go over the driver for a long time, some system sources are blocked by the Party and state. If you want to run the drive, development environment, and office software, it is really a laborious task, and you can only use web qq, wineqq is still so old version is not easy to use, bclode often cannot log on, an unknown error is reported, due to work needs, I am destined not suitable for a completely Linux office environment. However, as a programmer, Linux still has the ability to use and troubleshoot, so today I will share my usage methods.

2. Windows + Virtual Machine

It is common to install Linux in a virtual machine. Many of my colleagues installed Linux in the Virtual Machine for their learning purposes. When I was okay, I tried twice, but I didn't use it in actual work, so I wondered why we should not put our code and services in a Linux virtual machine, and then access the services in Windows. The code can be developed and deployed in Linux under Windows, I think this has the following benefits:

1. synchronize with the production environment to ensure that your code can be run in Linux.

2. For ease of transplantation, you can directly package the VM file and test it on another computer.

3. You can regularly store VM files on a cloud disk, which means you have backed up the system and restored it at any time (however, uploading files too large is a little troublesome and it is very convenient to back up them to the hard disk)

4. Because Linux is being used for development, you will certainly be able to learn things frequently.

3. Implementation

I have read a variety of virtual machines on the Internet, but of course VMware is better, and it provides VMvare-tools, shared folders, and shared networks. Shared Folders are mounted to Linux, you can put the developed code in the shared folder, so that Linux can be deployed, and you do not need to copy the code to test it, or use svn to update or something.

My solution is win7 + centos7 because the production environment uses centos, but there are some precautions for actual implementation:

Vmvare provides three network sharing methods: Bridging, NAT, and host-only. I will not talk about the specific differences. Check the differences. Generally, bridging is used. In this way, a virtual machine is equivalent to an independent machine, and other machines can access services in the virtual machine, however, the company I work for requires mac registration on each computer before I can access the internet. Therefore, I have to select the nat mode. The nat mode does not need to be set and is relatively simple, however, the host cannot access the services in the virtual machine. The solution on the internet is port ing. :

Access Port 80 in the virtual machine through port 800 of the local machine. The implementation is also very simple. You only need to configure a port ing in the virtual machine.

Edit in VMware-> Virtual Network Editor-> select nat mode net settings-> Add

Then save it. If not, check the Linux Firewall and open port 80. If you want to allow access from other computers, you also need to configure it in the Windows Firewall. Of course, the elder brother is relatively lazy, because he often needs to show it to others during development. The firewall is closed directly. Of course, you can also put all the databases in Linux, and only install some software in Windows to use services in Linux.

However, if you want to use a virtual machine, you still need to have requirements on the computer configuration. I have 8 GB of memory, and the virtual machine has 2 GB of memory to enable the virtual machine, working software such as IDE basically needs to occupy 80%-90% of the memory, and the usage is still relatively smooth. You can also run the virtual machine in the background, just use its services.

This article permanently updates the link address:

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.