JDK
网上资料很多
MySQL
rpm -qa | grep -i mysql
或者
yum list installed | grep mysql
yum -y remove myql......
MySQL
YUM
源wget -i -c http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
YUM
源rpm -ivh mysql57-community-release-el7-11.noarch.rpm
MySQL
yum install mysql-server
一路
Y
究竟。
MySQL
systemctl start mysqld
查看启动状态
systemctl status mysqld
grep password /var/log/mysqld.log
mysql -uroot -p// 输入零时密码
# 升级密码alter user 'root'@'localhost' identified by '新密码';# 设置密码永不过期ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
git
yum install git // 这个不行 版本太旧
jenkins
下载jenkins.war
java -jar jenkins.war --httpPort=6080
端口号任意
nginx
网上教程很多
nginx
购买域名,并解析到当前服务器。
https://www.kkrepo.com 这个域名做博客域名
https://jenkins.kkrepo.com 这个域名做
jenkins
域名
申请域名对应的免费证书
/etc/nginx
.
| - nginx.conf
| - conf.d
| - ssl // 存放证书的文件夹 | - www.kkrepo.com_bundle.crt | - www.kkrepo.com.key | - jenkins.kkrepo.com_bundle.crt | - jenkins.kkrepo.com.key | - www.conf // www.kkrepo.com 域名配置 | - jenkins.conf // jenkins.kkrepo.com 域名配置
nginx.conf
配置user nginx;worker_processes 2;error_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; # 引入 conf.d 文件夹中的配置文件 include /etc/nginx/conf.d/*.conf;}
www.conf
配置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 ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 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
配置upstream jenkins { server 127.0.0.1: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_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 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 'X-SSH-Endpoint' 'jenkins.domain.tld:50022' always; } access_log logs/jenkins.log main;}
nginx
配置生效nginx -s reload
docker
及 docker-compose
docker
docker-compose
epel
源yum install -y epel-release
docker-compose
yum install -y docker-compose
Maven
官网复制安装包链接
官网:https://maven.apache.org/download.cgi
安装包链接:apache-maven-3.6.3-bin.tar.gz
将安装包解压,放到 /usr/local
目录下
tar -xvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
vi /etc/profile
export 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/bin
source /etc/profilemvn -v
假如服务器速度慢的话,可以配置阿里云的
maven
仓库地址。
github
配置SSH
配置在服务器上生成 ssh
,并将 pub key
配置到 github
(Settings -> SSH and GPG keys)上。
Webhooks
配置access tokens
配置Jenkins
配置及持续集成image-20200711120004709
image-20200711120043546
image-20200711120128028
无
mvn
命令未找到+ cd /root/.jenkins/workspace/Blog+ mvn clean package/tmp/jenkins3465102471897029074.sh:行5: mvn: 未找到命令Build step 'Execute shell' marked build as failureFinished: FAILURE
在 jenkins
的 构建
过程中,需要使用 maven
给项目打包,但是打包的时候,报找不到 mvn
命令异常。
Because the environment variables of Java
and maven
are placed in /etc/profile
, and /etc/profile
will only be loaded when the customer logs in. jenkins
When running the command, the no-login
method is used. This method is When running the command, /etc/profile
will not be loaded. jenkins
can only look for executable files in the current path.
In the settings of jenkins
, you can set global variables.
Manage Jenkins -> Configure System -> Global Properties-> Environment variables
Pulling code is slow
jenkins It takes more than ten minutes to pull the code every time, but when I
clone myself on the server, it takes a long time Fast (can basically rule out network problems).
job
Clear the check box, or Ignore the.git
directory in the deletion policy.
The above is the detailed content of Steps to build a personal blog using Java and Vue. For more information, please follow other related articles on the PHP Chinese website!