Linux Basic Environment _ Installation Configuration Tutorial
(CentOS7.2, JDK1.8, Tomcat8)
- Install package version
1) vmawre-workstation version Package
Address:
https://my.vmware.com/web/vmware/details?downloadGroup=WKST-1411-WIN&productId=686&rPId=20814
Package Name: Vmware-workstation-full-12.5.7.20721.exe
2) CentOS Version Package
Address: http://vault.centos.org/7.2.1511/isos/x86_64/
Package Name: Centos-7-x86_64-dvd-1511.iso
3) JDK version package
Address: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Package Name: jdk-8u144-linux-x64.tar.gz
4) Tomcat version package
Address: https://archive.apache.org/dist/tomcat/tomcat-8/
Package Name: apache-tomcat-8.0.9.tar.gz
- Install packages
2.1. Pre-installation Instructions
Prepare the package files you need to install, such as Linux, Tomcat, JDK, database installation package, etc., download the package you need to build the environment and upload it to the corresponding Linux machine. Package files are uniformly placed under directory/usr/local/src.
When downloading the corresponding package, first confirm the number of bits of the system, so that you can confirm the need to download a few bits of the package, such as: The system is 32-bit, install 32-bit package, the system is 64-bit, install 64-bit package. Installation of the basic environment refer to the following instructions, the corresponding IP, port number, path and so on according to the actual situation of your machine to modify. When the display is x86_64, it indicates a 64-bit system, otherwise 32-bit system.
Uname-a
2.2. Installing Vmwawre-workstation12
2.2.1. Installing Vmwawre-workstation12
Choose a good installation path, and the default installation will be done.
2.2.2. Installing a virtual machine
2.2.2.1. Creating a new virtual machine
Choose to install the corresponding VM workstation version
2.3. Installing CentOS7.2
2.3.1. Loading the CentOS ISO file
Edit the virtual machine, hardware (CD/DVD (IDE)), use the ISO image file, select the corresponding CentOS ISO package, select OK, save and start the virtual machine, and then go to install the CentOS interface.
2.3.2. Installing CentOS7.2
Select Install CentOS7.2 and select the Enter key
2.3.2.1. Selecting a language set
2.3.2.2. Editing each module information
2.3.2.2.1. Editing the time module
2.3.2.2.2. Configuring the keyboard module
2.3.2.2.3. Other item configurations (auto-partitioning, disabling Kdump)
2.3.2.2.4. Modifying the root user password
2.3.2.2.5. Enable NIC (Ifup command)
Because the installation is CentOS6, so there will not find repo problems, and finally found to open the network card.
2.3.2.3. Restarting CentOS7
Shutdown-r now
After installing the system, reboot the system, and after logging in, execute the Yum List command.
2.3.3. Making basic settings
2.3.3.1. Starting the network card
Cd/etc/sysconfig/network-scripts
Ifup ifcfg-ens160
Yum-y Install net-tools.x86_64
2.3.3.2. Installing wget
Rpm-qa|grep wget If no content is displayed, the wget command is not installed
Yum-y Install wget
2.3.3.3. Replacing a Yum source
cd/etc/yum.repos.d/
CP Centos-base.repo Centos-base.repo.backup
#下载CentOS7的yum Source
wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
#将163yum源替换原来的yum源
Mv-f Centos7-base-163.repo Centos-base.repo
#生成yum缓存并完成yum源的替换
Yum Clean All
Yum Makecache
2.3.3.4. Installing VIM
Yum-y Install Vim
2.3.3.5. Shutting down the firewall
#关闭防火墙 if enabled, it needs to be closed.
/usr/sbin/sestatus-v
#关闭selinux
Vim/etc/selinux/config
Selinux=disabled
#禁用系统防火墙
Systemctl Disable FIREWALLD
Systemctl Stop Firewalld
Systemctl Status Firewalld
2.3.3.6. Installing additional commands
Install htop dstat nload bmon telnet Dos2unix
#安装epel
RPM-IVH epel-release-7-9.noarch.rpm
#安装htop Dstat nload Bmon
Yum-y Install htop dstat nload Bmon Dos2unix
2.4. Installing JDK1.8
2.4.1. Installing JDK1.8
cd/usr/local/src/
TAR-ZXVF jdk-8u144-linux-x64.tar.gz-c/usr/local/
cd/usr/local/
#更改jdk文件名称
MV jdk1.8.0_144 jdk1.8
#更改所属的用户和组
Chown-r Root:root jdk1.8
2.4.2. Configuring Java Environment variables
Vim/etc/profile or modify the. bash_profile file
#新增以下配置想到 the/etc/profile file
#JDK1.8
Java_home=/data/local/java
Path= $PATH: $HOME/bin: $JAVA _home/bin
Classpath=.: $JAVA _home/lib: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
#LD_LIBRARY_PATH =/opt/apr1.5/lib
Export Java_home PATH CLASSPATH Ld_library_path
#优化tomcat8需要配置该项
#export Ld_library_path=/opt/apr1.5/lib
#让配置文件生效 Source/etc/profile
2.4.3. Modifying the Java.security file
#启动tomcat出现下列问题的解决办法
Info:creation of SecureRandom instance for session ID generation using [Sha1prng] took [24,790] milliseconds.
Open the $jre_home/lib/security/java.security file and find the following:
Securerandom.source=file:/dev/random
Replaced by
Securerandom.source=file:/dev/./random
#通过javac-version and java-version command to check if the JDK installation was successful
2.5. Installing TOMCAT8
2.5.1. Installing TOMCAT8
#进入程序包路径
cd/usr/local/src/
#解压缩Tomcat8
TAR-ZXVF apache-tomcat-8.0.9.tar.gz-c/usr/local/
#更改Tomcat8文件夹名称
cd/usr/local/
MV apache-tomcat-8.0.9 TOMCAT8
#启动tomcat并查看日志
/usr/local/tomcat8/bin/catalina.sh start
&& TAIL-FN 200/usr/local/tomcat8/logs/catalina.out
2.5.2. Increase the number of users who publish TOMCAT8 engineering applications
#修改Tomcat8下conf目录中tomcat the-user.xml file, comment the original configured user, add the following configuration items
<?xml version= ' 1.0 ' encoding= ' utf-8 '?>
<tomcat-users>
<role rolename= "admin"/>
<role rolename= "Manager"/>
<role rolename= "Admin-gui"/>
<role rolename= "Manager-gui"/>
<role rolename= "Manager-script"/>
<role rolename= "Manager-status"/>
<role rolename= "Manager-jmx"/>
<user
Username= "Admin"
Password= "123456" roles= "Admin,manager,admin-gui,manager-gui,manager-script,manager-status,manager-jmx"/>
</tomcat-users>
Linux Basic Environment Installation configuration tutorial (CentOS7.2 64, JDK1.8, TOMCAT8)