The memory is too bad, I still have to write a tutorial to summarize the tutorial on configuring javaweb. This tutorial is also a synthesis of many tutorials on the Internet.
Environment
Server: Alibaba Cloud ESC Centos 7.3
Local: Mac OS X 10.10.5
Pre-preparation
It was only recently discovered that Alibaba Cloud does not recommend upgrading the server’s kernel and operating system versions. It is estimated that Tencent Cloud is also the same. Will be used all the time, the system version is also the latest 7.3, which was originally 7.2
In order to prevent the kernel and system version from being upgraded when the software is updated, according to the help document given by Alibaba Cloud, we do Modify as follows
Open the yum.conf file
1 |
vi /etc/yum.conf |
Add code
1 | exclude=kernel* |
This will prevent the upgrade, if you still don’t understand, please refer to the help file< /p> < p>Then we can start to upgrade the software package
1 |
yum -y update |
The -y parameter is the default selection yes for interaction encountered during execution
Install JDK
Visit Oracle's official website to download jdk, because Oracle engages in cookie verification, wget is inconvenient
Download address-http:// www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html
Before installing jdk, be sure to uninstall the previous version
Check the previously installed jdk rpm
1< /span>
|
rpm -qa | grep jdk |
After finding the package name, we can uninstall it
1 |
< pre>rpm -e package name |
Download After installing the package, we use the scp command to upload to the server
1 |
scp ~/Downloads/jdk-8u111-linux-x64 .rpm [email protected]:/usr/local/src |
Because I have Add trust, so you don’t need to enter the password.
If you must use wget to download directly from the server, I will provide the following method
1 |
wget --no-check- certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64. rpm |
The rpm package will be installed below
1 |
rpm -ivh jdk-8u111-linux-x64.rpm | span>
After installation, configure environment variables in the /etc/profile file
1 < /td> |
vi /etc/profile |
Add the following content
1 |
export JAVA_HOME=/usr/java/default |
View version number
1 |
java -version or javac -version |
View environment variables
1 |
echo $PATH |
Install Tomcat
I downloaded tomcat 8.5, the download address is-http://tomcat.apache.org/download-80.cgi
1 |
wget http: //apache.fayea.com/tomcat/tomcat-8/v8.5.11/bin/apache-tomcat-8.5.11.tar.gz |
Unzip
< span class="line">1 |
tar?zxvf apache-tomcat-8.5 .11.tar.gz |
Transfer files
1 |
Run Tomcat
1 | cd bin |
Stop Tomcat
1 |
< pre>./shutdown.sh |
Install mysql
Download and install rpm
1 | cd /usr/local/src |
Install mysql
1 |
yum install mysql-community-server |
It took a long time to install mysql, but the internet was disconnected midway. It’s a tragedy
1 |
/var/run/yum.pid has been locked, and another program with PID 8095 is running.
|
Only delete the process
1 |
rm -rf /var/run/yum.pid |
Before cleaning Re-download after caching
1 |
yum clean all |
The following process is the same as the previous article-Centos7 mysql installation article
Install Nginx
First check the version that yum can install
1 |
yum info nginx |
My version is 1.10.2, so I plan to use his
1 |
yum install nginx |
Because you don’t need to install dependencies yourself, you can use commands to check the version after installation.
< pre>1 |
nginx -v span>
|
Open service
View Status
1 |
systemctl status nginx |
Of course, you can also change the software source, first create a new repo, such as nginx.repo
1 |
vim?/etc/yum.repos.d/nginx.repo |
The editing content is as follows
1< /span>
|
[nginx] |
The mainline version is configured here, if you want to use For the stable version, just delete the mainline in baseurl
Configure Nginx
Use yum to install nginx, the configuration file is in /etc/nginx/ nginx.conf
here
1 |
vi /etc/nginx/nginx.conf |
Add listening port, because tomcat is port 8080
Then restart the service
systemctl restart nginx |
1 |
wget http://download.redis.io/releases/redis-stable.tar.gz |
First you can determine whether tcl is installed
1 |
rpm -qa tcl |
Response instructions with version number
You can also use which tcl
or whereis tcl
Next, unzip and move to the desired location< /p>
1 |
tar zxvf redis-stable.tar.gz |
Enter the redis directory and compile
1 |
cd /usr/local/redis-stable |
Then compile and check
1 |
make test |
If it tells you something is missing, just install it
The compilation check lasts for a while, and you can Installed
1 td> |
make install |
Execute after installation
1 |
redis-server |
Seeing this picture shows success
1 |
_._ |
1 |
daemonize yes #The default is no |
Then start with this configuration
< figure class="highlight plain">
1 td> |
redis-server redis.conf |
Check the process, and sure enough redis has started
p>
1 |
ps -aux #View all processes |
< /figure>
Test with client
1 |
Test successful
Close redis service
1 |
redis-cli shut down |
Modify the configuration file
1 |
vim redis.conf |
View network monitoring
< pre>1 |
netstat -nlt|grep 6379 |
See the network monitoring from 127.0.0.1:6379 code> becomes
0 0.0.0.0:6379
, indicating that Redis has allowed remote login access
Change the password of redis-cli
, the default is empty
p>
1 |
Startup configuration
1 span>
|
echo "/usr/l ocal/redis-stable/redis-server /usr/local/redis-stable/redis.conf &" >> /etc/rc.local |
Install vsftpd
Direct yum installation
1 |
yum -y install vsftpd |
Start vsftpd Service
1 |
systemctl restart vsftpd.service # restart service |
Modify configuration File
1 |
vim /etc/vsftpd/vsftpd.conf |
1 |
anonymous_enable=NO # Disallow anonymous access, disable anonymous login |
From After 2.3.5, vsftpd enhanced the security check. If the user is restricted to its home directory, the user’s home directory can no longer have write permissions
so add allow_writeable_chroot=YES
Create a new user
1 |
#Create user ftpuser and specify /var/ftp/public_root directory |
-s: Forbid this user to log in to SSH permissions
/sbin/nologin: This user is not allowed to log in to the system, but can log in FTP
Permission settings
1 |
< /span>
|
< /figure>
Set boot and restart
1 |
systemctl enable vsftpd.service |
Delete user
userdel ftpuser |
Finally, you can use it when you create a new site in Filezilla
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4879 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC