安装和使用 ubuntu 服务器

2023-05-16

Ubuntu

  • 本地开发使用最好安装 ubuntu desktop 版本
  • 安装好后,先切换 apt source 为 阿里云mirror: http://mirrors.aliyun.com/ubuntu
  • ubuntu 网络工具是 ip, 远程登录需要开启ssh server,然后通过 ip address 中的ip地址进行登录

VPC 远程登录

  • 服务器开启 VNC server
sudo apt install tigervnc-standalone-server // server 端安装配置
vncpasswd // 设置密码
vncserver -localhost no // 开启 vnc 服务
vncserver -list // 查看启动结果
vncserver -kill :1 // 关闭 VNC 显示器
  • 客户端配置
    客户端可以选择 TigerNVC 客户端,也可以使用 realvnc 的客户端

    • realvnc 的客户端下载地址: https://www.realvnc.com/en/connect/download/viewer/linux/ ,然后连接 ip:5901
    • 在 https://github.com/TigerVNC/tigervnc/releases 下载 tigervnc 的客户端,然后连接 ip:5901
  • 参考:https://www.linuxrumen.com/rmxx/1871.html

卸载 Snap 商店

Snap 商店目前非必需产品,先卸载,后续有需求再安装

  • 参考:https://zhuanlan.zhihu.com/p/511438456
  • 当出现无法卸载 snap 中的core 时,参考 https://blog.csdn.net/a12355556/article/details/124323495
  • 下载PPA 软件仓库可能会很慢,感谢中科大代理PPA地址: launchpad.proxy.ustclug.org , https://www.jianshu.com/p/3a030350d2cd

安装中文输入法

  • 最新版本已经安装了 ibus, 然后安装输入法 sudo apt install ibus-libpinyin,再启用就好了, https://blog.csdn.net/sofa_r/article/details/126118363
  • 通过Keyboard - InputSource 来安装 Chinese(Intelligent Pinyin)输入法
  • 通过 Shift 切换中英文

在MAC 连接Ubuntu 机器的时候,需要在 Iterm2 中取消自动设置 locale 的配置:
Terminal -> Preferences -> Profiles -> Default>Terminal>Environment>Set locale

安装docker

  • 安装Docker: sudo apt install docker.io
  • 安装 docker-compose: sudo apt install docker-compose
  • Docker pull限速
    • Docker Hub 现在限制了pull 速度,https://docs.docker.com/docker-hub/download-rate-limit/?spm=a2c4g.11186623.0.0.19e6296aBu1Vud
    • 使用加速器有时候也会失败:https://help.aliyun.com/document_detail/60750.html
    • 根据官方说明,下次可以试一下 docker login之后的效果
    • 打印 Docker debug 日志。 在 /etc/docker/daemon.json 增加 "debug": true 参数,然后重启docker sudo systemctl restart docker,再查看 docker 日志: journalctl -u docker.service | vim -

安装 aria2 + ariang

version: "3"

services:
  ariang:
    image: hurlenko/aria2-ariang
    container_name: aria2-ariang
    ports:
      - 8081:8080
    volumes:
      - /home/kunwan/Downloads/aria2_data:/aria2/data
    #  - /etc/aria2:/aria2/conf
    environment:
      - PUID=1000
      - PGID=1000
      - RPC_SECRET=xxx
      - BASIC_AUTH_USERNAME=kunwan
      - BASIC_AUTH_PASSWORD=xxx
      - ARIA2RPCPORT=443
    restart: always

页面访问时,如果出现 authorization failed 问题,需要到 AriaNg -> RPC -> Aria2 RPC Secret Token 中重新设置一下RPC_SECRET

安装vscode

sudo dpkg -i code_1.62.0-1635954068_amd64.deb

NFS服务

安装配置 NFS

sudo apt install nfs-kernel-server

sudo vim /etc/exports

/Downloads/aria2_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check)
/Downloads/qbittorrent_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check)

