Centos 环境搭建
yum 相关操作 doc
#1 yum 升级更新
#1.1 检查更新更新
yum check-update
#1.2 yum 更新
yum -y update
#1.3 升级所有包同时也升级软件和系统内核
yum update
#1.4 只升级所有包,不升级软件和系统内核
yum upgrade
#2 yum清空缓存列表
#2.1清除缓存目录下的软件包,清空的是(/var/cache/yum)下的缓存
yum clean packages
#2.2清除缓存目录下的 headers
yum clean headers
#2.3清除缓存目录下旧的 headers
yum clean oldheaders
#2.4 清除缓存目录下的软件包及旧的headers(= yum clean packages; yum clean oldheaders)
yum clean, yum clean all
#3 yum显示信息
# 3.1显示所有已经安装和可以安装的程序包
yum list
yum list installed
#这些列表里面的包的来源就是/etc/yum.repo.d。 base docker-ce-stable epel/x86_64/metalink epel extras rpmforge updates
#3.2显示安装包信息rpm
yum list rpm
#3.3显示安装包rpm的详细信息
yum info rpm
#4 yum安装
yum -y install httpd
#5 yum删除
#5.1 删除程序包httpd ,也就是卸载。
yum remove httpd
#5.2查看程序rpm依赖情况
yum deplist rpm
安装yum-utils
# 优先安装yum-utils
sudo yum install -y yum-utils
nginx 安装和管理
-
安装
#安装nginx 和 git
yum install git nginx -y -
校验配置:
nginx -t
-
启动:
nginx
-
重启:
sudo nginx -s reload
sudo service nginx restart
sudo systemctl start nginx
sudo systemctl restart nginx
systemctl status nginx.service
ps aumx|grep nginx
sudo kill 30443
sudo killall nginx
redis 安装和管理
-
安装
#安装redis
yum info redis
yum install redis -
配置
vi /etc/redis.conf
-
启动和关闭:
systemctl start redis
systemctl stop redis
php安装和管理:
安装php
-
安装来源:Remi 软件源
Remi 软件源 主要提供最新版的 PHP 软件包和其他一些 PHP 扩展工具包,它是针对 Fedora 和 RHEL 系分支变体 (包括:RHEL, CentOS, Oracle Linux 等等) 要安装 PHP,推荐使用 Remi 软件源。
-
安装 EPEL 源及源管理工具
# 如果没有安装yum-utils 需要安装 yum utils
yum install epel-release -
安装remi源
# 最新资源库:remi-release-8.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-8.rpm -
安装php及扩展
# php以及常用的扩展
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap -
校验安装
# 查看版本
php73 -v
# 查找安装插件信息
php73 -i |grep mysql
php73 -i |grep memcached
php73 -i |grep redis -
安装更多的扩展
# 查找扩展
yum search php73 |grep redis
# 安装扩展
yum install php73-php-pecl-redis5
yum install -y php73-php-xml
配置和启停 php
-
相关文件地址
#查找php.ini位置:
find /etc/opt/remi/php73 -name php.ini
# The current PHP memory limit is below the recommended value of 512MB.
vi /etc/opt/remi/php73/php.ini
memory_limit = 128
#如果你运行的是 nginx 而不是 apache,修改php-fpm.d/www.conf 文件
vi /etc/opt/remi/php73/php-fpm.d/www.conf
user = apache
group = apache
# 配置user & user group
user = nginx
group = nginx
# 配置listen
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
# 留意nginx fastcgi_pass
listen = /var/opt/remi/php73/run/php-fpm/www.sock
# 进程模式:static=静态模式 用于高负荷,会创建max_children的线程池; dynamic=动态模式 根据请求多少创建线程数量
pm = dynamic
pm.max_children = 100
pm.max_requests = 500
#重启php-fpm
#检查文件权限 /var/opt/remi/php73/run/php-fpm/www.sock
83942285 srw-rw----+ 1 root root 0 1月 23 20:45 www.sock
#发现读写权限给了root 所以提示没有权限 需要把权限给nginx用户
chown nginx: www.sock
#查找 php 和扩展的安装包:
rpm -qa | grep 'php'
#查看 php73-php-pecl-swoole4-4.4.15-1.el7.remi.x86_64 的安装路径:
rpm -ql php73-php-pecl-swoole4-4.4.15-1.el7.remi.x86_64
# 将php73链接到系统环境变量中,就可以使用 php -v
ln -s /opt/remi/php73/root/usr/bin/php /usr/bin/php
# 将 cgi.fix_pathinfo 设置为 0
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
# 关于 cgi.fix_pathinfo 选项请查看(https://taobig.org/?p=650)
# 潜在的漏洞风险,关于安全隐患的问题可查看(http://www.laruence.com/2010/05/20/1495.html) -
重启命令:
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
composer 安装和管理
-
检查相关依赖是否安装|没有需要安装
#需要的依赖有:yum install php-cli php-zip wget unzip
yum info wget
yum info php-zip
yum info unzip
yum search php73 |grep zip #发现没有安装php-zip
yum install php73-php-pecl-zip #安装php-zip
yum search php73 |grep cli -
安装
#1 下载composer installer script
php73 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
#2 验证下载文件面md5 —— 可以省略
HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
#3 安装
php73 composer-setup.php --install-dir=/usr/local/bin --filename=composer
#4 检查安装结果
composer -v
# 如果提示“/usr/bin/env: “php”: 没有那个文件或目录” 需要执行第五步
#5 将php73 link到系统的php
ln -s /opt/remi/php73/root/usr/bin/php /usr/bin/php
-
composer update时需要git access token
#Your GitHub credentials are required to fetch private repository metadata (git@github.com:s/s-message-sdk.git)
#Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+iZm5e5rmf8lyj4kr3w1nwsZ+2021-01-23+1010
#to retrieve a token.
daf3d0e3122c6f60cfd17b73b695394c781b141b
MariaDB
MariaDB安装和基础配置
#1 查看并安装mariadb
yum info mariadb-server
yum install mariadb-server
#2 启动mariadb
systemctl start mariadb.service
#3 检查数据库
#3.1数据库数据 所在目录
cd /var/lib/mysql/mysql
ls #查看数据表文件是否创建好
#3.2命令行连接数据库
/usr/bin/mysql -u root mysql
show tables; #查看数据表
exit; #退出
#4 数据库安全设置
# 数据库用户安全配置命令
mysql_secure_installation
# 注意:如果是配置root账户 需要sudo
sudo mysql_secure_installation
# 1 数据库用户密码 初始密码为空,直接按回车
Enter current password for root (enter for none):
OK, successfully used password, moving on
# 2 是否允许系统用户直接登录 新增功能,输入“n”
Enable unix_socket authentication? [Y/n] n
... skipping.
# 3 修改root用户密码 y
Change the root password? [Y/n] y
New password: # 输入新密码
Re-enter new password: # 再次输入新密码
Password updated successfully!
# 4 删除anonymous用户 y
Remove anonymous users? [Y/n] y
... Success!
# 5 是否禁止远程登录 y 注意 如果是需要通过root远程登录选择 n
Disallow root login remotely? [Y/n] y
... Success!
# 6 删除测试数据库 y
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
# 7 重新加载权限表 y
Reload privilege tables now? [Y/n] y
... Success!
#5测试登录
mysql -uroot -p
MariaDB用户配置和远程连接
#1 在sequel pro 用root账户 + SSH 连接 数据库
#2 通过add database 添加数据库
#3 在sequel ace 用root账户+ssh连接数据库
#4 cmd+u 创建新用户
#5 为新用户添加ip外网地址白名单
#6 通过本地命令行远程连接测试新用户
mysql -h120.27.27.208 -ubbtoo_core -pwED37nDhzU2JflDx
docker 安装和配置
docker 安装
#1 安装yum-utils
sudo yum install -y yum-utils
#2 添加docker版本库
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
#3 安装docker
sudo yum install docker-ce docker-ce-cli containerd.io
# Total download size: 89 M
# Installed size: 369 M
Is this ok [y/d/N]: y
# Importing GPG key 0x621E9F35:
# Userid : "Docker Release (CE rpm) <docker@docker.com>"
# Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
# From : https://download.docker.com/linux/centos/gpg
Is this ok [y/N]: y
#4 启动docker
sudo systemctl start docker
#5 测试docker
sudo docker run hello-world
#6 删除docker
sudo yum remove docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
docker常用命令
#1 查看镜像
docker images
#2 查看容器
docker ps
#3 查看所有容器
docker ps -a
#4 启动容器
docker start 8978e4a8f620
#5 进入容器
docker attach 8978e4a8f620
#6 删除容器:
docker rm container_id
docker rm container_name
#7 删除所有容器:
docker rm $(docker ps -a -q)
#8 删除镜像:
docker rmi image_id
docker rmi image_name
#9 删除所有镜像:
docker rmi $(docker ps -a -q)
docker exec
#1 进入容器环境: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
docker exec -it ubuntu_bash bash
docker exec -it 52d630cd71c404214e9390872a83f5e225ffed36ce24f2e34320ce4483476f8f /bin/sh; exit
安装docker-compose
#1 通过镜像安装
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#2 改为可执行程序
sudo chmod +x /usr/local/bin/docker-compose
#3 检查安装是否成功
docker-compose --version
安装docker image和启动
#1 安装image
docker-compose build
#2 安装容器并启动docker
docker-compose up
#3 启动docker
docker-compose start
#4 停止docker
docker-compose stop
代理设置(暂时的)
#1 开启代理
export http_proxy=127.0.0.1:1087
export https_proxy=127.0.0.1:1087
#2 关闭代理
unset http_proxy
unset https_proxy
git代理设置(长期的)
#1 查看全局配置
git config --global --list
#2 设置
git config --global http.proxy http://127.0.0.1:1087
git config --global https.proxy https://127.0.0.1:1087
#3 取消设置
git config --global --unset http.proxy
git config --global --unset https.proxy
文件管理
缓存文件夹清理(s-store/tmp为例)
#1 将tmp中超过15天的文件 移动到 s-store-copys/tmp文件夹中命令:
cd /xxx/xxx/s-store/tmp
sudo find ./ -name "*.png" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
sudo find ./ -name "*.jpg" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
sudo find ./ -name "*.jpeg" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
sudo find ./ -name "*.PNG" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
sudo find ./ -name "*blob" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
sudo find ./ -name "*.JPG" -mtime +15 -exec mv {} ../../s-store-copys/tmp \;
打包压缩
-
压缩单个文件:
tar -zcvf log.tar.gz 20_02_17Log.log
-
压缩批量文件:
#1. 将3天以外的log 移动到history
sudo find ./ -maxdepth 1 -name "*.log" -mtime +3 -exec mv {} history \;
#2. 去到history
cd history/
#3. 压缩打包
tar -zcvf 20200117_20200215log.tar.gz *.log
#4. 删除history中的log
rm -rf *.log
#5. 查看剩余空间
df -h
批量移动/删除文件:
#1 删除60天之外的所有.log文件:
sudo find ./ -maxdepth 1 -name "*.log" -mtime +60 -exec rm -rf {} \;
#2 find 命令
# 当前目录下 .log 结尾的文件: ./ -name "*.log"
# 60天之外的: -mtime +60
# 对查找结果 执行的操作: -exec rm -rf {} \
#3 移动15天之外的日志:
sudo find ./ -maxdepth 1 -name "*.xls" -mtime +7 -exec mv {} history \;
sudo find ./ -maxdepth 1 -name "*.log" -mtime +15 -exec mv {} ./histories \;
find 命令介绍:mac 显示隐藏文件+Find命令
移动、复制、删除
mv k-store k-store.bak
mv k-store.20180727 k-store
rm -rf node_modules
cp k-api k-api.20180730 -r
cp -r s-api copy-s-api/s-api-0701
空间查看
#1 centos 查看文件可用空间:
df -h
#2 查看当前目录文件夹大小:
du -h --max-depth 1
#3 查看当前文件列表大小:
ls -lh
权限更改
- centos 查看文件可用空间:
df -h
- 查看当前目录文件夹大小:
du -h --max-depth 1
- 修改文件的用户属性:
chown www-data: *.xml
文件上传下载
#1 远程下载文件:
scp -P22 centos@52.74.1xx.1xx:/xxx/xxx/s-pay/logs/k_call.log ~/Downloads/k-call.log
scp -P22 centos@s-cpanel:/xxx/xxx/xxx/s-cpanel.access.log-20190318.gz ~/Downloads/cpanel.log-0318.gz
#2 远程下载文件夹
scp -r -P22 centos@52.74.1xx.1xx:/xxx/xxx/s-store/web/skin/js/data ~/Downloads/data
scp -P22 centos@s-cpanel:/xxx/xxx/xxxx/xxx/32DFE214-0971-3497-6D1B-EB745D72E18A.xlsx ~/Downloads/cas.xlsx
#3 远程上传文件
npm
npm常用命令
#1 查看安装列表 ls 、list
npm ls -g
npm list -g --depth 0
npm ls
#2 搜索:https://docs.npmjs.com/cli-commands/view.html
npm search gulp
npm view gulp
npm version
#3 安装
npm install gulp
npm install gulp -g
#4 更新
npm update gulp
#5 删除
npm uninstall gulp
npm uninstall gulp -g
#6 清除缓存
npm cache clean
npm package管理
#1 初始化 生成package.json
npm init
#2 安装并添加到 package
npm install gulp --save
#3 直接通过package.json安装
npm install
npm 代理设置(长期的)
#1 开启代理
npm config set proxy http://127.0.0.1:1087
npm config set proxy http://127.0.0.1:1087
#2 查看:
npm config list
#3 关闭代理
npm config delete proxy
npm config delete https_proxy
OSS命令行上传(通过“ossutil64”工具)
安装ossutil64
#1 最新安装方式:https://help.aliyun.com/document_detail/120075.htm?spm=a2c4g.11186623.0.0.52611bf6oqIOax#concept-303829
sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash
## root@bbtoo:~# sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash
## % Total % Received % Xferd Average Speed Time Time Time Current
## Dload Upload Total Spent Left Speed
## 100 3719 100 3719 0 0 54182 0 --:--:-- --:--:-- --:--:-- 54691
## Archive: ossutil-linux-amd64.zip
## creating: ossutil-linux-amd64/
## inflating: ossutil-linux-amd64/ossutil
## inflating: ossutil-linux-amd64/ossutil64
##
## ossutil version: v1.7.15 has successfully installed.
## Now run "ossutil config" for setup. Check https://help.aliyun.com/document_detail/50452.html for more details.
## #1 下载安装
## #1.1 定位到安装目录
## cd /usr/local/bin/
## #1.2 下载
## wget https://gosspublic.alicdn.com/ossutil/1.7.13/ossutil64
## #1.3 将下载的文件改为可执行文件
## chmod 755 ossutil64
#2 配置endpoints 和 accesskey
ossutil64 config
# 依次输入:相关的配置内容
# 配置好后 查看配置内容
cat /root/.ossutilconfig
# [Credentials]
# language=CH
# endpoint=oss-ap-southeast-1-internal.aliyuncs.com
# accessKeyID=LTA************ssbPZ
# accessKeySecret=00n*************okDxp
使用ossutil64
#1 查看oss 桶
ossutil64 ls
#2 查看桶中的文件
ossutil64 ls oss://s-copys2
#3 上传单个文件
ossutil64 cp /var/log/payment/xxxx.log oss://s-copys2/ecs-logs/xxxx.log
#4 上传批量文件
ossutil64 cp -r /var/log/payment/ oss://s-copys2/ecs-logs/
git:
git reset -hard 21e4615ac29c880171ccb7454b91b08c07e56e65
其他
systemctl restart metricbeatt
systemctl restart metricbeat
systemctl restart filebeat
SSH配置设置
Issues
Error loading Python lib '/tmp/_MEI5AbIEA/libpython3.9.so.1.0': dlopen: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/_MEI5AbIEA/libpython3.9.so.1.0)
#1 检查centos 版本
cat /etc/redhat-release
#2 检查glibc版本
strings /lib64/libc.so.6 | grep GLIBC_
#3 方案1 备份系统 在ali云后台 升级主机操作系统到centos8.2
#3 方案2 升级glibc
connect() to unix:/var/opt/remi/php73/run/php-fpm/www.sock failed (13: Permission denied) while connecting to upstream,
#1 检查php配置 listen 和 user
vi /etc/opt/remi/php73/php-fpm.d/www.conf
user = apache
group = apache
# 配置user & user group
user = nginx
group = nginx
# 配置listen
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
# **留意配置 需要注释掉这行** 不然会出现启动php fpm后www.sock文件属性变成了root用户组
;listen.acl_users = apache,nginx
# 留意nginx fastcgi_pass
listen = /var/opt/remi/php73/run/php-fpm/www.sock
#2 检查文件权限 /var/opt/remi/php73/run/php-fpm/www.sock
83942285 srw-rw----+ 1 root root 0 1月 23 20:45 www.sock
#3 发现读写权限给了root 所以提示没有权限 需要把权限给nginx用户
chown nginx: www.sock
#4 重启php-fpm后发现文件用户组 自动发生了改变 变成了root 用户组 的解决办法
# 编辑保存nginx 用户组权限
vi /etc/passwd
# 将 nginx:x:989:983:Nginx web server:/var/lib/nginx:/sbin/nologin 改为33:
nginx:x:33:33:Nginx web server:/var/lib/nginx:/sbin/nologin
# 编辑保存nginx 用户组权限
vi /etc/group
#将 nginx:x:983: 改为33
nginx:x:33:
# 5 在ali云后台 重启服务器
参考:用户和用户组管理
bbtoo-new cmd history
1 apt update
2 apt upgrade
3 apt info php74
4 apt info php7.4
5 apt search php
6 apt search php7
7 apt search php7.4
8 ssh -V
9 sshd -V
10 journalctl -u ssh.service --since today
11 vi /etc/ssh/sshd_config
12 sshd -t
13 sshd -T |grep -i key
14 systemctl restart ssh
15 apt info nginx
16 apt install nginx
17 nginx -t
18 apt info redis
19 apt install redis
20 vi /etc/redis/redis.conf
21 systemctl restart redis
22 systemctl status redis
23 apt update
24 apt -y install software-properties-common
25 add-apt-repository ppa:ondrej/php
26 apt update
27 apt -y install php7.4
28 apt info php7.4
29 php -v
30 which php
31 which php-fpm
32 php-fpm
33 apt search php7.4
34 php -i |grep fpm
35 php -i |grep redis
36 apt info php7.4-fpm
37 apt info php7.4
38 php -i |grep cgi
39 apt info php7.4-fpm
40 apt install php7.4-fpm
41 apt info php7.4-cli
42 apt install php7.4-cli
43 apt info php7.4-cli
44 apt info php7.4-bcmath
45 apt install php7.4-bcmath
46 apt info php7.4-gd
47 apt install php7.4-gd
48 apt install php7.4-json
49 apt info php7.4-mbstring
50 apt install php7.4-mbstring
51 apt install php7.4-mcrypt
52 apt install php7.4-mysqlnd
53 apt install php7.4-opcache
54 apt info php7.4-opcache
55 apt info php7.4-pdo
56 php -i |grep
57 apt info php7.4-pecl-crypto
58 apt info php7.4-pecl
59 php -i |grep pecl-crypto
60 php -i |grep pecl
61 apt search php7.4-pecl
62 apt search geoip
63 apt search crypto
64 php -i crypto
65 php -i |grep crypto
66 apt search mcrypt
67 apt info php7.4-mcrypt
68 php -i |grep php7.4-mcrypt
69 php -i |grep mcrypt
70 php -i |grep geoip
71 apt search geoip
72 apt install php7.4-geoip
73 apt info php7.4-recode
74 apt search recode
75 php -i |grep recode
76 apt search snmp
77 apt install php7.4-snmp
78 php -i |grep soap
79 apt search soap
80 apt install php7.4-soap
81 php -i |grep soap
82 apt info php7.4-cli
83 apt info php7.4-common
84 apt install php7.4-common
85 apt info php7.4-common
86 apt info php7.4-mysql
87 apt info php7.4-zip
88 apt install php7.4-zip
89 apt info php7.4-gd
90 apt info php7.4-curl
91 apt install php7.4-curl
92 apt info php7.4-curl
93 apt ifno php7.4-bcmath
94 apt info php7.4-bcmath
95 histpry
96 history
97 history |grep "apt install"
98 php -v
99 php7.4 -v
100 php7.4 -i |grep mysql
101 php -i |grep mysql
102 php -i |grep memchached
103 php -i |grep redis
104 apt search redis
105 apt install php7.4-redis
106 php -i |grep redis
107 php -i |grep xml
108 apt info php7.4-xml
109 apt install php7.4-xml
110 history
111 apt search memcache
112 apt info php7.4-memcached
113 apt install php7.4-memcached
114 systemctl status php
115 systemctl status php7.4-fpm
116 systemctl status php7.4
117 systemctl list-utils |grep php
118 systemctl list-utils --all|grep php
119 systemctl list-units |grep php
120 php -m
121 exit
122 cat /etc/php/7.4/fpm/php-fpm.conf
123 cat /etc/php/7.4/fpm/php.ini
124 cat /etc/php/7.4/fpm/php-fpm.conf
125 cd /etc/php/7.4/
126 ls
127 cd apache2/
128 ls
129 cd ..
130 gpre "listen.owner"
131 grep "listen.owner"
132 grep "listen.owner" ./ |sort
133 grep "listen.owner" -rsh
134 grep "listen.owner" -rsh |sort
135 grep
136 ls
137 cd fpm/
138 ls
139 cd conf.d/
140 ls
141 cd ..
142 grep "listen.owner" php-fpm.conf
143 grep "listen.owner" php.ini
144 cd pool.d/
145 cat www.conf
146 history
147 vi www.conf
148 which php-fpm7.4
149 cd /var/opt/
150 ls
151 cd ..
152 cd run
153 ls
154 cd php/
155 ls
156 systemctl status php*
157 systemctl status php7.4-fpm.service
158 ls
159 systemctl restart php7.4-fpm.service
160 journalctl -xeu php7.4-fpm.service
161 cat /etc/passwd
162 ps -ef |grep nginx
163 history
164 systemctl status nginx
165 systemctl cat nginx
166 cat /etc/nginx/nginx.conf
167 groups
168 groups list
169 groups nginx
170 groups www-data
171 getent group
172 groups redis
173 id redis
174 cd /etc/php/7.4/fpm/
175 ls
176 cat php-fpm.conf
177 ls
178 cd php.d
179 ls
180 cat pool.d/www.conf
181 ps -ef|grep nginx
182 vi pool.d/www.conf
183 systemctl restart php7.4-fpm.service
184 systemctl status php7.4-fpm.service
185 ps -ef|grep nginx
186 ps -ef|grep php
187 cat * |grep "listen"
188 history
189 cat *.conf |grep "listen"
190 cat *.conf |grep "listen" -rn
191 ls -lh /run/php/php7.4-fpm.sock
192 cat *.* |grep "listen" -rn
193 ls
194 grep "listen" -rn
195 history
196 getent group
197 id www-data
198 grep --help
199 grep -rn "listen" /etc/php/
200 grep -rn "user" /etc/php/
201 cd /etc/php/
202 grep -rn -C 5 "user" *.ini
203 grep -rn -C 5 "user" ./
204 grep -rn -C 5 "user" ./ --include=*ini
205 grep -rn "user" ./ --include=*ini
206 grep -rn "user" ./ --include=*.conf
207 grep --help
208 grep -rn "user" ./ -R --include=*.conf
209 ls
210 cd 7.4/
211 ls
212 cd fpm/
213 ls
214 grep "user" php-fpm.conf php.ini
215 grep "us" php-fpm.conf php.ini
216 grep "usr" php-fpm.conf php.ini
217 grep "usr" php-fpm.conf php.ini -n
218 grep "max" php-fpm.conf php.ini -n
219 history
220 grep --help
221 grep -e "usr" -e "listen" -rn /etc/php/
222 grep -e "usr" -e "listen" -e "sock" -rn /etc/php/
223 history |grep "grep"
224 grep -e "usr" -e "listen" -e "sock" -rn /etc/php/
225 grep "usr|listen|sock" -rn /etc/php/
226 egrep "usr|listen|sock" -rn /etc/php/
227 grep -E "usr|listen|sock" -rn /etc/php/
228 history
229 cat --help
230 history |grep cat
231 cat php-fpm.conf php.ini |grep "usr"
232 cat php-fpm.conf php.ini
233 cd /etc/php/7.4/
234 cat php-fpm.conf php.ini |grep "usr"
235 ls
236 cd fpm/
237 ls
238 cat php-fpm.conf php.ini |grep "usr"
239 cat php-fpm.conf php.ini |grep "usr" -n
240 cat php-fpm.conf php.ini |grep "usr" -l
241 cat php-fpm.conf php.ini |grep "usr" -f
242 cat php-fpm.conf php.ini |grep "usr" -rn
243 cat php-fpm.conf php.ini
244 history |grep cat
245 cat /etc/php/* |grep -e "usr" -e "listen" -e "sock" -rn
246 cat /etc/php/*.conf |grep -e "usr" -e "listen" -e "sock" -rn
247 history
248 history |grep cat
249 cat * |grep -e "usr" -e "listen" -rn
250 cd ~
251 cat /etc/php/ |grep -e "usr" -e "listen" -rn
252 cat /etc/php/* |grep -e "usr" -e "listen" -rn
253 cat /etc/php/7.4/fpm/*.conf |grep -e "usr" -e "listen" -rn
254 cat /etc/php/7.4/fpm/* |grep -e "usr" -e "listen" -rn
255 cd /etc/php/
256 cat *.ini |grep -e "usr" -e "listen" -rn
257 cat *.ini -r |grep -e "usr" -e "listen"
258 cat --help
259 cd 7.4/fpm/
260 ls
261 cat *.conf |grep -e "usr"
262 cat *.conf |grep -e "usr" -n
263 cat *.conf |grep -e "usr" -nf
264 cat *.conf -n |grep -e "usr"
265 cat *.conf -nr |grep -e "usr"
266 cat *.conf -n |grep -e "usr"
267 history |grep cat
268 ls
269 cat php-fpm.conf php.ini -n |grep "usr"
270 cat php.ini php-fpm.conf -n |grep "usr"
271 cat php.ini php-fpm.conf |grep "usr" -n
272 find --help
273 su- www-data
274 su - "www-data"
275 su www-data -s /bin/bash -c "ls -lh"
276 su www-data -s /bin/bash -c "composer -v"
277 which runuser
278 runuser -u www-data -- composer v
279 runuser -u www-data -- composer -v
280 runuser -u www-data -- "composer -v"
281 runuser -u www-data -- composer -v
282 apt search php7.4 |grep zip
283 apt search php7.4 |grep cli
284 apt search php |grep cli
285 apt search unzip
286 apt info unzip
287 apt search php7.4 |grep zip
288 history
289 su www-data -c "composer -v"
290 which php7.4
291 ls -lh /usr/bin/php7.4
292 ls -la /usr/bin/php7.4
293 cd /usr/bin/
294 ls
295 ls -la /usr/bin/php
296 ls -lh /usr/bin/php
297 cat /etc/passwd
298 history
299 cd su - www-data -s /bin/bash
300 su -s /bin/bash www-data
301 cat /etc/passwd
302 vi /etc/passwd
303 cat /etc/passwd
304 cat /etc/passwd |grep www
305 su www-data -c "composer -v"
306 su - www-data
307 cat /etc/passwd |grep adm
308 id www-data
309 id nginx
310 getent gourp
311 getent group
312 exit
313 cd /var/
314 cd log/
315 find ./ -mtime -1 -type f
316 find ./ -mtime -1 -type f -exec ls -l {} /;
317 find ./ -mtime -1 -type f -exec ls -lh {} /;
318 find ./ -mtime -1 -type f -exec ls -lh {} \;
319 find /etc/php/ -name "*.ini"
320 find /etc/php/7.4/fpm/ -name "*.ini"
321 find /etc/php/7.4/fpm/ -name "*.conf"
322 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -n
323 find /etc/php/7.4/fpm/ -name "*.conf" -exec grep "usr" {} \; -print
324 find /etc/php/7.4/fpm/ -name "*.conf" -exec grep "usr" {} \;
325 find /etc/php/7.4/fpm/ -name "*.conf" -exec grep "usr" -n {} \;
326 grep -rn "user" /etc/php/
327 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -n
328 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -n -color=auto
329 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -n -color auto
330 history
331 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr"
332 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -n
333 find /etc/php/7.4/fpm/ -name "*.conf" |xargs grep "usr" -rn
334 find /etc/ -name "php.ini"
335 find /etc/ -name "*.conf"
336 find /etc/ -name "www.conf"
337 ps -ef |grep nginx
338 id nginx
339 id www-data
340 cat /etc/php/7.4/fpm/pool.d/www.conf
341 history |grep php
342 ls -lh /run/php/php7.4-fpm.sock
343 apt info wget
344 apt info php-cli
345 apt info php-zip
346 apt info unzip
347 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
348 HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
349 php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
350 php -v
351 ls
352 php composer-setup.php --install-dir=/usr/local/bin --filename=composer
353 compose -v
354 composer -v
355 su -c "composer -v" www-data
356 id www-data
357 su -c "ls" www-data
358 su -c "ls -lh" www-data
359 cat /etc/passwd
360 cd /var/www/
361 ls -lh
362 su -c "ls -lh" www-data
363 su -www-data
364 exit
365 which npm
366 npm -v
367 which node
368 node -v
369 apt search node
370 apt search npm
371 apt info nodejs
372 apt info node
373 apt info npm
374 history
375 exit
376 ls
377 cd /var/
378 ls
379 ls -lh
380 apt update
381 apt info mariadb
382 apt info mariadb-server
383 apt install mariadb-server
384 systemctl status mariadb
385 systemctl status mariadb.service
386 systemctl cat mariadb.service
387 cd /var/lib/mysql/
388 ls
389 cd mysql/
390 ls
391 cd ..
392 which mysql
393 mysql -v
394 system info mariadb
395 systemctl info mariadb
396 cd /var/
397 systemctl status mariadb
398 systemctl info mariadb
399 history
400 apt info mariadb
401 apt info mariadb-server
402 apt info mariadb-server -a
403 systemctl cat mariadb.service
404 systemctl cat mariadb.service |grep cnf
405 systemctl cat mariadb.service |grep cnf -C 5
406 systemctl cat mariadb.service |grep mysql
407 mysql
408 mysql -u root mysql
409 find /etc/ -name "my.cnf"
410 find /etc/ -name "maria"
411 find /etc/ -name "maria*"
412 mysql_secure_installation
413 mysql -uroot -p
414 exit
415 journalctl -u ssh.service --since today
416 journalctl -u mariadb.service --since today
417 systemctl status nginx
418 cat /etc/nginx/nginx.conf
419 cat /var/log/nginx/access.log
420 tail -f /var/log/nginx/access.log
421 systemctl status apache
422 systemctl status mariadb.service
423 lsof -i:3306
424 lsof -i:443
425 lsof -i:80
426 lsof -i:3306
427 lsof -i:6379
428 cd /etc/nginx/
429 ls
430 cat fastcgi.conf
431 vi nginx.conf
432 ls
433 ls -lh
434 cp nginx.conf nginx.conf.copy
435 ls -lh
436 vi nginx.conf
437 cd sites-enabled/
438 ls -lh
439 nginx -t
440 systemctl restart nginx
441 systemctl status nginx
442 cd ~
443 netstat -anpt | grep 3306
444 netstat -anpt | grep 6379
445 netstat -anpt | grep 80
446 netstat -anpt | grep 442
447 netstat -anpt | grep 443
448 cd /etc/redis/
449 ls
450 vi redis.conf
451 systemctl restart redis
452 systemctl status redis
453 systemctl status ngix
454 systemctl status nginx
455 systemctl status redis
456 netstat -anpt | grep 6379
457 netstat -lnp |grep redis
458 netstat -lnp |grep ngix
459 netstat -lnp |grep nginx
460 netstat -lnp |grep maria
461 netstat -anpt
462 netstat -anpt | grep 6379
463 cat redis.conf
464 cd /etc/mysql/
465 ls
466 cat mariadb.cnf
467 ls
468 cat mariadb.conf.d/50-client.cnf
469 cat mariadb.conf.d/50-mysql-clients.cnf
470 cat mariadb.conf.d/50-mysqld_safe.cnf
471 ls
472 cat mariadb.conf.d/50-server.cnf
473 netstat -anpt | grep 3306
474 grep -rn "bind-address"
475 cd ~
476 grep -rn "bind-address" /etc/mysql/
477 vi /etc/mysql/mariadb.conf.d/50-server.cnf
478 systemctl restart mariadb.service
479 systemctl status mariadb.service
480 netstat -anpt | grep 3306
481 history
482 vi /etc/redis/redis.conf
483 systemctl restart redis
484 systemctl status redis
485 systemctl restart nginx
486 systemctl status nginx
487 exit
488 cd /var/www/
489 ls
490 cd bbtoo-core/
491 ls
492 rm -rf *
493 ls
494 cd ..
495 cd bbtoo-cpanel/
496 ls
497 rm -rf *
498 ls
499 exit
500 cd /var/www/bbtoo-core/
501 composer update
502 exit
503 cd /var/www/
504 ls
505 mkdir bbtoo-core
506 mkdir bbtoo-cpanel
507 mkdir bbtoo-docker
508 ls -lh
509 cd bbtoo-core/
510 ls
511 rm -rf *
512 ls
513 history |grep php
514 php -m |grep mon
515 aptsearch mongodb
516 apt search mongodb
517 apt info php7.4-mongodb
518 apt install php7.4-mongodb
519 systemctl restart php7.4-fpm.service
520 php -m |grep mon
521 composer update
522 ls -lh
523 cd ..
524 cd bbtoo-api/
525 cd ..
526 cd bbtoo-cpanel/
527 composer update
528 vi /etc/nginx/nginx.conf
529 cd /etc/nginx/
530 ls
531 cd sites-enabled/
532 ls
533 ls -lh
534 cat /etc/nginx/nginx.conf
535 ls
536 ln -s bbtoo-cpanel-prod.conf /var/www/bbtoo-core/nginx/prod.conf
537 ls
538 ln -s /var/www/bbtoo-core/nginx/prod.conf bbtoo-cpanel-prod.conf
539 ls
540 ls -lh
541 ls
542 rm -rf bbtoo-cpanel-prod.conf
543 ls
544 ln -s /var/www/bbtoo-cpanel/nginx/prod.conf bbtoo-cpanel-prod.conf
545 ls
546 ln -s /var/www/bbtoo-core/nginx/prod.conf bbtoo-core-prod.conf
547 ls
548 ls -lh
549 cat bbtoo-core-prod.conf
550 ls
551 cat /etc/nginx/nginx.conf
552 systemctl status php7.4-fpm.service
553 cd /etc/php/
554 cd /etc/nginx/sites-enabled/
555 grep "listen" /etc/php/ -rn
556 nginx -t
557 systemctl restart nginx
558 systemctl status nginx
559 cd /var/log/
560 ls
561 cd nginx/
562 ls
563 cat error.log
564 cat bbtoo-cpanel.error.log
565 cd ..
566 ls -lh
567 ps -ef |grep php
568 su www-data -c "mkdir BBToo-core"
569 mkdir BBToo-core
570 mkdir BBToo-cpanel
571 ls-lh
572 ls -lh
573 chown www-data: BBToo-core/
574 chown www-data: BBToo-cpanel/
575 ls -lh
576 cat bbtoo-cpanel.error.log
577 tail -f nginx/bbtoo-cpanel.error.log
578 cd /var/log/nginx/
579 ls
580 cat bbtoo-cpanel.access.log
581 cd ..
582 ls
583 cd BBToo-cpanel/
584 ls
585 cat 22_11_16-Log-bbtoo-cpanel.log
586 cd ..
587 cat nginx/
588 ls
589 cd nginx/
590 ls
591 cat bbtoo-core.error.log
592 cat bbtoo-cpanel.access.log
593 cat bbtoo-cpanel.error.log
594 cat bbtoo-core.access.log
595 cat bbtoo-api.access.log
596 cat bbtoo-core.error.log
597 cat bbtoo-api.access.log
598 cat bbtoo-core.access.log
599 cd ..
600 ls
601 cd BBToo-core/
602 ls
603 cat 22_11_16-Log-bbtoo-core.log
604 cd ..
605 cd BBToo-cpanel/
606 ls
607 cat 22_11_16-Log-bbtoo-cpanel.log
608 cd /var/log/BBToo-core/
609 ls
610 cat 22_11_16-Log-bbtoo-core.log
611 tail -f 22_11_16-Log-bbtoo-core.log
612 ls
613 cd /var/log/
614 ls
615 cat php7.4-fpm.log
616 ls
617 ls |grep error
618 cd nginx/
619 ls
620 cat *error.log -n
621 cat *.access.log -n
622 cd ..
623 ls
624 cd BBToo-core/
625 ls
626 cat 22_11_16-Log-bbtoo-core.log
627 tail -f 22_11_16-Log-bbtoo-core.log
628 systemctl status nginx.service
629 lsof -i:80
630 systemctl status apache2.service
631 systemctl stop apache2.service
632 systemctl status apache2.service
633 lsof -i :80
634 systemctl start nginx
635 systemctl status nginx
636 systemctl disable apache2.service
637 cd /etc/systemd/system/multi-user.target.wants/
638 ls
639 ls 0lh
640 sl -lh
641 ls -lh
642 exit
643 cd /var/log/
644 ls
645 cd BBToo-core/
646 ls
647 tail -f 22_11_16-Log-bbtoo-core.log `
648 tail -f 22_11_16-Log-bbtoo-core.log
649 php -m |grep encrypt
650 php -i |grep encrypt
651 php -i |openssl
652 php -i |grep openssl
653 tail -f 22_11_16-Log-bbtoo-core.log
654 php -v
655 php -a
656 php -m |grep crypt
657 apt search crypto
658 php -a
659 php -i |grep openssl
660 openssl -v
661 openssl --version
662 openssl help
663 cat /usr/lib/ssl/openssl.cnf
664 cat /usr/lib/ssl/openssl.cnf |grep "default_sect"
665 openssl version
666 cd /usr/lib/ssl/
667 ls
668 ls -lh
669 cd /etc/ssl/
670 ls
671 cp openssl.cnf openssl.copy.cnf
672 ls
673 vi openssl.cnf
674 which diff
675 diff openssl.cnf openssl.copy.cnf
676 php -a
677 php -i |grep openssl
678 vi /usr/lib/ssl/openssl.cnf
679 cd /var/log/
680 ls
681 cd BBToo-core/
682 ls
683 tail -f 22_11_17-Log-bbtoo-core.log
684 systemctl restart php7.4-fpm.service
685 systemctl status php7.4-fpm.service
686 tail -f 22_11_17-Log-bbtoo-core.log
687 vi /etc/php/7.4/fpm/php.ini
688 systemctl restart php7.4-fpm.service
689 cd ..
690 ls
691 cd nginx/
692 cat bbtoo-cpanel.error.log
693 tail -f bbtoo-core.error.log
694 tail -f bbtoo-cpanel.error.log
695 cd /var/log/BBToo-cpanel/
696 ls
697 tail -f 22_11_17-Log-bbtoo-cpanel.log
698 cd ../BBToo-core/
699 ls
700 tail -f 22_11_17-Log-bbtoo-core.log
701 tail -f ../BBToo-cpanel/22_11_17-Log-bbtoo-cpanel.log
702 cat /var/www/bbtoo-cpanel/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
703 cat /var/www/bbtoo-cpanel/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php -n
704 cat /var/www/bbtoo-cpanel/composer.lock |grep phpexcel
705 cat /var/www/bbtoo-cpanel/composer.lock |grep phpexcel -C 5
706 ls /var/www/bbtoo-cpanel/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
707 ls /var/www/bbtoo-cpanel/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php -lh
708 vi /var/www/bbtoo-cpanel/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
709 tail -f ../BBToo-cpanel/22_11_17-Log-bbtoo-cpanel.log
710 history |grep redis
711 apt search apcu
712 php -v
713 php -m |grep apcu
714 php -m |grep apc
715 apt install php7.4-apcu
716 history |grep php
717 systemctl restart php7.4-fpm.service
718 systemctl status php7.4-fpm.service
719 history |grep nginx
720 nginx -t
721 systemctl restart nginx
722 systemctl status nginx
723 php -m |grep apc
724 php -i |grep apc
725 history
726 exit
727 sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash
728 ossutil -v
729 ossutil64 -v
730 which ossutil
731 which ossutil64
732 exit
733 systemctl status nginx
734 history |grep nginx
735 nginx -t
736 systemctl restart nginx
737 nginx -t
738 systemctl restart nginx
739 exit
740 systemctl restart nginx
741 exit
742 ls
743 composer update
744 history |grep composer
745 cd /var/www/bbtoo-core/
746 ls -lh
747 cd vendor/
748 ls -lh
749 exit
750 cd /var/www/
751 ls -lh
752 cd ..
753 ls
754 cp -r www php-projects
755 du -h --max-depth 1
756 cd lib/
757 lks
758 ls
759 top
760 exit
761 cd /var/log/
762 ls
763 cd BBToo-core/
764 ls
765 tail -f 23_09_22-Log-bbtoo-core.log
766 php -v
767 exit
768 history |grep composer
769 history |grep composer 1 50
770 history
771 cd /var/www/bbtoo-cpanel/
772 history |grep composer 1 50
773 history
774 composer dumpautoload
775 ls -lh
776 cd vendor/
777 ls
778 ls -lh
779 composer dumpautoload
780 cd ..
781 composer dumpautoload
782 cd ..
783 cd bbtoo-core/
784 ls
785 ls -lh
786 cd vendor/
787 ls -lh
788 cd ..
789 composer dumpautoload
790 cd /var/www/bbtoo-api/
791 ls
792 cat nginx/s-pin-api.conf
793 cd /etc/nginx/
794 ls
795 cat nginx.conf
796 cd sites-
797 cd sites-enabled/
798 ls
799 ls -lh
800 cd /var/www/bbtoo-core/nginx/
801 ls
802 cat prod.conf
803 history |grep nginx
804 nginx -t
805 cat prod.conf
806 systemctl restart nginx
807 nginx -t
808 systemctl restart nginx
809 vi /etc/nginx/nginx.conf
810 /etc/nginx/
811 ls
812 cd /etc/nginx/
813 ls
814 cat nginx.conf
815 ls
816 cd conf.d/
817 ls
818 cd ..
819 cd sites-enabled/
820 ls
821 cat default
822 ls -lh
823 vi /etc/nginx/sites-available/default
824 nginx -t
825 systemctl restart nginx
826 exit
827 ls
828 history
webServer.port = 23308
webServer.user = "admin"
webServer.password = "ma****@123"