Bourne Shell —> bsh
Bourne Again Shell —> bash
命令 --help—> 获得命令的帮助
man 命令 —> 查看命令的手册
clear - 清除屏幕输出
history - 历史命令 —> !命令编号 —> 再次执行命令 -c:清除历史命令
who / w - 查询接入的用户
whoami - 查看当前用户的用户名
cal / date - 日历 / 日期时间
exit / logout - 退出登录
shutdown - 关机或重启
man - manual - 查看命令的帮助手册
whatis - 查看命令的描述信息
whereis / which - 查看命令对应的路径
pwd - print working directory - 打印工作目录
cd- change directory - 切换目录
- 绝对路径
- 相对路径
- ls- list directory contents - 列出目录下的内容
-l:长格式
-a:所有文件
mkdir - make directory - 创建文件夹
-p:自动创建父文件夹
- cp / mv - copy / move - 复制/移动文件
-r:递归式
rm - remove - 删除
-r:递归式
-f:强制
-i:交互式
cat - concatenate - 连接多个文件(显示文件内容)
-n:行号
gzip / gunzip - 压缩和解压缩
tar - 归档和解归档
wget - 网络下载器
下载搜狐首页:wget https://www.sohu.com/
CentOS / Redhat:yum / rpm
Ubuntu:apt / apt-get
搜索:yum search nginx
安装:yum install -y nginx
更新:yum update -y nginx
卸载:yum erase -y nginx/ yum remove -y nginx
查看信息:yum info nginx
查看所有安装过的包:yum list installed
安装:rpm -ivh 软件包文件
卸载:rpm -e 软件包名字
查看:rpm -qa | grep mysql
参见实例2和3
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.34-1.el7.x86_64.rpm-bundle.tar
mkdir mysql
tar -xf mysql-5.7.34-1.el7.x86_64.rpm-bundle.tar -C mysql
cd mysql
yum erase -y mariadb-libs
yum install -y libaio libaio-devel
rpm -ivh mysql-community-common-5.7.34-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.34-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.34-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.34-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.34-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.34-1.el7.x86_64.rpm
systemctl start mysqld
cat /var/log/mysqld.log | grep password
mysql -u root -p
mysql> alter user 'root'@'localhost' identified by 'Guest.618';
如果使用CentOS 8.x,需要调整以下两个步骤:
yum install -y perl
不需要安装mysql-community-libs-compat-xxx包
wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
gunzip Python-3.8.10.tgz / xz -d Python-3.8.10.tar.xz
tar -xf Python-3.8.10.tar
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libdb4-devel libpcap-devel xz-devel libffi-devel libxml2
gcc --version
make --version
如果没有就安装:`yum install -y gcc`
如果有执行更新:`yum update -y gcc`
cd Python-3.8.10
./configure --prefix=/usr/local/python38
make && make install
cd ~
vim .bash_profile
PATH=...:/usr/local/python3/bin
Esc ---> :wq(进入末行模式,保存退出)
python3 --version
pip3 --version
ln -s /usr/local/python38/bin/python3 /usr/bin/python3
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.32.0.tar.xz
xz -d git-2.32.0.tar.xz
tar -xvf git-2.32.0.tar
yum install -y curl libcurl libcurl-devel
cd git-2.32.0
./configure --prefix=/usr/local/
make && make install
git --version
- **进入编辑模式:i / o / a**
- **进入末行模式:: (冒号)**
- 移动光标:h j k l / G gg / w / 0 $
- 翻页:Ctrl+f / Ctrl+b
- 翻行:Ctrl+e / Ctrl+y
- 删除:dd / d0 / d$ / dw
- 复制/黏贴:yy / p
- 撤销/恢复:u / Ctrl+r
- 保存退出:ZZ
- 回到命令模式:Esc
- 替换:1,$s/新闻/news/cgi c - confirm g - global i - ignore case
- 退出:q / qa / q!
- 保存:w / w! / w hello.py
- 保存退出:wq
- 显示行号/隐藏行号:set nu / set nonu
- 语法高亮:syntax on / syntax off
- 自动缩进:set autoindent
- 设置制表键(Tab)的空格数:set ts=4
- 将制表键转成空格:set expandtab
启动:systemctl start nginx
停止:systemctl stop nginx
重启:systemctl restart nginx
查看状态:systemctl status nginx
开机启动:systemctl enable nginx
禁用自启:systemctl disable nginx
启动:systemctl start mysqld
停止:systemctl stop mysqld
重启:systemctl restart mysqld
服务器是我在阿里云上买的,注意是Centos7.
git clone https://gitee.com/wenhaha8/data_viz_2103.git
systemctl start mysqld
mysql -u root -p < /root/data_viz_2103/order.sql
mysql -u root -p < /root/data_viz_2103/stock.sql
mysql -u root -p
mysql> create user 'guest'@'localhost' identified by 'Guest.618';
mysql> grant select on stock.* to 'guest'@'localhost';
mysql> grant select on data_viz.* to 'guest'@'localhost';
user root;
http {
server {
root /root/data_viz_2103/static;
}
}
systemctl start nginx
systemctl restart nginx
export DB_USER=guest
export DB_PASS=Guest.618
gunicorn -w 4 -b 127.0.0.1 main:app
vim /etc/nginx/nginx.conf
http {
server {
location /api/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
改了配置文件,别忘了重启服务!!QAQ!!
systemctl restart nginx
购买安全证书
修改Nginx的配置文件 —> vim /etc/nginx/nginx.conf
http {
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
ssl_certificate /root/cert/python-jack.pem;
ssl_certificate_key /root/cert/python-jack.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /root/data_viz_2103/static;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location /api/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
最后别忘了:重启Nginx服务器:systemctl restart nginx
如果大家有任何问题或者想和我交流,请评论或者私信我噢 !
求个赞!我只会心疼giegie!