配置选项说明

  • rw: This option gives the client computer both read and write access to the volume.
  • sync: This option forces NFS to write changes to disk before replying. This results in a more stable and consistent environment since the reply reflects the actual state of the remote volume. However, it also reduces the speed of file operations.
  • no_subtree_check: This option prevents subtree checking, which is a process where the host must check whether the file is actually still available in the exported tree for every request. This can cause many problems when a file is renamed while the client has it opened. In almost all cases, it is better to disable subtree checking.
  • no_root_squash: By default, NFS translates requests from a root user remotely into a non-privileged user on the server. This was intended as security feature to prevent a root account on the client from using the file system of the host as root. no_root_squash disables this behavior for certain shares.

Mac 连接

Finder -> Go -> Connect Server -> nfs://IP/Downloads/aria2_data

TFTP 服务

安装和配置 TFTP 共享目录以及权限

sudo apt-get install tftpd-hpa

chmod 777 tftp_data
sudo vim /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="tftp_data"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s" # 原本的--secure,替换成上面的-l -c -s,这里是选项,-c是可以上传文件的参数,-s是指定tftpd-hpa服务目录

然后重启 sudo systemctl restart tftpd-hpa 服务

客户端使用tftp

[1] tftp ${FTP_SERVER}
tftp> put b.txt
tftp> get a.txt

filebrowser 安装

mkdir -p /data/filebrowser
touch /data/filebrowser/filebrowser.db

注意

  • db 文件需要提前创建一个空文件
  • setting 文件不需要创建,直接使用默认的就可以
  • container启动后,使用 admin / admin 登录,然后修改密码

Docker 方式启动

sudo docker run \
    -v /home/kunwan/Download:/srv \
    -v /data/filebrowser/filebrowser.db:/database/filebrowser.db \
    -e PUID=$(id -u) \
    -e PGID=$(id -g) \
    -p 8080:80 \
    --restart=always \
    filebrowser/filebrowser:s6

Docker- Compose 方式启动

sudo UID="$(id -u)" GID="$(id -g)" docker-compose up -d

version: "2.0"
services:
  filebrowser:
    image: filebrowser/filebrowser:s6
    container_name: filebrowser
    restart: always
    volumes:
      - /home/kunwan/Downloads:/srv
      - type: bind
        source: /data/filebrowser/filebrowser.db
        target: /database/filebrowser.db
    ports:
      - 8083:80
    environment:
      - PUID=$UID
      - PGID=$GID

安装 Minidlna

sudo apt install minidlna
sudo vi /etc/minidlna.conf

# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
#   * "A" for audio    (eg. media_dir=A,/var/lib/minidlna/music)
#   * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
#   * "V" for video    (eg. media_dir=V,/var/lib/minidlna/videos)
#   * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera)
media_dir=/home/kunwan/Downloads
friendly_name=UbuntuDLNA
sudo service minidlna restart
sudo service minidlna force-reload

FC 游戏模拟器

sudo apt-get install fceux

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

