Linux(6, 7) Software Installation of PHP

Keywords: MySQL yum ssh Linux

linux software installation

Shell Front-end Package Manager

yum

Use linux local installation CD as yum source

Mount mount directory

The concept of mounting: A mount refers to the attachment of a device (usually a storage device) to an existing directory.

For instructions on mounting commands see Appendix E

mkdir /mnt/cdrom #Create directories
mount /dev/cdrom /mnt/cdrom #mount

If you don't want to play CD-ROM every time, copy the CD-ROM file to your local hard disk.

cp -avf /mnt/cdrom/ /yum/ # - a: This option retains links, file attributes, and recursively copies directories
Unloading catalogue
umount /mnt/cdrom 
Edit local warehouse configuration (yum source configuration)
    # cat >>/etc/yum.repos.d/CentOS-Local.repo<<-EOF
    [Local]
    name=Local Yum
    baseurl=file:///yum/cdrom
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    enabled=1
    EOF
Clearing up metadata of yum metadata
    # yum clean metadata
    # yum clean all
    # yum makecache
yum installation ssh

The following sections are used to install ssh services so that remote systems can connect to management using ssd tools.
Usually, the process of installing services in yum is almost the same.

Check to see if services are installed
[root@centos-linux-1 Documents]# rpm -qa|grep ssh  
search uses YUM to find packages
[root@centos-linux-1 Documents]# yum search ssh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.tuna.tsinghua.edu.cn
... ...
openssh-ldap.x86_64 : A LDAP support for open source SSH server daemon
openssh-server.x86_64 : An open source SSH server daemon
openssh-server-sysvinit.x86_64 : The SysV initscript to manage the OpenSSH server.
pam_ssh_agent_auth.i686 : PAM module for authentication with ssh-agent
pam_ssh_agent_auth.x86_64 : PAM module for authentication with ssh-agent
cockpit-dashboard.x86_64 : Cockpit SSH remoting and dashboard
jsch.noarch : Pure Java implementation of SSH2
python-paramiko.noarch : SSH2 protocol library for python
install installation package
[root@centos-linux-1 Documents]# yum install openssh-server
Configuration software
[root@centos-linux-1 Documents]# vi  /etc/ssh/sshd_config

The following are some of the configuration item reference values, complete ssh configuration details, see Here

port 22
protocol 2
PermitRootLogin   yes
PermitEmptyPasswords  no
PasswordAuthentication  yes
Start System Services
Start a service -- system CTL start sshd.service
 Close a service -- system CTL stop sshd.
Restart a service -- system CTL restart sshd.service
 Display the status of a service -- system CTL status sshd.

* ps: centos 7.0 or more*

yum installs ifconfig
search uses YUM to find packages
[root@centos-linux-1 Documents]# yum search ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.tuna.tsinghua.edu.cn
========================== Matched: ifconfig ==========================
net-tools.x86_64 : Basic networking tools

From the search results, ifconfig is included in net-tools, so install net-tools

[root@centos-linux-1 Documents]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.tuna.tsinghua.edu.cn
 ... ...
