Home Categories About RSS

Arch Server的极简搭建记录

这是一篇对于我的服务器搭建过程的记录,至于为什么服务器还用Arch Linux,那确实是个好问题,大概是用习惯了吧。

系统安装

cfdisk
mkfs
mount
/mnt/boot
/mnt/hd
reflector --latest 5 --country China --protocol https --sort rate --save /etc/pacman.d/mirrorlist
pacstrap -K /mnt base base-devel linux linux-firmware linux-headers vim intel-ucode openssh efibootmgr dhcpcd
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
vim /etc/locale.gen
locale-gen
vim /etc/locale.conf
vim /etc/hostname
passwd
blkid
efibootmgr -d /dev/nvme0n1 -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=PARTUUID=根目录的PARTUUID rw initrd=intel-ucode.img initrd=\initramfs-linux.img"
reboot

首次登陆

start&enable dhcpcd
useradd -m -G wheel 用户名
passwd 
EDITOR=vim visudo
vim /etc/systemd/system.conf
DefaultTimeoutStopSec=30s
systemctl daemon-reload
sshd:禁止root登陆,禁止密码登陆,上传公钥
[archlinuxcn]
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
archlinuxcn-keyring
alias

软件的安装配置

sudo pacman -S yazi ffmpeg p7zip jq poppler fd ripgrep fzf zoxide imagemagick
neofetch,s-tui,stress
v2raya关闭透明代理,使用routea
/etc/environment
http_proxy=http://0.0.0.0:20172
https_proxy=http://0.0.0.0:20172
sudo pacman -S docker docker-compose
sudo pacman -S bash-completion
sudo systemctl start docker.service
docker compose contains
sudo mkdir -p /etc/systemd/system/docker.service.d
/etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:3128"
Environment="HTTPS_PROXY=https://proxy.example.com:3129"
frp&systemd frp
vultr nginx
genstatus.sh service timer nginx 50002