1.源下载地址:http://mirrors.aliyun.com/ubuntu-releases/
2.在虚拟机上安装完后
(1)查看IP地址:ifconfig
(2)SercureCRT上连接,提示“The remote system refused the connection.”
没安装ssh,安装ssh:apt-get install ssh
查看ssh进程是否存在:ps -e |grep ssh
安装完后,SercureCRT就能连接上了。
(3)查看安装了什么软件:dpkg -l
(4)取得超级权限:sudo nsenter -t 0
3.安装docker容器:apt-get install docker
没安装 成功,应该这样安装
apt-get install docker.io
运行docker:service docker start
4.安装smaba
apt-get install samba
配置文件目录:/etc/samba/smb.conf
(1)备份配置文件: cp smb.conf smb.conf.bak
(2)配置文件:vim /etc/samba/smb.conf
在最后面添加:
security=share
[share]
comment=this is Linux share directory
path= /sharewindow
public=yes
writeable = yes
guest ok = yes
create mask = 0777
directory mask = 0777
(3)启动服务:/etc/init.d/samba start
(4)关于Windows下无写权限:chmod -R go+rwx share/
还有一种情况,在没有添加samba用户时也有可能“无写权限,这时我们添加用户:
smbpasswd -a 用户
重启samba服务:/etc/init.d/smbd restart
配置文件写成以下:
[global]
security = user
[stack]
comment = This is a share directory.
path = /var/www
public = no
valid users = root, ubuntu
writable = yes
create mask = 0644
directory mask = 0755
登录里会显示用户名和密码错误,是因为没有激活用户。用以下命令激活:
smbpasswd -a username
smbpasswd -e username
5.apt-get install 安装软件太慢了
更新源:
(1)备份: cp /etc/apt/sources.list /etc/apt/sources.list.old
(2)添加资源地址:
vi /etc/apt/sources.list
写入:
deb http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ quantal main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ quantal-updates universe main multiverse restricted
下面的源地址才快(Ubuntu 16.04 LTS国内快速更新源):
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
(3)更新: sudo apt-get update
6.vim命令:
gg:跳到第一行
/查找的内容:向下查找;n:继教往下找
shift+g:跳到最后一行
7.owncloud镜像安装
(1)导入镜像:vcmyCloud_v9.0.2.tar |docker import - vcloud:v9.0.2
上面导入失败,由size=0B可以看出
用:docker load --input vcmycloud_v9.0.2.tar导入周样报错:
用:cat vcmycloud_v9.0.2.tar | docker import - vcloud:9.0.2导入成功:
(2)删除镜像:docker rmi
(3)生成容器
docker run -d -p 80:80 --name vcloud --hostname vcloud vcloud:9.0.2 /bin/sh -c 'supervisord'
映射到容器外的文件夹上:
docker run -d -p 8080:80 -v /sharewindow/vcloud:/var/www/vcmycloud --name vcloud1 --hostname vcloud1 vcloud:9.0.2 /bin/sh -c 'supervisord'
映射之后发现文件夹没有内容,在另外一个没映射的容器里复制代码到这个文件夹下:
scp -r * vcmy@192.168.168.130:/sharewindow/vcloud
(如果用不到scp,就是没有装ssh)
(4)命令下载
下载.bashrc_docker,并将内容放到 .bashrc 中
wget -P ~ https://github.com/yeasy/docker_practice/raw/master/_local/.bashrc_docker; echo "[ -f ~/.bashrc_docker ] && . ~/.bashrc_docker" >> ~/.bashrc; source ~/.bashrc
这个文件中定义了很多方便使用 Docker 的命令,例如 docker-pid
可以获取某个容器的 PID;而 docker-enter
可以进入容器或直接在容器内执行命令。
(5)进入容器:
docker-enter 0335f4a3353a