Connecting servers with remote tools
[root@centos-linux-1 Documents]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.211.55.7  netmask 255.255.255.0  broadcast 10.211.55.255
        inet6 fdb2:2c26:f4e4:0:21c:42ff:feef:a04e  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::21c:42ff:feef:a04e  prefixlen 64  scopeid 0x20<link>
        ether 00:1c:42:ef:a0:4e  txqueuelen 1000  (Ethernet)
        RX packets 13266  bytes 16632984 (15.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6487  bytes 456422 (445.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 4  bytes 340 (340.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 340 (340.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Next, ssh is used from the terminal of another machine to connect to the server.

    # ssh root@10.211.55.7
root@10.211.55.7's password: 
Last login: Sun Jul 16 09:26:39 2017
[root@centos-linux-1 ~]# 

The yum command:

The yum command is a RPM-based package manager in Fedora, Red Hat and SUSE. It enables system administrators to interact and manage RPM packages more closely and automatically. It can download and install RPM packages automatically from designated servers. It can automatically handle dependencies and install all dependent packages at one time without tedious downloads and installations. yum provides commands to find, install, and delete one, group, or even all packages, and the commands are concise and memorable.

yum provides commands to find, install, and delete one, group, or even all packages, and the commands are concise and memorable.

  • grammar
Yum (options) (parameters)
  • option
- h: Display help information;
- y: Answer yes to all questions.
- c: Specify configuration files;
- q: quiet mode;
- v: Detailed mode;
- d: Set the debugging level (0-10);
- e: Set error level (0-10);
- R: Set the maximum waiting time for yum to process a command;
- C: Run entirely from the cache without downloading or updating any header files.
  • parameter
Install: install rpm package;
Update: update rpm package;
check-update: Check for available updates to rpm packages;
remove: delete the specified rpm package;
list: Display package information;
search: Check the package information;
info: Displays descriptive and summary information of the specified rpm package;
clean: clean up the yum expired cache;
Shell: the shell prompt that enters yum;
resolvedep: Displays the dependencies of rpm packages;
localinstall: install the local rpm package;
localupdate: Display the local rpm package for updates;
deplist: Displays all dependencies of rpm packages.
  • install
yum install              #Full Installation
yum install package1     #Install the specified installation package package1
yum groupinsall group1   #Installer group group1
  • Update and upgrade
yum update               #All updates
yum update package1      #Update the specified package package1
yum check-update         #Check for updateable programs
yum upgrade package1     #Upgrade specified package package1
yum groupupdate group1   #Upgrade group 1
  • Find and display
yum info package1      #Display installation package information package1
yum list               #Display all installed and installable packages
yum list package1      #Display package1 for specified package installation
yum groupinfo group1   #Display group 1 information yum search string to find installation packages based on keyword string
  • Delete program
yum remove && erase package1   #Delete package package1
yum groupremove group1             #Delete program group group1
yum deplist package1               #View program package1 dependencies
  • Clear Cache
yum clean packages       #Clear packages in the cache directory
yum clean headers        #Clear headers in the cache directory
yum clean oldheaders     #Clear the old headers in the cache directory

apt-get

Ubuntu is a Debian-based distribution. We use apt-get command to get this list. Here are the common commands:

Run the command after modifying / etc/apt/sources.list or / etc/apt/preferences. In addition, you need to run this command regularly to ensure that your package list is up to date:

apt-get update

Install a new package:

apt-get install packagename

Uninstall an installed package (keep configuration files):

apt-get remove packagename

Uninstall an installed package (delete configuration files):

apt-get –purge remove packagename

The loaded or unloaded software will be backed up on the hard disk, so if you need space, you can use this command to delete the software you have deleted:

apt-get autoclean apt

This command will delete the backup of the installed software, but it will not affect the use of the software:

apt-get clean 

Update all installed packages:

apt-get upgrade 

Upgrade the system to a new version:

apt-get dist-upgrade 

Run this command regularly to clear. deb files for those packages that have been uninstalled. In this way, you can free up a lot of disk space. If your needs are urgent, you can use apt-get clean to free up more space. This command deletes the. deb file of the installed package. In most cases, you won't use these. debs files anymore, so if you're worried about the lack of disk space, this might be worth a try:

apt-get autoclean

ps: Reference Self Here

Source code

Advantages of installing software using source code

  • Get the latest software version and fix bug s in time

  • Flexible customization of software functions according to user needs

Examples of application occasions

  • When installing newer versions of applications, most of the latest versions of free software are first released in the form of source code.
  • When the currently installed program can not meet the needs, the compilation and installation can be modified and customized by users themselves.
  • When new functions need to be added to the application, users can reconfigure, modify the source code freely, and add new functions.

Source package publishing format

Tarball packet:

The formats of. tar.gz and. tar.bz2 are in the majority.

md5sum checking tool

Calculate the MD5 checksum and compare it with the official value to determine whether it is consistent; (Check whether the download is complete)

The Basic Process of Source Code Compiling and Installation

  1. Unpack - tar

    Unpack and release source code files
    
  2. Configuration --. / configure

    Configuration of installation parameters for current system and software environment
    
  3. Compilation - make

    Converting source code files into binary executable programs
    
  4. Installation - make install

  5. Copy the compiled program files to the system

  6. Confirm the source code compilation environment

    A compiler supporting C/C++ programming language needs to be installed

[root@centos-linux-1 ~]# rpm -qa|grep gcc
gcc-4.8.5-11.el7.x86_64
libgcc-4.8.5-11.el7.x86_64

Prepare source packages

Install wget

[root@centos-linux-1 Documents]# yum search wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.tuna.tsinghua.edu.cn
============================ N/S matched: wget ============================
wget.x86_64 : A utility for retrieving files using the HTTP or FTP protocols

  Name and summary matches only, use "search all" for everything.

... ...

[root@centos-linux-1 Documents]# yum install wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
... ...
Installed:
  wget.x86_64 0:1.14-13.el7                                                                                      

Complete!

Transfer files from windows to linux

xshell xftp5

Using scp

  1. Get files on remote servers

scp -P 2222 root@www.vpser.net:/root/lnmp0.4.tar.gz /home/lnmp0.4.tar.gz
Upper port capitalization P is the parameter, 2222 indicates the port after the SSH port is changed. If the SSH port is not changed, the parameter can not be added. root@www.vpser.Net denotes the use of root users to log on to the remote server www.vpser.net, / root/lnmp0.4.tar.gz denotes files on the remote server, and / home/lnmp0.4.tar.gz at the end denotes the path and file name saved locally.

  1. Upload local files to the server

scp -P 2222 /home/lnmp0.4.tar.gz root@www.vpser.net:/root/lnmp0.4.tar.gz
Upper port capitalization P is the parameter, 2222 indicates the port after the SSH port is changed. If the SSH port is not changed, the parameter can not be added. / home/lnmp0.4.tar.gz denotes the path and file name of the file to be uploaded locally. root@www.vpser.net denotes the use of root users to log on to the remote server www.vpser.net, / root/lnmp0.4.tar.gz denotes the directories and file names stored on the remote server.

  1. Upload the local directory to the server

scp -P 2222 -r /home/lnmp0.4/ root@www.vpser.net:/root/lnmp0.4/
Upper port capitalization P is the parameter, 2222 indicates the port after the SSH port is changed. If the SSH port is not changed, the parameter can not be added. - The r parameter represents recursive replication (i.e., replication of the files and directories under the directory); / home/lnmp0.4/ indicates the directory to be uploaded; root@www.vpser.net indicates using root user to log on to the remote server www.vpser.net; / root/lnmp0.4/ indicates the location of the directory stored on the remote server.

  1. Several parameters that may be useful:
- v, like - V in most linux commands, is used to show progress. It can be used to view connections, authenticate, or configure errors.

- C enables compression options.

- 4. Force the use of IPV4 addresses.

- IPV6 address is forcibly used.

Binary Packet

rpm

The Linux rpm command is used to manage the suite.
RMP (red hat package manager) was originally a program of Red Hat Linux distribution specially used to manage various Linux suites. It is popular because it follows GPL rules and has powerful and convenient functions. It is gradually adopted by other distributions. The emergence of RPM suite management makes Linux easy to install and upgrade, which indirectly improves the applicability of Linux.

Command format

[root@centos-linux-1 ~]#  rpm [option] parameter

More Optional Parameters for rpm See here.

deb

deb is the format of ubuntu and debian.

Name of dpkg-i installation package

The installation method is as follows:

    sudo  dpkg  -i  package.deb

There are many ways to use dpkg in detail on the Internet. Here are a few simple lists:

Dpkg-i package.deb installation package
 Dpkg-r package deletion
 Dpkg-P package deletion package (including configuration file)
Dpkg-L package lists the files associated with the package
 Dpkg-l package shows the version of the package
 dpkg - unpack package.deb Unwraps the contents of the deb package
 Dpkg-S keyword search for package contents
 dpkg -l lists currently installed packages
 Dpkg-c package.deb lists the contents of DEB package
 dpkg-configure package configuration package

According to the Ubuntu Chinese Forum, all deb packages downloaded are cached in the / var/cache/apt/archives directory using apt-get method. Therefore, deb packages can be backed up and even made into ISO toolkits and chassis. Ubuntu can be installed in the absence of network environment in the future.)

.sh

http://soft.vpser.net/lnmp/lnmp1.4-full.tar.gz

MD5: ddfe39d9254338f8634c522e22981da2

[Appendix] Detailed description of ASSHH configuration file

    Port 22  #Set the port number for ssh listening, default port 22
    ListenAddress ::
    ListenAddress 0.0.0.0  #Specify the address of the monitor, default monitor all;
    Protocol 2,1   #Specify the version number of the supported SSH protocol. '1'and'2' indicate that only SSH-1 and SSH-2 protocols are supported.
    #"2,1"Express concurrent support SSH-1 and SSH-2 Agreement.#
    HostKey /etc/ssh/ssh_host_rsa_key
    HostKey /etc/ssh/ssh_host_dsa_key
    HostKey /etc/ssh/ssh_host_ecdsa_key
    HostKey /etc/ssh/ssh_host_ed25519_key    #HostKey is the storage location of host private key files. 
    #SSH-1 defaults to / etc/ssh/ssh_host_key. SSH-2 defaults to / etc/ssh/ssh_host_rsa_key and
    #/ etc/ssh/ssh_host_dsa_key. A host can have multiple private keys. "rsa1" is only used for SSH-1.
    #"dsa" and "rsa" are used only for SSH-2.
    UsePrivilegeSeparation yes     #Whether to grant access rights by creating an unprivileged subprocess to process access requests
    #Limited separation. The default value is yes. Once the authentication is successful, another sub-process will be created with the identity of the authenticated user. The purpose of doing so is to
    #In order to prevent the promotion of privileges through defective subprocesses, the system is more secure.
    KeyRegenerationInterval 3600   #When the short-lived server key is set with this instruction under the SSH-1 protocol
    #Periodic (seconds) are generated continuously; this mechanism can minimize the loss of keys or hacker attacks. Set to 0 
    #Represents never being regenerated to 3600 seconds.
    ServerKeyBits 1024    #The number of digits specified for the server key
    SyslogFacility AUTH   #Specifies which logging subsystem (facility) will send the log message. The effective value is:
    #DAEMON, USER, AUTH (default), LOCAL0, LOCAL1, LOCAL2, LOCAL3,LOCAL4, LOCAL5, 
    #LOCAL6, LOCAL7
    LogLevel INFO     #Specify log level (level of detail). Available values are as follows: QUIET, FATAL, ERROR, INFO
    #(Default), VERBOSE, DEBUG, DEBUG1, DEBUG2, DEBUG3,DEBUG and DEBUG1 are equivalent; DEBUG2
    # DEBUG3 and DEBUG3 specify more detailed and verbose log output, respectively. More detailed logs than DEBUG may leak users
    # Sensitive information, therefore opposed to use.
    LoginGraceTime 120  #Restrict the user to authenticate successfully within a specified time limit (unit seconds), 0 means unlimited. default
    #The value is 120 seconds; if the user cannot log in successfully, the server needs to wait 120 seconds before the user disconnects.
    PermitRootLogin yes  #Whether root is allowed to log in. The available values are as follows: "yes" (default) means permission.
    #"no" means prohibition. "without-password" means that password authentication is prohibited. "Force-commands-only"
    #Represents that public key authenticated login is allowed only when command options are specified, and other authentication methods are all prohibited.
    #This value is often used for things like remote backup.
    StrictModes yes       #Specifies whether sshd(8) is required to configure the user's home directory and associated configuration before accepting connection requests
    #Place files for host and permission checks. It is strongly recommended that the default value "yes" be used to prevent possible low-level errors.
    RSAAuthentication yes  #Whether pure RSA public key authentication is allowed. For SSH-1 only. The default value is yes.
    PubkeyAuthentication yes  #Is public key authentication allowed? It can only be used in SSH-2. The default value is yes.
    IgnoreRhosts yes    #Whether to cancel the use of ~/.ssh/.rhosts for authentication. The recommendation is yes.
    RhostsRSAAuthentication no  #This option is specifically for version 1, using rhosts files in    
    #/ etc/hosts.equiv cooperates with RSA calculus to authenticate! Recommend no.
    HostbasedAuthentication no    #This is similar to the above project, but for version 2
    IgnoreUserKnownHosts no          #Is it in Rhosts RSA Autohentication or 
    #The ~/.ssh/known_hosts file of the user is ignored in the Hostbase Authentication process. The default value is "no".
    #In order to improve security, it can be set as "yes".
    PermitEmptyPasswords no         #Whether to allow users with empty passwords to login remotely. The default is "no".
    ChallengeResponseAuthentication no   #Is challenge-response recognition allowed?         
    #Card. The default value is yes, and all the authentication methods allowed in login.conf are supported.
    PasswordAuthentication yes      # Is password-based authentication allowed? The default is yes.
    KerberosAuthentication no    #Does the user be required to provide Password Authentication with a password?
    #Kerberos KDC authentication is required, that is, whether Kerberos authentication is used or not. Using Kerberos authentication, server
    #A Kerberos servtab is needed to verify KDC identity. The default value is "no".
    KerberosGetAFSToken no       #If AFS is used and the user has a Kerberos 5 TGT,
    #After the instruction is turned on, an AFS token will be attempted before accessing the user's home directory. The default is "no".
    KerberosOrLocalPasswd yes   #If Kerberos password authentication fails, the password will have to pass through other
    #Authentication mechanisms (e.g. / etc/passwd). The default value is yes.
    KerberosTicketCleanup yes    #Whether to destroy the ticket automatically after the user logs out. default
    #"yes". 
    GSSAPIAuthentication no      #Is GSSAPI-based user authentication allowed? The default value is "no".
    #For SSH-2 only.
    GSSAPICleanupCredentials yes   #Whether to automatically destroy the user credentials cache after the user logs out. Default values      
    #yes. For SSH-2 only.
    X11Forwarding no    #Is X11 forwarding allowed? The default value is "no" and "yes" is allowed. If
    #X11 forwarding is allowed and the display area of the sshd agent is configured to listen on an address with a wildcard (X11UseLocalhost).
    #Then additional information may be leaked. Because of the potential risks of using X11 forwarding, the default value of this instruction is "no". need
    #It should be noted that forbidding X11 forwarding does not prohibit users from forwarding X11 communications, because users can install their own transponders. as
    #If UseLogin is enabled, X11 forwarding will be automatically prohibited.
    X11DisplayOffset 10    #Specifies the first display number available for X11 forwarding. Default values                   
    #It's 10. This can be used to prevent sshd from occupying the real X11 server display area and causing confusion.
    PrintMotd no                #Do you display some information after login? For example, the time and place of last login, etc.
    #Wait, the default is yes, but for safety, you can consider changing to no!
    PrintLastLog yes           #Specifies whether the last user's login time is displayed. The default value is "yes"
    TCPKeepAlive yes       #Specifies whether the system sends TCP keepalive messages to the client. The default value is "yes"
    #.  This message can detect dead connections, inappropriate connection closures, client crashes and other anomalies. It can be set to "no" to turn off this feature.
    UseLogin no               #Whether to use login in the login process of an interactive session. The default value is "no".
    #If this instruction is turned on, X11 Forwarding will be banned because login does not know how to handle xauth 
    #Cooks. It should be noted that login is prohibited for remote command execution. If specified 
    #UsePrivilege Separation, then it will be disabled after authentication is completed.
    MaxStartups 10        #Maximum number of unauthenticated connections allowed to be maintained. The default value is 10. After reaching the limit,
    #New connections will no longer be accepted unless previous connection authentication succeeds or exceeds the limits of LoginGraceTime.
    MaxAuthTries 6     #Specifies the maximum number of authentication allowed per connection. The default value is 6. If the number of failures exceeds
    #After half of this value, the connection will be forcibly disconnected and additional failure log messages will be generated.
    UseDNS no          #Specifies whether the remote host name should be reverse resolved to check whether the host name is related to its IP
    #Addresses correspond to each other.
    Banner /etc/issue.net   #The contents of the file specified in this instruction are displayed to the remote user before the user authenticates.
    #This feature can only be used for SSH-2, and nothing is displayed by default. "none" means that this feature is disabled.
    Subsystem sftp /usr/lib/openssh/sftp-server   #Configure an external subsystem (for example, a file)
    #Transfer daemon). For SSH-2 protocol only. Value is the name of a subsystem and the corresponding command line (with options and parameters).
    UsePAM yes     #Whether to use PAM module authentication

[Appendix] Detailed description of the Brpm option

- a Query all suites.
- B < Completion Stage > < Package File > + or - T < Completion Stage > < Package File > + Set the completion stage of the package and specify the file name of the package file.
- c Only configuration files are listed. This parameter should be used in conjunction with the "-l" parameter.
- d Lists only text files. This parameter should be used with the "-l" parameter.
- e < suite File > or -- erase < suite File > delete the specified suite.
- f < File > + Query has a suite of specified files.
- List the tags when installing the h or - hash suite.
- i Display information about the suite.
- I < suite File > or -- install < suite File > install the specified suite file.
- l Displays a list of files for the suite.
- P < suite File > + Query the specified RPM suite file.
- q uses the inquiry mode, and when there are any problems, the rpm instruction asks the user first.
- R Displays the correlation information of the suite.
- s Displays the status of the file. This parameter should be used in conjunction with the "-l" parameter.
- Upgrade the specified suite file by U < suite File > or - upgrade < suite file >.
- v Displays the instruction execution process.
- vv shows the instruction execution process in detail, which is easy to troubleshoot.
- addsign < suite File > + Add a new signature authentication to the specified suite.
All files install all files.
-- allmatches deletes files that conform to the specified suite.
When a bad reloc error occurs, reconfigure the file.
Builroot < Root Directory > Sets the directory to be the root directory when generating the suite.
--changelog displays the change record of the suite.
- checksig < suite File > + verifies the signature authentication of the suite.
After clean ing completes the package, delete the directory created in the packaging process.
- dbpath < Database Directory > Sets the directory to store RPM database.
- dump displays the validation information for each file. This parameter should be used in conjunction with "-l" parameter.
Do not install files when installing packages for excludedocs.
Excludepath < excluded Directory > ignores all files in the specified directory.
force forcibly replaces a suite or file.
- ftpproxy <host name or IP address> specifies the FTP proxy server.
- ftpport <Communication Port> Sets the communication port used by the FTP server or proxy server.
- help online help.
- httpproxy <Host Name or IP Address> Specifies HTTP Proxy Server.
- httpport <Communication Port> Sets the communication port used by HTTP server or proxy server.
ignorearch does not verify the correctness of the package file structure.
ignoreos do not verify the correctness of the package file structure.
-- ignoresize does not check for sufficient disk space before installation.
When installing the suite, install the files together.
initdb confirms that the correct database is available.
- justdb updates the database without changing any files.
Noulid does not perform any completion phase.
- nodeps do not verify the correlation of suite files.
-- nofiles do not validate the properties of files.
- nogpg skips all GPG signature authentication.
- nomd5 does not use MD5 encoding calculus to confirm the size and correctness of the file.
- nopgp skips signature authentication for all PGP s.
noorder does not re-arrange the installation sequence of the suite to satisfy its interrelatedness.
- noscripts does not execute any installation Script files.
notriggers does not execute any Script files in the package.
Old package upgraded to an old version of the suite.
Percentage of completion is displayed when installing the suite.
Pipeline < Execution Instruction > establishes a pipeline to convert the output to the input data of the execution instruction.
Preix < Destination Directory > If you reconfigure the file, place the file in the specified directory.
provides to query the compatibility provided by the suite.
- queryformat < header format > Sets the presentation of the header.
Queytags lists tags that can be used in the header format.
- rcfile <Profile> uses the specified configuration file.
Rebulid < suite File > Install the original code suite and regenerate the binary file suite.
rebuliddb rebuilds a database based on existing databases.
The effect of this parameter is similar to that of the specified "- rebulid" parameter when the package file is not generated.
- relocate < original directory >= < New Directory > change the files that would have been put in the original directory to the new directory.
- Replcefiles forcibly displace files.
Replcepkgs Force Replacement Suite.
Require to query the compatibility required for the suite.
- resing < suite File > + Delete existing authentication and regenerate signature authentication.
Remove the original code after the rmsource completes the package wrapping.
- rmsource < File > Deletes the original code and the specified file.
- root < Root Directory > Sets the directory to be the root directory.
--scripts lists the Script variables that install the suite.
setperms sets file permissions.
setugids sets the owner of the file and the group to which it belongs.
- short-circuit skips the steps of the specified completion stage directly.
sign generates signature authentication for PGP or GPG.
- target=<installation platform>+ Set up the installation platform for the generated suite.
Testing is for test ing only, and does not really install the suite.
- timecheck < check seconds > Sets the number of time seconds for check time.
- triggered by <suite file> query the packer of the suite.
triggers show the wrapper Script in the suite file.
Very, the effect of this parameter is the same as that of the specified "-q" parameter.
--version displays version information.
What provides <Functional Features> queries the compatibility provided by the suite for specified functional features.
- whatrequires <Functional Features> queries the compatibility required by the suite for the specified functionality.

[Appendix] Installation/Use of C MySQL Service

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

Restart mysql service

Systemctl  restart mysql.service
    (service mysql restart)

Setting Password

    mysql -u root
    set password for    'root'@'localhost'=password('123123');

Log on to mysql

    mysql -u root -p

[Appendix] Dphp Service Source Installation/Use

Download the installation package for php5.6

    wget http://mirrors.sohu.com/php/php-5.6.2.tar.gz;

Installing packages that PHP 5.6 depends on at compile time

    yum -y install gcc-c++ libxml2 libxml2-devel;

Decompressing php5.6 source package

    tar -xvf php-5.6.2.tar.gz

Enter the decompressed directory of php5.6

    cd php-5.6.2

Configure php5.6

    ./configure --enable-fpm --enable-mbstring  --prefix=/usr/local/php

Compile php, using make command

    make

Install php

    make install

Unloading php

  • View all php-related rpm packages installed on the machine
rpm -qa | grep php;

Delete in dependency order

yum remove 

[Appendix] E mount command

The Linux mount command is a common command used to mount files outside the Linux system.

grammar

mount [-hV]
mount -a [-fFnrsvw] [-t vfstype]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir

Description of parameters:

- V: Display program version
 - h: Display auxiliary messages
 - v: Displays more information, and - f is usually used to debug.
- a: Hang all the file systems defined in / etc/fstab.
- F: This command is usually used with - a, which generates a schedule for each mount action to execute.
When the system needs to mount a large number of NFS file systems, it can speed up the action of mounting.
- f: Usually used for debugging purposes. It allows mount to simulate the whole mounting process instead of performing the actual mounting action. Usually used with - v.
- n: Generally speaking, mount writes a piece of data in / etc/mtab after it is mounted.
However, this option can be used to cancel this action in the absence of a writable file system in the system.
- s-r: equal to-o ro
 - w: equal to - o rw
 - L: Hang a partitioned hard disk with a specific label.
- U: Hang down the file system with the file division number. - L and - U must be meaningful only in the presence of files like / proc/partition.
- t: Specify the type of file system, usually without specifying it. mount automatically selects the correct configuration.
- o async: Open asynchronous mode, all file read and write actions will be executed in asynchronous mode.
- o sync: executed in synchronous mode.
- o atime, - o noatime: When atime opens, the system updates the "last call time" of the file every time it reads it.
When we use flash file system, we may choose to turn this option off to reduce the number of writes.
- o auto, - o noauto: Open/close auto hang mode.
- o defaults: Use default options rw, suid, dev, exec, auto, nouser, and async.
- o dev, -o nodev-o exec, -o noexec allow execution files to be executed.
-o suid,-o nosuid: 
Execution files are allowed to execute under root privileges.
- o user, - o nouser: Users can perform mount/umount actions.
- o remount: Re-mount an already-mounted file system in a different way. For example, the original read-only system is now re-mounted in a readable and writable mode.
- o ro: Hang it in read-only mode.
- o rw: Hang it in read-write mode.
- o loop=: Use loop mode to partition a file as a hard disk and hang it on the system.
  • Example: u disk mounting and unloading
fdisk -l    # View the disc character of U disk 
mkdir /mnt/usb # Create / mnt/usb directory
mount /dev/sdb4 /mnt/usb    # mount
umount /mnt/usb   # uninstall

[Appendix] F mysql source installation

ps: Reference to the original text here

Install dependency packages

yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison

Toolkits needed

mysql_install.tar.gz

mkdir -p ~/Downloads

mv mysql_install.tar.gz ~/Downloads/

cd ~/Downloads/

tar -xvf mysql_install.tar.gz

New MySQL Users and User Groups

groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql

Unzip tar package

 [root@centos-linux-1 Downloads]# tar -zxvf boost_1_59_0.tar.gz

 [root@centos-linux-1 Downloads]# md5sum mysql-5.7.18.tar.gz 
    9fb9aeff41d36ccb9be0820afe4b2d8a  mysql-5.7.18.tar.gz

mysql source address

Create mysql database directory

 mkdir -p /data/mysql

Compile MySQL CD mysql-5.7.18

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/mysql \
-DWITH_BOOST=../boost_1_59_0 \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DENABLE_DTRACE=0 \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DWITH_EMBEDDED_SERVER=1

Compile and install

make -j `grep processor /proc/cpuinfo | wc -l`

make install

Set up startup script, boot-up self-startup

[root@centos-linux-1 mysql-5.7.18]# ls -lrt /usr/local/mysql
total 56
-rw-r--r--.  1 root root  2478 Mar 18 15:45 README
-rw-r--r--.  1 root root 17987 Mar 18 15:45 COPYING
drwxr-xr-x.  2 root root  4096 Jul 16 16:16 docs
drwxr-xr-x.  3 root root  4096 Jul 16 16:16 include
drwxr-xr-x.  4 root root  4096 Jul 16 16:16 man
drwxr-xr-x.  4 root root  4096 Jul 16 16:16 lib
drwxr-xr-x.  2 root root  4096 Jul 16 16:16 bin
drwxr-xr-x. 10 root root  4096 Jul 16 16:16 mysql-test
drwxr-xr-x. 28 root root  4096 Jul 16 16:16 share
drwxr-xr-x.  2 root root  4096 Jul 16 16:16 support-files
[root@centos-linux-1 mysql-5.7.18]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@centos-linux-1 mysql-5.7.18]# chmod +x /etc/init.d/mysqld
[root@centos-linux-1 mysql-5.7.18]# systemctl enable mysqld
mysqld.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysqld on
[root@centos-linux-1 mysql-5.7.18]# 

configuration file

cat > /etc/my.cnf << EOF
[client]
port = 3306
socket = /dev/shm/mysql.sock
[mysqld]
port = 3306
socket = /dev/shm/mysql.sock
basedir = /usr/local/mysql
datadir = /data/mysql
pid-file = /data/mysql/mysql.pid
user = mysql
bind-address = 0.0.0.0
server-id = 1
init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4
#skip-name-resolve
#skip-networking
back_log = 300
max_connections = 1000
max_connect_errors = 6000
open_files_limit = 65535
table_open_cache = 128
max_allowed_packet = 4M
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 16M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
key_buffer_size = 4M
thread_cache_size = 8
query_cache_type = 1
query_cache_size = 8M
query_cache_limit = 2M
ft_min_word_len = 4
log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 30
log_error = /data/mysql/mysql-error.log
slow_query_log = 1
long_query_time = 1
slow_query_log_file = /data/mysql/mysql-slow.log
performance_schema = 0
explicit_defaults_for_timestamp
#lower_case_table_names = 1
skip-external-locking
default_storage_engine = InnoDB
#default-storage-engine = MyISAM
innodb_file_per_table = 1
innodb_open_files = 500
innodb_buffer_pool_size = 64M
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
bulk_insert_buffer_size = 8M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
interactive_timeout = 28800
wait_timeout = 28800
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
EOF

Add mysql environment variables

[root@centos-linux-1 ~]# echo -e '\n\nexport PATH=/usr/local/mysql/bin:$PATH\n' >> /etc/profile && source /etc/profile

Initialize the database

[root@centos-linux-1 ~]# mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql

Start the database

[root@centos-linux-1 ~]# systemctl start mysqld
[root@centos-linux-1 ~]# systemctl status mysqld

View MySQL service processes and ports

ps -ef | grep mysql

Setting the database root user password

Like Oracle database, MySQL database has a root user by default (which is totally different from the root user on the current Linux host). After setting up the security configuration of MySQL database, we initialize the password of root user. In the process of preparation, just input y all the way. Here I just explain that in MySQL version 5.7.13, user password policy is divided into three categories: low-level LOW, medium MEDIUM and super STRONG. Medium MEDIUM level is recommended!

mysql_secure_installation

Common Operations

Sharing Dynamic Link Library of MySQL Database to System Link Library

In general, MySQL databases are also invoked by services like PHP, so we need to add the MySQL compiled lib library file to the current Linux host link library / etc/ld.so.conf.d./
Next, MySQL services can be invoked by other services.

[root@centos-linux-1 ~]# ldconfig |grep mysql
[root@centos-linux-1 ~]# echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
[root@centos-linux-1 ~]# ldconfig
[root@centos-linux-1 ~]# ldconfig -v |grep mysql
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
/usr/lib64/mysql:
    libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
/usr/local/mysql/lib:
    libmysqlclient.so.20 -> libmysqlclient.so.20.3.5

Create other MySQL database users

[root@centos-linux-1 ~]# mysql -uroot -p


mysql>CREATE DATABASE `tonnydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

mysql> grant all privileges on tonnydb.* to 'tonny@%' identified by 'Hi.Tonny@888';

mysql> flush privileges;


mysql>  exit

Posted by PandaFi on Mon, 10 Jun 2019 16:19:11 -0700