0%

腾讯云操作笔记

云服务器

配置

1
2
3
4
配置: 标准型 SA2/1 核/2GB/1Mbps
硬盘: 高效云硬盘/50GB
地区: 广州三区
操作系统: Ubuntu Server 20.04 LTS 64 位

基本操作

更新

1
2
3
# 别的啥也不干,也不用换源(默认 tencentyun 源)先更新
sudo apt update
sudo apt upgrade

用户

1
2
3
4
5
6
7
8
# 初始用户:ubuntu
# 添加用户
sudo useradd -s /bin/bash -d /home/user_name -m user_name
passwd user_name
# sudo visudo
# User privilege specification
root ALL=(ALL:ALL) ALL
user_name ALL=(ALL:ALL) ALL
  • Ctrl + o
  • Enter
  • Ctrl + c
  • Ctrl + x

hostname

1
sudo vi /etc/hostname

相关服务

  • ssh
  • git
1
2
3
git config --global user.name {user_name}
git config --global user.email {user_name}@email.com
ssh-keygen -t rsa -C "{user_name}@email.com"
  • python
1
2
3
4
5
pip config set global.index-url https://pypi.douban.com/simple
sudo apt install python3.8-venv

python -m venv project_venv # 创建虚拟环境,project_venv 为虚拟环境名字
source ./project1_venv/bin/activate # Linu

redis

1
2
sudo apt install redis-server
redis-cli

mysql

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo apt install mariadb-server -y

# 创建密码
sudo mysql_secure_installation
# 登录
sudo mysql -u root -p
# 创建数据库
CREATE DATABASE icstos;
# 创建用户
CREATE USER icstos IDENTIFIED BY 'icstos9%9'
CREATE DATABASE icstosdb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
GRANT ALL PRIVILEGES ON icstosdb.* TO 'icstos'@'%';
# 刷新权限
flush privileges;
1
2
3
4
# 开放远程连接
# sudo vi /etc/mysql/mariadb.conf.d/50-server.conf
# 注释下面这
bind-address =127.0.0.1

supervisor

1
2
3
4
5
6
7
sudo apt install supervisor

sudo systemctl enable supervisor
sudo systemctl start supervisor

sudo supervisorctl status

git 库

1
2
3
4
mkdir bk
mkdir bk/_posts
cd bk/_posts
git init --bare

http://{服务器 IP}:8888

70\71\72

安装 PHP运行环境:苹果 CMS 需要 70、71、72 版本,安装 PHP-7.2

数据库名:video_{user_name}_com

用户:video_{user_name}_com

密码:

mediacms

手动下载 FFMPEG
在本地电脑上,下载 FFMPEG。使用 FileZilla 上传到阿里 云服务 器。

1
2
3
4
mkdir -p tmp
tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components 1 -C tmp
sudo cp -v ./tmp/{ffmpeg,ffprobe,qt-faststart} /usr/local/bin
rm -rf ./tmp ffmpeg-release-amd64-static.tar.xz

使用 FileZilla 打开 mediacms 文件夹下的 install.sh 文件,找到 ffmpeg 部分,即:

1
2
3
4
5
6
7
8
# install ffmpeg
echo "Downloading and installing ffmpeg"
wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
mkdir -p tmp
tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components 1 -C tmp
cp -v tmp/{ffmpeg,ffprobe,qt-faststart} /usr/local/bin
rm -rf tmp ffmpeg-release-amd64-static.tar.xz
echo "ffmpeg installed to /usr/local/bin"

运行 bash ./install.sh

给博主来一杯卡布奇诺