demo搭建---环境配置02

2.网络配置

1) 配置静态ip

实现ping一下待使用的ip,然后使用如下命令进行修改:

auto enp0s3
iface enp0s3 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.1

最后使用如下命令

sudo /etc/init.d/networking restart

2)配置访问外网

把VM setting下的network选项改成网桥模式

3)配置某个端口可以被外部访问

sudo iptables -I INPUT -p tcp --dport 1250 -j ACCEPT

sudo iptables-save

sudo netfilter-persistent save(这时如果提示无法识别netfilter-persistent命令,使用sudo apt-get install

netfilter-persistent 进行安装即可)

sudo netfilter-persistent save

sudo netfilter-persistent reload

4) 使用git 命令上传code

a.首先保证VM能够访问外网:给每个VM配置两块网卡,第一块是NAT,第二块是host-only,其中,host-only需要在VB中设置一下。

b. 使用sudo apt-get install git 安装git

c. 首次上传project

 (1)定位到project所在的文件夹,然后使用 git add . 创建local 仓库。

 (2)使用命令git commit -m "description"

   (3) git remote add origin "remote repository URL"

    (4) git remote -v #测试一下URL

    (5) git push origin master # 完成上传

d. 更新project

   (1)  git add.

    (2) git commit -m "xxx"

    (3) git push origin master

3. VM安装mysql

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04

具体而言:

sudo apt install mysql-server

1) 首先使用system status mysql.service 查看mysql服务是否启动;如未启动,使用sudo systemctl start mysql.

2) 使用navicat连接mysql

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值