Linux environment configuration

virtual machine

What is a virtual machine?

VM: is a virtual computer, the software is a virtual out by a computer.

VM (Virtual Machine) is a computer system simulator , a complete hardware system functions through software emulation,

Run in a completely isolated environment full computer system that can provide the functionality of a physical computer.

 

How to install Virtual Machine

Installation Tutorial: https://zhinan.sogou.com/guide/d316512415646.htm?ch=zn.wap.it

 

Install the Linux operating system

Installation Tutorial: https://jingyan.baidu.com/article/c275f6bad6ec38e33d75671e.html

 

Linux Directory Structure

 

 

 

 

 Linux operating commonly used commands

Common commands


 

ls: Displays the file or directory

 -l: List the file details l (list)

-a :

List all files and directories in the current directory, including hidden a (all)

 

mkdir: create directory

-p:

Create a directory, if not the parent directory, create p (parent)

 

cd: Change directory

touch: create an empty file

echo: Create a file with content.

cat: view the file contents

cp: copy

mv: move or rename

rm: deleting files

-r:

Recursive delete, delete files and subdirectories

 

-f: Force Delete

find: Search for a file in the file system

wc:

Count the number of rows of text, words, characters

 

grep:

Find a string in a text file

 

rmdir: delete empty directories

 

tree:

Display the directory tree, tree packages to install

 

pwd: Displays the current directory

ln: create links to files

more, less: page display the contents of a text file

head, tail: display the file header, the end of the content

ctrl + alt + F1: full-screen mode command

 

 

Remote connection Linux

I want Windows to copy something to the operating system Linux operating system how to do, or Linux copy something into the operating system Windows operating system how to do , use the tool to remotely connect Linux

 

 

Use the command : ifconfig to view ip address

 

 

 

 

Check whether to activate the virtual network

 

 

Installation jdk

Ftp upload to unpack , install    tar -zxvf jdk-8u221-linux- x64.tar

Configuration environment variable, open vi / etc / profile add the note at the end of the file is to use the " :" separator

export JAVA_HOME=/home/tina/tools/jdk1.8

export JRE_HOME=$JAVA_HOME/jre

export PATH=$PATH: $JAVA_HOME /bin

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Let the files become effective              source / etc / profile

Directories and subdirectories to grant root privileges   chown root: root -R /home/tina/tools/jdk1.8

View jdk is successfully installed      java -version or java   or javac

 

Tomcat installation

 

1. using ftp tool to archive upload linux the

2. unzip Tomcat command

 tar  -zxvf  the Apache-Tomcat-8.5.43.tar.gz    ( archive name ) 

3. by tomcat in conf under file server.xml configuration

we /home/tomcat/apache-tomcat-8.5.16/conf/server.xml

3. Configure the firewall, open 8080 port

firewall-cmd --zone=public --add-port=8080/tcp --permanent

firewall-cmd --reload

5. Start tomcat   find extract the folder in the bin inside stratup.sh

sh  startup.sh   

 

 

 

 

Mysql ordinary installed

Download Link: https://pan.baidu.com/s/1qfLS8_KjbzQoMHgSmxYkfg  extraction code: VA73

By client tools Xftp upload tar package

Open a terminal extracting tar file: tar -xvf MySQL-5.7.23-1.el7.x86_64.rpm-bundle.tar

 

Uninstall conflicting RPM components

We install mysql when related components, assemblies if you do not delete this conflict, we are installing unsuccessful.

View postfix and mariadb-libs -related components:

rpm -qa | grep postfix

rpm -qa | grep mariadb

Uninstall postfix and mariadb-libs. Please uninstall the version you run the command appears! 

rpm -ev postfix-2.10.1-6.el7.x86_64

rpm -ev mariadb-libs-5.5.52-1.el7.x86_64

Mounting a respective dependency:

yum -y install libaio

yum -y install net-tools

yum -y install perl

Install mysql Components

上面解压操作,得到很多rpm文件。不需要这么多,只需要安装以下四个组件就可以:

rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm

rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm --nodeps

rpm文件版本可能不一样,请到你的目录文件输入ll命令查看再根据对应的文件名修改!

 

修改MySQL密码

mysql安装完成之后我们是没有设置密码的,但是mysql为我们设置了一个临时的密码,

我们可以查看mysql的日志知道这个临时密码,查看临时密码前确保数据库启动。

启动数据库:

mysql是否启动:service mysqld status

启动mysql    service mysqld start

停止mysql    service mysqld stop

重启mysql   service mysqld restart

查看临时密码:    grep password /var/log/mysqld.log

得知临时密码是: #BRm.Mi/s6.i,临时密码登录数据库。

(数据库的密码需要满足以下条件:大小写字母,数字和特殊符号

登录mysql(命令:mysql -p),输入临时密码

设置新密码:  set password = password("Mysql_123");

退出当前登录:quit;

 

允许远程连接

开启mysql远程访问权限,允许远程连接

mysql -u root -p

use mysql;

update user set host = '%' where user = 'root';

flush privileges;

测试连接mysql

连接时报10060错误,可能是因为没有开启防火墙。在终端输入以下命令关闭防火墙。

firewall-cmd --zone=public --add-port=3306/tcp --permanent;

firewall-cmd --reload;

主机输入你的ip地址   不知道的用ifconfig或者ip addr命令查看

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/ptxxc/p/12164003.html