In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of how to use Java+Vue to build a personal blog, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to build a personal blog with Java+Vue. Let's take a look at it.
Server environment configuration installation JDK
There are a lot of information on the Internet.
Install MySQL to see if rpm-qa can be installed | grep-I mysql
Or
Yum list installed | grep mysql deletes the historical version yum-y remove myql. Download MySQL YUM source wget-I-c http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm install Yum source rpm-ivh mysql57-community-release-el7-11.noarch.rpm install MySQLyum install mysql-server
All the way.
Start MySQLsystemctl start mysqld
View startup status
Systemctl status mysqld change password to get the temporary password generated by the system grep password / var/log/mysqld.log use the temporary password to log in to mysql-uroot-p grep password / enter the 00:00 password to modify the password # upgrade password alter user 'root'@'localhost' identified by' new password; # set password never expires ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; install gityum install git / / this non-viable version is too old to install jenkins
Download jenkins.war
Java-jar jenkins.war-- httpPort=6080
Any port number
Install nginx
There are many online tutorials.
Configure nginx preparation
Purchase the domain name and resolve it to the current server.
The domain name https://www.kkrepo.com is the domain name of blog.
The domain name https://jenkins.kkrepo.com is the jenkins domain name.
Apply for a free certificate corresponding to the domain name
Modify the configuration profile directory structure
/ etc/nginx
.
| |-nginx.conf |
| |-conf.d |
| |-ssl / / folder where certificates are stored |-www.kkrepo.com_bundle.crt |-www.kkrepo.com.key |-jenkins.kkrepo.com_bundle.crt |-jenkins.kkrepo.com.key |-www.conf | / / www.kkrepo.com domain name configuration |-jenkins.conf / / jenkins.kkrepo.com domain name configuration nginx.conf configuration user nginx Worker_processes 2 errorists log / var/log/nginx/error.log warn;pid / var/run/nginx.pid;events {worker_connections 1024;} http {include / etc/nginx/mime.types; default_type application/octet-stream Log_format main'$remote_addr-$remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer"'"$http_user_agent"$http_x_forwarded_for"; access_log / var/log/nginx/access.log main; sendfile on; # tcp_nopush on; keepalive_timeout 65; # gzip on # introduce the configuration file include / etc/nginx/conf.d/*.conf;} www.conf in the conf.d folder to configure server {listen 80; server_name kkrepo.com; rewrite ^ (. *) $https://www.kkrepo.com$1 permanent;} server {listen 80; server_name www.kkrepo.com; rewrite ^ (. *) $https://${server_name}$1 permanent;} server {listen 443; server_name kkrepo.com Rewrite ^ (. *) $https://www.kkrepo.com$1 permanent;} server {listen 443 ssl http2 default_server; server_name www.kkrepo.com; ssl_certificate / etc/nginx/conf.d/ssl/www.kkrepo.com_bundle.crt; ssl_certificate_key / etc/nginx/conf.d/ssl/www.kkrepo.com.key; ssl_session_timeout 5m Ssl_ciphers ECDHEMurRSAMUE AES128MUGCMMuSHA256 ssl_protocols TLSv1.2; ssl_prefer_server_ciphers on; location ECDHEVE ECDHVIEHV AESHGH Higg / Null / Null / MD5RC4; ssl_protocols TLSv1.2; ssl_prefer_server_ciphers on; location / {proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8080; } access_log logs/www.log main;} jenkins.conf configuration upstream jenkins {server 127.0.0.1 upstream jenkins 6080;} server {listen 80; server_name jenkins.kkrepo.com; rewrite ^ (. *) $https://${server_name}$1 permanent;} server {listen 443 ssl http2; server_name jenkins.kkrepo.com; root / usr/share/nginx/html; ssl_certificate / etc/nginx/conf.d/ssl/jenkins.kkrepo.com_bundle.crt Ssl_certificate_key / etc/nginx/conf.d/ssl/jenkins.kkrepo.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1.2; ssl_prefer_server_ciphers on; location / etc/nginx/conf.d/ssl/jenkins.kkrepo.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1.2; ssl_prefer_server_ciphers on; location / {proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr Proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect http:// https://; proxy_pass http://jenkins; # Required for new HTTP-based CLI proxy_http_version 1.1; proxy_request_buffering off; proxy_buffering off # Required for HTTP-based CLI to work over SSL # workaround for https://issues.jenkins-ci.org/browse/JENKINS-45651 # add_header 'When jenkins.domain.tld:50022' always;} access_log logs/jenkins.log main;} nginx configuration takes effect nginx-s reload install docker and docker-compose install docker install docker-compose install epel source yum install-y epel-release install docker-composeyum install-y docker-compose install Maven
Copy the installation package link on the official website
Official website: https://maven.apache.org/download.cgi
Installation package link: apache-maven-3.6.3-bin.tar.gz
Unpack the installation package and put it in the / usr/local directory
Tar-xvf apache-maven-3.6.3-bin.tar.gz-C / usr/local/ configure the environment variable vi / etc/profileexport JAVA_HOME=/usr/local/jdk1.8.0_221export MVN_HOME=/usr/local/apache-maven-3.6.3export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin:$MVN_HOME/binsource / etc/profilemvn-v
If the server is slow, you can configure Aliyun's maven warehouse address.
Github configuration SSH configuration
Generate ssh on the server and configure pub key on github (Settings-> SSH and GPG keys).
Webhooks configuration
Access tokens configuration
Jenkins configuration and continuous integration global tool configuration
Source code management
Image-20200711120004709
Build trigger
Image-20200711120043546
Build the environment
Image-20200711120128028
Construction
Post-build operation
None
Problems encountered and solutions mvn command did not find the problem description + cd / root/.jenkins/workspace/Blog+ mvn clean package/tmp/jenkins3465102471897029074.sh: line 5: mvn: command Build step 'Execute shell' marked build as failureFinished: FAILURE not found
During the construction of jenkins, you need to use maven to package the project, but when you package, no mvn command exception is reported.
Cause analysis
Because the environment variables of Java and maven are placed in / etc/profile, and / etc/profile will only be load when the customer logs in, jenkins uses no-login when running the command, in this way, / etc/profile will not be entered by load when running the command, and jenkins can only find executable files under the current path.
Treatment scheme
In the settings of jenkins, you can set global variables.
Manage Jenkins-> Configure System-> Global Properties-> Environment variables
Description of the problem of slow speed of jenkins pull substitution code
It takes more than ten minutes for jenkins to pull the replacement code each time, but I am very quick when I use my own clone code on the server (I can basically rule out network problems).
Cause analysis
The git version is too old
Every time git pulls, it deletes the original file and pulls it all again.
Treatment scheme
Update to the latest version for git version issues
For the full pull of the project, make the following configuration in the current job
Clear the check box, or ignore the .git directory in the delete policy.
This is the end of the article on "how to use Java+Vue to build a personal blog". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to use Java+Vue to build a personal blog". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.