Use VMware10.1 to build CentOS + Tomcat notes, vmware10.1centos

Source: Internet
Author: User

Use VMware10.1 to build CentOS + Tomcat notes, vmware10.1centos

I thought it was easy to install tomcat, but I still encountered many problems. I would like to write this note to provide some reference for other students who need it.

System Environment: Windows 7 + VMWare 11.0 preparation tool: CentOS 7 installation iso file, apache tomcat and JDK

Procedure:

 

1. Use VMware to install CentOS

This step is not described in detail, because it is too simple for most people.

2. Set Shared Folders

Because it is installed offline, some tools need to be copied from the shared folder of the host to the virtual machine. I use the shared folder setting method, I don't know if other students have a better way. But there are a lot of problems when setting this shared folder.

When I install the system, the system automatically installs the VMtool by default, but I don't know why. After I create a shared folder, I have not saved any files under/mnt/hgfs. I found the reason on the Internet. Some netizens said that the gcc version needs to be upgraded, but it is not easy for me to install it offline. So I decided to reinstall vmtools. Choose to reinstall vmtools In the vmware option, and then perform the following steps:

1. mount/dev/cdrom/mnt/cdrom and mount vmtools to the cdrom folder.

2. Copy the tar file of VMTool in cdrom to the local disk and decompress it with tar-zxf VMTool.

3. decompress the package and run the. pl file.

4. There are some issues to be confirmed, all the way to Enter

5. At this time the problem came and suddenly promptedHgfsWbRequestWaitThere iswait_on_bitFunction error. I have not copied the specific prompt. Then, you are prompted to press Enter, and the installation is complete. After reading the hgfs folder, it is still empty.

6. Baidu searched for some solutions. It was basically determined that there was a problem with the source code file of vmtool. The file is located in the Page. c file in the vmware-tools-distrib/lib/modules/source directory.

7. Reference CSDN blogger kyolong's article, link-http://blog.csdn.net/a39206821/article/details/54313326

As mentioned in this article:

  

After checking, it is found that because the centos 7 Linux kernel uses version 3.10, there are three parameters in the function wait_on_bit_io (), while the vmtool Code uses the wait_on_bit_io () of three parameters only after kernel 3.19 () the Code is as follows:

   1639 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)   1640    return wait_on_bit_io(&req->wb_flags,   1641                          PG_BUSY,   1642                          TASK_UNINTERRUPTIBLE);   1643 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)   1644    return wait_on_bit(&req->wb_flags,   1645                       PG_BUSY,   1646 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)   1647                       HgfsWbRequestWaitUninterruptible,   1648 #endif   1649                       TASK_UNINTERRUPTIBLE);   1650 #else

 

I personally speculate that in other linux versions, the class may also be faulty. Just check the error source code. if it is because # if LINUX_VERSION_CODE <KERNEL_VERSION (3, 17, 0 ), if the macro is changed to the current version number, the problem is generally solved.

There are many tar files in the directory of vmware-tools-distrib/lib/modules/source. According to the error message
"/Tmp/modconfig-71euqe/vmhgfs-only/page. c: 1649: 23: error: too wrote arguments to function 'wait _ on_bit '" one by one to extract the found

Extract command
Tar xf vmhgfs.tar

Modify row 1639 of the page file in the directory

   1639 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)

Change to the following example:

   1639 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)

Decompress the package and modify the package instructions.
Tar cf vmhgfs.tar vmhgfs-only

Then perform vmware-install.pl troubleshooting

 

I found this file according to the blogger's method and found that the 1639th lines are not the code in the text, but a long string of comments. So I guess it is a version issue. I checked my centos and vmware version numbers,

Uname-r get centos kernel version 3.10.0-514. e17.x86 _ 64

Cat/etc/redhat-release. The system version is CentOS Linux release 7.3.1611 (Core)

Vmware Version 11.0.0 build-2305329

I found this function as prompted.HgfsWbRequestWait

The problem is found here.

HgfsWbRequestWait(HgfsWbPage *req) // IN: request of page data to write{#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)    return wait_on_bit(&req->wb_flags,PG_BUSY,#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)                                     HgfsWbRequestWaitUninterruptible,#endif                                     TASK_UNINTERRUPTIBLE);#else    wait_event(req->wb_quque,                    !test_bit(PG_BUSY, &req->wb_flags));    return 0;#endif}

In line 1619th

# If LINUX_VERSION_CODE> = KERNEL_VERSION (2, 6, 13) return wait_on_bit (& req-> wb_flags, PG_BUSY, # if LINUX_VERSION_CODE <KERNEL_VERSION (3, 17, 0) Success, # endif

Changed
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)    return wait_on_bit(&req->wb_flags,PG_BUSY,                      HgfsWbRequestWaitUninterruptibl
TASK_UNINTERRUPTIBLE );

Yes. I have removed the version above 3.20. Because I really don't understand why I have to set the version limit.

OK. Package the compressed package and reinstall vmtool. If this prompt is not displayed, check the/mnt/hgfs folder and find that there is already content in it. Now, the vmware shared folder is complete.




3. install tomcat
This step is relatively simple, but it still encountered an unexpected problem.
1. Install jdk1.8
Centos7 comes with openjdk by default, but you are still habitually using the oracle jdk, So I downloaded the latest jdk version on the official website for installation. Copy a file to a local disk through a shared folder, decompress the file, and modify the file name. Everything is so smooth and natural.
2. Configure Environment Variables
Since jdk files were previously stored in the usr/local/java path, my configuration method is as follows:
Use vim/etc/profile
Add the following code at the end
  
JAVA_HOME=/usr/local/javaJRE_HOME=/usr/local/java/jrePATH=$JAVA_HOME/bin:$PATHCLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport JAVA_HOMEexport PATHexport CLASSPATH

 

Save the file and enter java-version to display the version number. if the version number does not change, restart the system.
This process is very simple, but I do not remember who wrote the configuration code to modify the profile file. As a result, the configuration is incorrect and all the commands that come with the system cannot be run. The prompt "command not found" is displayed.
I checked this article and found a self-help solution.
Command not found self-help Method for mischanging profile file
Input
Export PATH =/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Then, the command can run normally. At this time, you can change the profile back.



 

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.