动手实践一:虚拟机安装Gitlab

之前安装过一次,奈何没记录。导致现在系统崩溃,重新安装。这次要记录下过程。

一,安装虚拟机:

我是在win10系统上,安装VMware12,Ubuntu 16.04.3 LTS

虚拟机和Ubuntu系统安装过程略。

1,Ubuntu系统安装好之后,配置好静态IP

auto ens33
iface ens33 inet static
address 192.168.0.220
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1

2,重启虚拟机,遇到了第一个问题,虚拟机可以联网,可以ping通主机,但是主机ping不同虚拟机。

解决办法:

a,设置虚拟网络编辑器

但是,点击”确定“之后,再次打开虚拟网络编辑器,依旧看不到刚刚编辑的内容,不晓得有没有成功。

b,关闭windows防火墙,重启主机。问题解决。

备注:我用的笔记本,无线网卡,所以需要这么折腾。如果是有线的环境,选择桥接模式之后,就不会出现这个问题。

3,安装ssh,以保证ssh可以连接;重装vim,保证小键盘的上下左右键可以正常使用。命令如下:

sudo apt-get install openssh-server

sudo apt-get remove vim-common

sudo apt-get install vim

4,至此虚拟机基本环境搭建完毕。

5,设置虚拟机的本地时间(12.09更新)

date -R

可以查询出当前的时区。

sudo tzselect

用来选择当前的时区,一步一步选择:Asia、China、BeiJingTime(对应每一步的数字为4、9、1)

按照提示,将~/.profile中新增了两行

之后运行

sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

验证时间结果:date

搞定~

待优化:vim的显示风格

二,安装GitLab

网上的安装方式五花八门,但是我觉得最靠谱的还是官网给的方式

我就直接粘贴过来了:

1. Install and configure the necessary dependencies

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates


Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.

sudo apt-get install -y postfix


During Postfix installation a configuration screen may appear. Select 'Internet Site' and press enter. Use your server's external DNS for 'mail name' and press enter. If additional screens appear, continue to press enter to accept the defaults.

(备注:这里我输入的是“myGitlab”,应该是发邮件相关的,我没有配置邮件服务器。毕竟目前只有我一个人在用。)

2. Add the GitLab package repository and install the package

Add the GitLab package repository.

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
Next, install the GitLab package. Change `http://gitlab.example.com` to the URL at which you want to access your GitLab instance. Installation will automatically configure and start GitLab at that URL. HTTPS requires additional configuration after installation.

sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee


3. Browse to the hostname and login

On your first visit, you'll be redirected to a password reset screen. Provide the password for the initial administrator account and you will be redirected back to the login screen. Use the default account's username root to login.

See our documentation for detailed instructions on installing and configuration.

好了,至此,Gitlab也安装好了,直接在虚拟机上localhost访问,或者在主机上访问:gitlab.example.com,当然需要配置hosts。

备注:第一次访问页面,会出现一个设置新密码的界面,默认的用户名是:root。设置好密码之后,进入到登陆的页面,登陆进去之后,就好了。

明天再继续搞artifactory

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在虚拟安装GitLab,你需要进行一些准备工作和安装步骤。首先,你需要运行Windows 10专业版的VMware Workstation Pro。然后,你需要准备CentOS 7.x系列的ISO镜像文件和GitLab的下载地址文件。引用 接下来,你可以按照以下步骤进行GitLab安装: 1. 下载init脚本,并将其放置在/etc/init.d/gitlab目录下。你可以使用以下命令下载并设置权限:引用 ```sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/gitlab``` ```sudo chmod +x /etc/init.d/gitlab``` 2. 使用yum包管理器安装wget和vim:引用 ```yum -y install wget``` ```yum -y install vim``` 3. 下载GitLab安装包并进行安装。你可以使用以下命令从清华镜像站下载GitLab的最新版本: ```wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm``` 然后使用以下命令安装GitLab: ```rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm``` 完成以上步骤后,你就成功地在虚拟安装GitLab。接下来,你可以根据需要进行进一步的配置和使用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [虚拟搭建gitlab](https://blog.csdn.net/weixin_42904196/article/details/111559482)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [在虚拟安装Gitlab](https://blog.csdn.net/clshan/article/details/8448902)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值