During the National Day holiday, write essays to record what you have learned, practiced and gained. If you have any shortcomings, you are welcome to take a look~~~
Tools: Xftp 5, Xshell 5
1. Install jdk
1. Use Xftp 5 to upload jdk-8u65-linux-x64.tar.gz to the centos server.
2. Use the statement tar -zxvf jdk-8u65-linux-x64.tar.gz -C Destination address (such as /usr/java/)
3. Use the statement vim /etc/profile, add the following statement - export JAVA_HOME=/usr/java/jdk1.8
- export CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar
- export PATH=$PATH:$JAVA_HOME/bin
4. Execute statement: source /etc/profile, so that the modification takes effect immediately
5. Execution statement: java -version, check whether the installation is successful, success flag: The Java version appears
2. Install tomcat
1. Upload apache-tomcat-8.5.5.tar.gz to the centos server.
2. Use the statement tar -zxvf apache-tomcat-8.5.5.tar.gz -C destination address (such as /usr/java/)
3. Use startup.sh under /apache-tomcat-8.5.5/bin to start the tomcat server. The default is port 8080 4. Access it on the browser (it may be possible to set this port not to be opened on Tencent Cloud, you need to enter the relevant interface to open the port)
5. Security: Modify the tomcat-users.xml file under /apache-tomcat-8.5.5/conf
3. Install mysql
1. It seems that there is no mysql in the yum source in CentOS7 by default. To solve this problem, we need to download the repo source of mysql
1. Download mysql's repo source `wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm`
or
`wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm `
2. Install the mysql-community-release-el7-5.noarch.rpm package
`rpm -ivh mysql-community-release-el7-5.noarch.rpm`
or
`rpm -ivh mysql-community-release-el6-5.noarch.rpm`
3.yum install mysql-server
2. Reset password . Before resetting password, you must first log in: mysql -u root
3. You may report such an error when logging in:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), the reason is the access permission problem of /var/lib/mysql.sock.
The following command changes the owner of /var/lib/mysql to the current user: sudo chown -R openscanner:openscanner /var/lib/mysql
4. Restart the service : service mysqld restart
5. Log in and reset password:
`mysql -u root` `use mysql` `update user set password=password('123456') where user='root'` `exit`6. Unified database encoding:
1. Enter mysql and enter show variables like 'character%'; to view the current character set encoding situation
2. Modify the startup configuration file of mysql:
Find [client] to add:
default-character-set=utf8 Find [mysqld] to add:
character-set-server=utf8
init_connect='SET NAMES utf8'
3. Enter the command sudo service mysql restart to restart mysql and the startup is successful!
4. Note: the my.cnf file is usually located in /etc/mysql/ or /etc/, and may vary depending on the installation version or system.