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
命令异常。
因为 Java
和 maven
的环境变量都是放在 /etc/profile
中的,而 /etc/profile
只有在客户登录的时候才会被 load, jenkins
在运行命令时,使用的是 no-login
的方式,这种方式在运行命令的时候, /etc/profile
是不会被 load 进来的,jenkins
只能在当前路径下寻觅可执行文件。
在 jenkins
的设置中,可以设置全局变量。
Manage Jenkins -> Configure System -> 全局属性 -> Environment variables
jenkins
拉取代码速度慢jenkins
每次拉取代码都需要十几分钟,但是我在服务器上自己 clone
代码的时候却很快(基本可以排除网络问题)。
git 版本太旧
git 每次拉取都是删除原来的文件,重新全量拉取
针对git版本问题,更新到最新版本
针对项目重新全量拉取,在当前 job
中做如下配置
清理该勾选项,或者者 在删除策略里面 忽略掉
.git
目录。
以上就是使用Java和Vue构建个人博客的步骤的详细内容,更多请关注php中文网其它相关文章!