网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
二.debian的安装
1.新建虚拟机
2.进入安装界面
3.配置网络
4.设置用户名和密码
5.磁盘分区
6.配置软件包管理器
问题及反思
1.解决root用户没法连接xshell的问题
systemctl restart sshd
2.在安装的时候不配置网络速度会更快,
1)中途退出安装重新安装的方法
按F10,再次进入安装界面,配置网络那里选择”现在不进行网络配置“
2)进行网卡配置
vim /etc/network/interfaces
#The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.2
ifup eth0
3)配置dns
vim /etc/resolv.conf
search unassigned-domain
nameserver 10.0.0.2
4)连接网卡
5)启动网络
/etc/init.d/networking restart
三.debian配置
1.更新软件源
https://mirrors.tuna.tsinghua.edu.cn/help/debian/
root@debian:~# vi /etc/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free
root@debian:~# apt install apt-transport-https
root@debian:~# apt-get update
2.安装常用软件
root@debian:~# apt-get install vim lsof tree -y
3.使用ll命令
root@debian:~# vim .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
打开这一行:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
打开这一行:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
root@debian:~# source .bashrc
4.创建用户
root@debian:~# useradd lbzy
root@debian:~# mkdir /home/lbzy
root@debian:~# chown -R lbzy:lbzy /home/lbzy
root@debian:~# vim /etc/passwd
lbzy:x:1001:1002::/home/lbzy:/bin/sh
把这一行改为
lbzy:x:1001:1002::/home/lbzy:/bin/bash
root@debian:~# su - lbzy
lbzy@debian:~$
原因:
在centos7中:[root@web01 ~]# ll /bin/sh
lrwxrwxrwx. 1 root root 4 Nov 16 04:49 /bin/sh -> bash 软链接是直接到bash
在debian中:root@debian:~# ll /bin/sh
lrwxrwxrwx 1 root root 4 11月 8 2014 /bin/sh -> dash
5.配置仓库
5.1 环境准备
服务端:debian-100 ip地址:10.0.0.100
客户端:debian-200 ip地址:10.0.0.200
5.2 安装部署nginx
在服务端:
root@debian-100:~# vim /etc/nginx/nginx.conf
user www; #修改这一行
#include /etc/nginx/sites-enabled/* #删除这一行
mail ... #删掉mail后面的部分
root@debian-100:~# groupadd www -g 888
root@debian-100:~# useradd www -u 888 -g 888 -M -s /sbin/nologin
root@debian-100:~# mkdir -p /data/mydeb/
root@debian-100:/etc/nginx/conf.d# cat > /etc/nginx/conf.d/apt-deb.conf<<EOF
> server {
> listen 8080;
> server_name localhost;
> autoindex on;
> location / {
> index index.html index.htm;
> root /data/mydeb/;
> }
> }
> EOF
root@debian-100:~# chown -R www:www /data/
root@debian-100:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@debian-100:~# systemctl restart nginx(因为默认已经启动,所以这里必须使用restart)
访问成功:
http://10.0.0.100:8080
5.3 搭建仓库
服务端搭建仓库:
root@debian-100:/etc/nginx/conf.d# apt-get clean
root@debian-100:~# apt-get install -d screen
root@debian-100:~# apt-get install -d curl
root@debian-100:~# apt-get install -d wget
在官网查找https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
安装依赖:
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
添加软件仓库:
add-apt-repository \ "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \ $(lsb_release -cs) \ stable"
查看:
root@debian-100:~#apt-get update
root@debian-100:~#apt-get install -d docker-ce #-d只下载不安装
root@debian-100:~# tree /var/cache/apt/archives/
root@debian-100:~# mv /var/cache/apt/archives/ /data/mydeb/
### 最后的话
最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!
### 资料预览
给大家整理的视频资料:
![](https://img-blog.csdnimg.cn/img_convert/0c4da7085606e647e4201d2560066382.png)
给大家整理的电子书资料:
![](https://img-blog.csdnimg.cn/img_convert/418d6dfa8568ade4e972e45975e6b773.png)
**如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!**
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618635766)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
D7BZg0uo-1715714111894)]
**如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!**
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618635766)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**