因为公司需要在阿里云上部署一套致远互联的OA平台,该OA需要在图形界面下进行安装部署。为此,我将构建基础平台的过程纪录一下。

2024.12 天津·西青·中北镇·水西公园

商务准备

配置确认

  1. 与厂家确认所需服务器配置和地域要求
  2. 切合当前已有阿里云上环境,拉取配置表及所需费用,并申请相关优惠卷

合规处理

  1. 完成内部预算申请,在阿里云后台下载购买合同并交付需求提交方
  2. 购买完成之后,将本次购买发票提交需求方

主机准备

基础配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 系统使用RockyLinux9.5
# 系统更新
dnf update -y
# 安装常用软件
dnf install -y wget curl zip unzip vim mailx mlocate telnet bash-completion tmux
dnf install -y chrony rsync git screen tree open-vm-tools yum-utils lrzsz
dnf install -y device-mapper-persistent-data lvm2 psmisc net-tools
dnf install -y bind-utils yum-utils python3-dnf-plugin-versionlock
dnf install -y lnav nc lsof ncdu dstat git
dnf remove -y podman*
updatedb

# 安装EPEL
dnf install -y epel-release
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
dnf makecache
dnf update -y

# 开启网络BBR模块
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

echo "net.ipv4.tcp_fin_timeout = 30" >> /etc/sysctl.conf
echo "net.ipv4.tcp_keepalive_time = 1800" >> /etc/sysctl.conf
echo "net.ipv4.tcp_window_scaling = 0" >> /etc/sysctl.conf
echo "net.ipv4.tcp_sack = 0" >> /etc/sysctl.conf
echo "net.ipv4.tcp_timestamps = 0" >> /etc/sysctl.conf

sysctl -p

# 调整SWAP使用策略
echo vm.swappiness = 10 >> /etc/sysctl.conf

# 打开连接数限制
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "root hard nofile 65535" >> /etc/security/limits.conf
echo "root soft nofile 65535" >> /etc/security/limits.conf

# 配置防火墙
firewall-cmd --permanent --add-port={http,https,ssh}
firewall-cmd --reload

安装图形

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 安装桌面图形组件
dnf groupinstall "Server with GUI" -y
systemctl enable --now gdm
systemctl set-default graphical.target

# 禁用打印服务
systemctl disable --now cups.service

# 安装远程桌面
dnf install -y xrdp
systemctl enable --now xrdp

# 开启防火墙端口
firewall-cmd --permanent --add-service=rdp
firewall-cmd --reload

# 配置rdp链接gnome
echo "exec gnome-session" >> /etc/xrdp/xrdp.ini
systemctl restart xrdp

附加配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 添加swap
dd if=/dev/zero of=/swapfile bs=1024 count=2048k
mkswap /swapfile
chmod 0600 /swapfile
swapon /swapfile

echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
systemctl daemon-reload

# 挂载数据盘
pvcreate /dev/vdb
vgcreate vg_data /dev/vdb
lvcreate -l 100%free -n lv_data vg_data
mkfs.xfs /dev/vg_data/lv_data

mkdir /data
echo "/dev/mapper/vg_data-lv_data /data xfs defaults 0 0" >> /etc/fstab
systemctl daemon-reload
mount -a

# 重启服务器
systemctl reboot

其他配置

  1. 添加CLB的端口映射
  2. 添加DNS解析
  3. 配置RDS的连接