安装和使用 ubuntu 服务器 的相关文章

  • Java中 判断String 是否为空的几种方法(null 、== 、equals)

    一 基本知识 String str1 61 null str1引用为空 xff0c 它没有地址 xff0c 它是一个没有被实例化的对象 String str2 61 34 34 str2引用为空字符串 xff0c 它有地址 xff0c 它是
  • C_INCLUDES must be under the source or output directories:

    https blog csdn net cigogo article details 94546032 参考了上面大神的链接 xff0c 发现设置了绝对路径 xff0c 改为相对路径后 xff0c 正常 编译报错 xff1a LOCAL P
  • Failed to connect to raw.githubusercontent.com port 443

    Mac 安装 homebrew xff1a 1 usr bin ruby e 34 curl fsSL https raw githubusercontent com Homebrew install master install 34 报
  • NFS配置及使用

    什么是NFS NFS Network File System 即网络文件系统 xff0c 是FreeBSD支持的文件系统中的一种 xff0c 它允许网络中的计算机之间通过TCP IP网络共享存储 在NFS的应用中 xff0c 本地NFS的客
  • 在idea中配置maven(阿里云镜像)

    1 下载maven 要使用maven当然要去下载 xff0c 可以去官网下载 xff0c 去官网下载需要自己配置 xff0c 这里可以使用我配置好的maven xff1b 链接 xff1a https pan baidu com s 1Zn
  • MTK6582资料帖和问题帖集合

    MTK6582资料帖汇总 Driver All in One V1 0 MT6572 MT6582 AOSP 发给需要的 MT6582memorydevicelist MT6582完整版DATASHEET xff0c xff1e 50M x
  • MYSQL笔记1

    MYSQL笔记 参照 MySQL数据库原理 设计与应用 清华大学出版社 第二章 数据库基本操作 2 1数据库操作 2 1 1创建数据库 create database if not exists xxx 2 1 2查看数据库 1 查看存在的
  • JetBrains学生认证

    1 首先找到JetBrains官网 JetBrains官网链接 2 找到学生申请页面 学生申请页面链接 3 选择申请方式 xff1a 官方文件 选择方式一共有四种 xff0c 较简单的是其中两种 xff0c 分别是大学电子邮箱地址和官方文件
  • Ubuntun18.04下载微信

    1 下载Wine环境包 xff1a http archive ubuntukylin com software pool partner ukylin wine 70 6 3 25 amd64 deb 2 下载微信 xff08 wine x
  • Java8使用Stream流实现List列表的查询、统计、排序、分组

    Java8提供了Stream xff08 流 xff09 处理集合的关键抽象概念 xff0c 它可以对集合进行操作 xff0c 可以执行非常复杂的查找 过滤和映射数据等操作 Stream API 借助于同样新出现的Lambda表达式 xff
  • MySQL的COUNT语句,竟然都能被面试官虐的这么惨!?

    关于数据库中行数统计 xff0c 无论是MySQL还是Oracle xff0c 都有一个函数可以使用 xff0c 那就是COUNT 但是 xff0c 就是这个常用的COUNT函数 xff0c 却暗藏着很多玄机 xff0c 尤其是在面试的时候
  • git为什么要先commit,然后pull,最后再push?而不是commit完直接push?

    情况是这样的 xff0c 现在远程有一个仓库 xff0c 分支就一个 xff0c 是master 然后我本地的仓库是从远程的master上clone下来的 大家都是clone下来 xff0c 再在自己本地改好 xff0c 再commit然后
  • docker将镜像上传到阿里云镜像仓库

    1 登录阿里云 username参数是阿里云账号 xff0c 执行后输入密码 注意后面登录的地区 beijing hangzhou等 docker login username 61 阿里云账号 registry cn hangzhou a
  • docker进入容器的方式

    进入容器 使用 d 参数时 xff0c 容器启动后会进入后台 进入容器进行操作 xff0c 包括使用 docker attach 命令或 docker exec 命令 xff0c 推荐用 docker exec 命令 attach 命令 实
  • Docker Hub 镜像加速器

    国内从 Docker Hub 拉取镜像有时很慢 xff0c 此时可以配置镜像加速器 Docker 官方和国内很多云服务商都提供了国内加速器服务 版本号 Ubuntu 16 04 43 Debian 8 43 CentOS 7 43 配置加速
  • FFmpeg将多张图片合成视频

    FFmpeg将多张图片合成视频从不同目录下多张图合成视频 PipeConcat 容易误解的几个命令 FFmpeg将多张图片合成视频 首先要计算出视频的总帧数 xff1a 总帧数 61 duration fps duration是我们设定的视
  • 程序员读书啦!!!

    成为Java顶尖程序员 xff0c 看这11本书就够了 xff1a http blog csdn net u012410733 article details 51869105 编程科普书籍推荐 xff1a http blog csdn n
  • win10系统隐藏u盘EFI分区的方法

    打开cmd或powershell xff0c 按如下命令行操作 xff08 以powershell示例 xff0c 及后面文字为注释内容不需要输入 xff09 xff1a diskpart 运行diskpart工具 lis dis 列出所有
  • hisat2-build

    The hisat2 build indexer 使用dna文件构建索引 xff0c 输出后缀为 1 ht2到 8 ht2的八个文件 如果索引较大 xff0c 后缀改为ht2l 后续的比对需要这八个文件 xff0c 并且一旦索引构建成功 x
  • Apache Tomcat 8.0.9下载、安装、配置和部署(不是最新版本)

    下载Apache Tomcat 8 0 9 登陆Apache Tomcat官网http tomcat apache org 找到左边导航栏的Download目录下的Tomcat 8 0 点击进去之后选择Quick Navigation下的A

随机推荐