At present ali cloud, Tencent cloud is better. I use Tencent Cloud. New users suggest direct purchase of 3 years, relatively preferential.
Connection terminals
ssh root@ip
Copy the code
Changing host names
For example, mine looks like this:
[root@VM-0-4-centos ~]#
#Viewing host Names
hostname
Copy the code
Change steps:
- Delete the hostname in the /etc/hostname file and replace it with the new hostname
- Update the 127.0.1.1 < hostname > entry in the /etc/hosts file
- Restart reboot
Change password
passwd
Copy the code
Add a login welcome diagram
As shown in figure
Modify the contents of the /etc/motd file and save the modification.
Both online images and text can be converted to ASCII ascii-art-generator.org
Switch to bash, which is good
#Displays the currently installed shell
cat /etc/shells
Copy the code
Personally, I’d prefer to use the most common bash, after allzsh
To install.
Install the software
JDK
The RPM version
-
Download JDK -8u261-linux-x64.rpm from oracle’s official website
-
Adding Execution Permission
chmod +x jdk-8u131-linux-x64.rpm Copy the code
-
Run RPM to install
rpm -ivh jdk-8u131-linux-x64.rpm Copy the code
(I installed the default setting environment variables, the following is not done)
-
Modify the configuration file /etc/profile. Add and save as follows:
Export JAVA_HOME= /usr/jav/jdk1.8.0_131 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH}Copy the code
-
To take effect
source /etc/profile Copy the code
-
Verify success
java -version Copy the code
Tomcat
-
You have obtained the installation package apache-tomcat-9.0.37.tar.gz
-
Unpack the
Tar ZXVF - apache tomcat - 9.0.37. Tar. GzCopy the code
-
The bin directory in the installation directory is displayed
Sh & # start the server, & vxconfigd./shutdown.sh # shutdown the serverCopy the code
For details about how to install an SSL certificate, see Tomcat Learning: Installing an SSL Certificate
Mysql
The version used here is 5.7.22. The version varies slightly. Prepare the installation package: mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
Recommended conventions
- Mysql directory installation location (basedir) : /usr/local/mysql
- Database location (datadir) : /data/mysql
Note: do not spell the letter wrong ah, or pit yourself
Unzip the package to the target location
#Decompression packageThe tar ZXVF mysql - 5.7.22 - Linux - glibc2.12 - x86_64. Tar. Gz#Move and rename to the installation directoryMysql - 5.7.22 - Linux - mv glibc2.12 x86_64 / usr/local/mysqlCopy the code
Create the data warehouse directory
mkdir -p /data/mysql
Copy the code
Create a mysql user, group, and directory
#Create an MSYQL group
groupadd mysql
#Create an MSYQL user to prohibit shell login
useradd -r -s /sbin/nologin -g mysql mysql -d /usr/local/mysql
Copy the code
Change the owner of the directory
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
chown -R mysql /data/mysql
Copy the code
Configuration parameters
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
Copy the code
Explanation:
--basedir=/usr/local/mysql
: Installation directory--datadir=/data/mysql
: Data directory
Note here that the generated temporary password is recorded, usually in the last line
Possible errors:
-
error while loading shared libraries: libnuma.so.1
Solution: If the mysql server is installed, an error message is displayed. Centos Centos yum -y install numactl Ubuntu sudo apt-get install numactl
Modify the system configuration file
cd /usr/local/mysql/support-files
cp mysql.server /etc/init.d/mysql
vim /etc/init.d/mysql
#Modify the following:
basedir=/usr/local/mysql
datadir=/data/mysql
Copy the code
Start the mysql
/etc/init.d/mysql start
Copy the code
Possible errors:
-
mysqld_safe error
Install Mariadb on Linux[CentOS] server. Install Mariadb on CentOS.
#Query installed Mariadb rpm -qa | grep mariadb #uninstallRPM -e --nodeps File name #Delete the my.cnf file in the etc directory #Uninstallation may delete the file, so make sure rm /etc/my.cnf Copy the code
Execute again, success
-
The login
#Log in and enter the password mentioned earlier mysql -uroot -p Copy the code
-bash: mysql: command not found
ln -s /usr/local/mysql/bin/mysql /usr/bin Copy the code
-
Change the password
mysql> set password=password('password'); Copy the code
Set the host address of the root account.
mysql>grant all privileges on *.* to 'root'@The '%' identified by 'password'; mysql>flush privileges; Copy the code
This indicates that all privileges, including remote access, are granted to the local IP address, and the % percent sign indicates that any IP address is allowed to access the database.
Configure the automatic startup of mysql
vim /etc/profile
#Add:
export PATH=/usr/local/mysql/bin:$PATH
#Exit file execution
source /etc/profile
chmod 755 /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 345 mysql on
#Viewing Service Status
chkconfig --list mysql
#Mysql > Update mysql
service mysql status
#Stop the mysql
service mysql stop
#Start the mysql
service mysql start
Copy the code
FTP
vsftp
Check whether it has been installed
rpm -qa | grep vsftpd
#If there are deletions
rpm -e vsftpd
Copy the code
Installed VSFTP
yum -y install vsftpd
#Launch VSFTPD:
service vsftpd start
#Stop VSFTPD:
service vsftpd stop
#Restart VSFTPD:
service vsftpd restart
#VSFTPD:
service vsftpd status
Copy the code
configuration
Default configuration file /etc/vsftp/vsftpd. conf(Back up the configuration file before changing it.)
Adding a Local User
useradd -s /sbin/nologin -d /home/ftpuser ftpuser
Copy the code
Change the password
passed ftpuser
Copy the code
References:
- Mysql5.7 Linux Installation tutorial
- Bin /mysqld: error while loading shared libraries: libnuma.so.1: install mysql