网站建设过程有哪几个阶段,建网站需要多少费用,网络营销策划ppt,智能建站系统的建站步骤当设置和配置 GitLab 实例并执行诸如创建群组、项目、用户和上传代码等操作时#xff0c;涉及到多个步骤#xff0c;每个步骤都有特定的目的。让我们逐步解释每个步骤并说明其背后的原因#xff1a; 安装必需的软件#xff1a; yum install -y curl policycoreutils-python…当设置和配置 GitLab 实例并执行诸如创建群组、项目、用户和上传代码等操作时涉及到多个步骤每个步骤都有特定的目的。让我们逐步解释每个步骤并说明其背后的原因 安装必需的软件 yum install -y curl policycoreutils-python openssh-server perl postfix此命令安装了必要的软件包包括命令行工具 curl、用于 SELinux 策略管理的 policycoreutils、用于远程访问的 OpenSSH 服务器、用于脚本编写的 Perl以及用于邮件服务的 Postfix。 2.启用 SSH 和 Postfix systemctl enable --now sshd postfix 此命令启用并启动了 SSH 服务器和 Postfix 邮件服务。SSH 用于远程访问服务器而 Postfix 用于发送电子邮件通知GitLab 可能会用于警报和用户通知。 3.安装 GitLab 下面获取 gitlab-ce-12.3.0-ce.0.el7.x86_64.rpm 文件 wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm --no-check-cetificate rpm -ivh gitlab-ce-12.3.0-ce.0.el7.x86_64.rpm 安装了指定版本的 GitLab 社区版软件包。 4.配置 GitLab 设置 (vim /etc/gitlab/gitlab.rb) vim /etc/gitlab/gitlab.rb external_url http://192.168.179.20:82
...
nginx[listen_port] 82 external_url http://192.168.179.20:82设置 GitLab 的外部 URL以便从中访问。在此情况下配置为使用 http://192.168.179.20:82。nginx[listen_port] 82配置 Nginx Web 服务器以监听端口 82。 5.重新配置和重启 GitLab gitlab-ctl reconfigure根据 gitlab.rb 中的设置重新配置 GitLab。 gitlab-ctl restart 重新启动 GitLab 服务以应用更改。 6.通过浏览器访问 GitLab 浏览器访问http://192.168.179.20:82 访问 GitLab 实例。如果出现 502 Bad Gateway 错误建议用户稍等片刻然后刷新页面。 1、设置管理员 root 用户的新密码注意有格式要求这里设置成 root123 2、使用管理员 root 用户登录root/root123 3、登录后点击页面右上方的用户选项下拉选择【Settings】点击左边菜单【Preferences】在【Localization】的【Language】中选择【简体中文】点击【Save changes】按钮再刷新页面使用中文显示。 //Gitlab添加组、创建用户、创建项目 #创建群组 点击页面左上方的【GitLab】图标点击 【新建群组】 【群组名称】、【群组URL】、【群组描述】都设置成 devops_group 【可见性级别】设置成 私有 其他都保持默认值点击 【创建群组】
#创建项目 点击 【新建项目】 【项目URL】群组选项下拉选择 devops_group 【项目名称】设置成 web_demo 【项目描述】设置成 web_demo 【可见等级】设置成 私有 点击 【创建项目】 #创建用户 点击页面上方的【扳手】图标进入“管理区域” 点击 【新建用户】 【姓名】设置成 zhangsan 【用户名】设置成 zhangsan 【电子邮箱】设置成 zhangsanxny.com 这里密码暂不设置其他都保持默认值先点击 【创建用户】 注Access levelRegular表示的是普通用户只能访问属于他的组和项目Admin表示的是管理员可以访问所有组和项目 创建好用户后再点击右上角的【Edit】可在这里设置密码如 zhangsan123
#将用户添加到组中 点击页面上方的【群组】下拉选择 devops_group 点击向群组添加用户菜单【成员】 【添加成员到 devops_group】在search for a user选择 zhangsan角色权限选择 Owner 点击 【添加到群组】
#使用自己创建的账户进行管理 退出当前账户使用自己创建的账户 zhangsan 登录zhangsan/zhangsan123 第一次登录会被强制要求修改密码zhangsan/zhangsan123可与旧密码相同再重新登录 #源码上传到Gitlab仓库
可能现需要yum下载git
yum install git -y
否则会command not fount
git config --global user.name zhangsan git config --global user.email zhangsanxny.com
cd ~ git clone http://192.168.179.20:82/devops_group/web_demo.git #账号/密码zhangsan/zhangsan123 ls -A web_demo/
上传 web_demo.zip 文件到 /opt 目录 cd /opt unzip web_demo.zip mv web_demo/* /root/web_demo/
cd /root/web_demo git add . git commit -m init web_demo git push -u origin master #账号/密码zhangsan/zhangsan123
[rootlocalhost web_demo]# git push -u origin master
Username for http://192.168.179.20:82: zhangsan
Password for http://zhangsan192.168.179.20:82:
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (10/10), 1.66 KiB | 0 bytes/s, done.
Total 10 (delta 0), reused 0 (delta 0)
To http://192.168.179.20:82/devops_group/web_demo.git* [new branch] master - master
Branch master set up to track remote branch master from origin.
[rootlocalhost web_demo]# 点击页面上方的【项目】下拉选择 web_demo即可看到上传的代码