首页
简历
直播
统计
壁纸
留言
友链
关于
Search
1
PVE开启硬件显卡直通功能
2,327 阅读
2
在k8s(kubernetes) 上安装 ingress V1.1.0
1,928 阅读
3
二进制安装Kubernetes(k8s) v1.24.0 IPv4/IPv6双栈
1,808 阅读
4
kubernetes (k8s) 二进制高可用安装
1,732 阅读
5
Ubuntu 通过 Netplan 配置网络教程
1,697 阅读
默认分类
登录
/
注册
Search
chenby
累计撰写
176
篇文章
累计收到
106
条评论
首页
栏目
默认分类
页面
简历
直播
统计
壁纸
留言
友链
关于
搜索到
176
篇与
cby
的结果
2024-01-15
windows_exporter 安装
windows_exporter 安装背景如果想使用Prometheus监控Windows主机相关参数,那么就需要在Windows系统的主机上进行安装指标收集器。windows_exporter 是 Prometheus 官方所提供的指标收集器。下载https://github.com/prometheus-community/windows_exporter/releases访问此地址,即可下载最新版本运行下载完成后,双击即可完成运行,但是这种方式需要将应用一直放置在前台运行,为了以后的管理,可以将应用注册为服务项。sc create windows_exporter binpath= "C:\windwos_exporter\windows_exporter.exe" type= own start= auto displayname= windows_exporter注:binpath后接的是.exe程序所在的目录及程序名称配置打开一个新的CMD窗口,在CMD窗口中输入services.msc即可打开Windows的服务管理窗口。在此窗口中,找到windows_exporter服务,使用鼠标右击点击属性按钮,在启动参数中添加–telemetry.addr=0.0.0.0:9182,配置完成后,重启即可。访问服务启动完成后,访问主机的IP+端口即可,例如:192.168.1.100:9182Prometheus增加配置 - job_name: "windwos_exporter" scrape_interval: 15s static_configs: - targets: ["192.168.1.100:9182"]添加配置之后,重启服务即可Grafana面版配置在https://grafana.com/grafana/dashboards/?search=windows_exporter网页中寻找一个监控面版,导入Grafana即可。关于https://www.oiox.cn/https://www.oiox.cn/index.php/start-page.htmlCSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客全网可搜《小陈运维》文章主要发布于微信公众号
2024年01月15日
51 阅读
0 评论
0 点赞
2023-12-14
安装NETDATA集群监控面板
安装NETDATA集群监控面板介绍官方链接 演示网页:https://my-netdata.io/ 官方首页:http://netdata.cloud/ 文档地址:http://docs.netdata.cloud github地址:https://github.com/netdata/netdata#infographic安装官网提供一键安装脚本 bash <(curl -Ss https://my-netdata.io/kickstart.sh) 国内使用一键安装脚本需要添加参数 bash <(curl -Ss https://my-netdata.io/kickstart.sh) --stable-channel修改主节点的配置# 主服务器配置 # 生成uuid格式的字符串 root@cby:~# uuidgen 856a8565-75ac-441f-89e1-2d983272cfde root@cby:~# vim /etc/netdata/stream.conf root@cby:~# cat /etc/netdata/stream.conf [856a8565-75ac-441f-89e1-2d983272cfde] enabled = yes default history = 3600 default memory mode = save health enabled by default = auto allow from = * root@cby:~# root@cby:~# # allow from 可以设置数据流的允许来源以保证安全 # destination 是主节点ip地址 # 重启netdata root@cby:~# systemctl restart netdata root@cby:~# 配置其他节点# 其它服务器配置 root@cby:~# vim /etc/netdata/netdata.conf root@cby:~# cat /etc/netdata/netdata.conf [global] run as user = netdata page cache size = 32 dbengine multihost disk space = 256 memory mode = none hostname = node-1 [web] mode = none root@cby:~# root@cby:~# vim /etc/netdata/stream.conf root@cby:~# cat /etc/netdata/stream.conf [stream] enabled = yes destination = 101.43.189.29:19999 api key = 856a8565-75ac-441f-89e1-2d983272cfde root@cby:~# root@cby:~# # destination填写服务端的IP和端口 # 重启netdata root@cby:~# systemctl restart netdata root@cby:~# 启用插件以MySQL插件为例# 创建权限用户 root@cby:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7137 Server version: 8.0.35 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> mysql> mysql> CREATE USER 'netdata'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.52 sec) mysql> GRANT USAGE, REPLICATION CLIENT, PROCESS ON *.* TO 'netdata'@'localhost'; Query OK, 0 rows affected (0.01 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.13 sec) # 配置Netdata的mysql.conf root@cby:/etc/netdata# cd /etc/netdata root@cby:/etc/netdata# sudo ./edit-config go.d/mysql.conf ······略······ # netdata - name: local dsn: netdata:password@unix(/var/lib/mysql/mysql.sock) - name: local dsn: netdata:password@tcp(127.0.0.1:3306)/db_test ······略······ # 异常查看 root@cby:/etc/netdata# cd /usr/libexec/netdata/plugins.d/ root@cby:/etc/netdata# sudo -u netdata -s root@cby:/etc/netdata# ./go.d.plugin -d -m mysql systemctl restart netdata访问访问主节点地址 即可查看到监控面板,在node标签页面中即可查看到其他的nodes监控情况 http://101.43.189.29:19999/ 访问老版本的面板 http://101.43.189.29:19999/v0/ http://101.43.189.29:19999/v1/ http://101.43.189.29:19999/v2/关于https://www.oiox.cn/https://www.oiox.cn/index.php/start-page.htmlCSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客全网可搜《小陈运维》文章主要发布于微信公众号
2023年12月14日
135 阅读
0 评论
0 点赞
2023-12-08
Ubuntu安装typecho博客
Ubuntu安装typecho博客简介名称的来历Typecho 是由 type 和 echo 两个词合成的,来自于开发团队的头脑风暴。Type,有打字的意思,博客这个东西,正是一个让我们通过打字,在网络上表达自己的平台。Echo,意思是回声、反馈、共鸣,也是PHP里最常见、最重要的函数,相信大部分PHP爱好者都是从 echo 'Hello,world!'; 开始自己的PHP编程之路的。Typecho 是国内开发者开发的一款开源免费的动态博客程序,可以运行在基于 PHP 环境的各种平台上。官网:Typecho Official SiteGitHub:typecho: A PHP Blogging Platform.相比于同为动态博客并且广为人知的 WordPress 来说,Typecho 的一大特点就是 “精简”。全部文件不足 500KB,但却也实现了完整的主题和插件支持。博客程序很轻量,资源占用也很低,原生支持 Markdown 语法。属于省心并且简洁的博客类型。安装所需环境# 安装PHP所需插件 # 添加ppa源 add-apt-repository ppa:ondrej/php apt install nginx php7.4 php7.4-mysql php7.4-fpm下载安装主程序# 进入网站所在目录 root@cby:~# cd /var/www/html/ root@cby:/var/www/html# ls index.nginx-debian.html index.php php.php root@cby:/var/www/html# ll total 20 drwxr-xr-x 2 root root 4096 Dec 6 16:29 ./ drwxr-xr-x 3 root root 4096 Dec 6 16:01 ../ -rw-r--r-- 1 root root 612 Dec 6 16:01 index.nginx-debian.html -rw-r--r-- 1 root root 20 Dec 6 16:29 php.php root@cby:/var/www/html# # 下载安装包 root@cby:/var/www/html# wget https://mirrors.chenby.cn/https://github.com/typecho/typecho/releases/latest/download/typecho.zip --2023-12-06 16:35:48-- https://mirrors.chenby.cn/https://github.com/typecho/typecho/releases/latest/download/typecho.zip Resolving mirrors.chenby.cn (mirrors.chenby.cn)... 172.67.134.246, 104.21.25.253, 2606:4700:3032::ac43:86f6, ... Connecting to mirrors.chenby.cn (mirrors.chenby.cn)|172.67.134.246|:443... connected. HTTP request sent, awaiting response... 302 Found Cookie coming from mirrors.chenby.cn attempted to set domain to github.com Cookie coming from mirrors.chenby.cn attempted to set domain to github.com Location: /https://github.com/typecho/typecho/releases/download/v1.2.1/typecho.zip [following] --2023-12-06 16:35:49-- https://mirrors.chenby.cn/https://github.com/typecho/typecho/releases/download/v1.2.1/typecho.zip Reusing existing connection to mirrors.chenby.cn:443. HTTP request sent, awaiting response... 200 OK Length: 610472 (596K) [application/octet-stream] Saving to: ‘typecho.zip’ typecho.zip 100%[=======================================================================>] 596.16K 935KB/s in 0.6s 2023-12-06 16:35:50 (935 KB/s) - ‘typecho.zip’ saved [610472/610472] # 解压安装包 root@cby:/var/www/html# unzip typecho.zip Archive: typecho.zip inflating: LICENSE.txt creating: admin/ inflating: admin/editor-js.php inflating: admin/table-js.php inflating: admin/options-general.php ******略****** inflating: var/Widget/Contents/Page/Rows.php inflating: var/Widget/Contents/Page/Admin.php inflating: var/Widget/Contents/Page/Edit.php inflating: var/Widget/XmlRpc.php root@cby:/var/www/html# root@cby:/var/www/html# root@cby:/var/www/html# # 添加权限 root@cby:/var/www/html# chmod 777 * -R修改配置# 修改NGINX配置 vim /etc/nginx/nginx.conf #添加路由信息 --------------- 略 --------------- if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /index.php; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_intercept_errors on; } --------------- 略 ---------------重启服务# 设置开机自启 root@cby:~# systemctl enable nginx Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable nginx # 重启NGINX root@cby:~# systemctl restart nginx # 查看状态 root@cby:~# systemctl status nginx ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2023-12-08 10:09:31 CST; 42s ago Docs: man:nginx(8) Process: 632604 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 632605 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Main PID: 632606 (nginx) Tasks: 5 (limit: 3943) Memory: 112.5M CPU: 108ms CGroup: /system.slice/nginx.service ├─632606 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;" ├─632607 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─632608 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─632609 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" └─632610 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Dec 08 10:09:31 cby systemd[1]: Starting A high performance web server and a reverse proxy server... Dec 08 10:09:31 cby systemd[1]: Started A high performance web server and a reverse proxy server. root@cby:~# # 设置开机自启 root@cby:~# systemctl enable php7.4-fpm Synchronizing state of php7.4-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable php7.4-fpm # 重启PHP-FPM root@cby:~# systemctl restart php7.4-fpm # 查看状态 root@cby:~# systemctl status php7.4-fpm.service ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2023-12-08 10:11:02 CST; 2s ago Docs: man:php-fpm7.4(8) Process: 633187 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS) Main PID: 633184 (php-fpm7.4) Status: "Ready to handle connections" Tasks: 3 (limit: 3943) Memory: 11.0M CPU: 64ms CGroup: /system.slice/php7.4-fpm.service ├─633184 "php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─633185 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" > └─633186 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" > Dec 08 10:11:02 cby systemd[1]: Starting The PHP 7.4 FastCGI Process Manager... Dec 08 10:11:02 cby systemd[1]: Started The PHP 7.4 FastCGI Process Manager. root@cby:~# 我的NGINX配置文件# NGINX配置文件 user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; } http { sendfile on; tcp_nopush on; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; log_format main '{ "@timestamp": "$time_local", ' '"remote_addr": "$remote_addr",' '"remote_port": "$remote_port",' '"scheme": "$scheme",' '"request_uri": "$request_uri",' '"request_method": "$request_method",' '"request_time": "$request_time",' '"request_length": "$request_length",' '"response_status": "$status",' '"body_bytes_sent": "$body_bytes_sent",' '"http_referer": "$http_referer",' '"http_user_agent": "$http_user_agent",' '"http_x_forwarded_for": "$http_x_forwarded_for",' '"upstream_addr": "$upstream_addr",' '"upstream_response_time": "$upstream_response_time",' '"request_body": "$request_body"}'; server { listen 80 default_server; listen [::]:80 default_server; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /ssl/cert.pem; ssl_certificate_key /ssl/cert.key; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1; ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256; ssl_prefer_server_ciphers on; ssl_session_timeout 10m; ssl_session_cache shared:SSL:10m; ssl_buffer_size 2k; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; error_log /var/logs/nginx-error.log info; access_log /var/logs/nginx-access.log main; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name _; location / { try_files $uri $uri/ =404; } if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /index.php; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_intercept_errors on; } } include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }关于https://www.oiox.cn/https://www.oiox.cn/index.php/start-page.htmlCSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客全网可搜《小陈运维》文章主要发布于微信公众号
2023年12月08日
91 阅读
2 评论
0 点赞
2023-12-08
Ubuntu安装PHP和NGINX环境
Ubuntu安装PHP和NGINX环境介绍PHP-FPMPHP-FPM 是 PHP FastCGI Process Manager 的缩写,是 FastCGI 进程管理器。PHP-FPM 是基于 master/worker 的多进程架构模式,与 nginx 的设计风格类似。master 进程主要负责 CGI、PHP 环境初始化,事件监听、子进程状态,worker 进程负责处理 PHP 请求。FPM 的 master 通过共享内存获取 worker 进程的信息,包括 worker 进程当前状态、已处理请求数等,当 master 进程要杀掉一个 worker 进程时则通过发送信号的方式通知 worker 进程。FPM 的实现首先是创建一个 master 进程,在 master 进程中创建并监听 socket,然后 fork 出多个子进程,这些子进程各自 accept 请求。子进程的处理很简单,它在启动后阻塞在 accept 上,有请求到达后开始读取请求数据,读取完后开始处理然后再返回,在这期间不会接收其它请求。它跟 nginx 的事件驱动模型是不同的,nginx 是非阻塞的模型,如果一个请求数据还未发送完则会处理下一个请求,也就是说一个进程会同时连接多个请求。优点提供了更好的 PHP 进程管理方式,支持平滑停止/启动进程;Nginx 与 PHP-FPM 交互过程以常见的 LNMP 架构为例,Nginx 在一台服务器上,PHP 在另一台服务器上。当我们请求一个域名的时候,比如一个测试域名,www.oiox.cn 域名解析到 Nginx 服务器,Nginx 路由到 index.php 文件。此时 Nginx 检测出这不是静态文件,需要找 PHP 解析器来解析,然后加载 Nginx 的 FAST_CGI 模块,并 fastcgi_pass 到 PHP 服务器,比如 10.20.0.1:9000。此时 PHP 服务器上的 PHP-FPM 子进程监听到了请求,然后处理请求。其流程如下:浏览器访问 www.oiox.cn | 域名解析到 Nginx 服务器 | 路由到 www.oiox.cn/index.php | Nginx 检测 index.php 不是静态资源,加载 Nginx 的 fast-cgi 模块 | 请求被转发到 PHP 所在的服务器上 | PHP 服务器上的 fast-cgi 监听 127.0.0.1:9000 地址 | www.oiox.cn/index.php 请求到达 127.0.0.1:9000 | PHP-FPM worker 进程执行代码Nginx 与 PHP-FPM 通信方式在 Linux 上,Nginx 和 PHP-FPM 通信有两种方式,tcp-socket 和 unix-socket。当 Nginx 和 PHP-FPM 不在同一台机器上时,只能使用 tcp-socket 这种通信方式。tcp socket 和 unix socket 对比效率:理论上,Unix domain socket 不需要经过网络协议栈,不需要打包拆包、计算校验和、维护序列号和应答等,只是将应用层数据从一个进程拷贝到另一个进程。所以其效率比 tcp socket 的方式要高,可减少不必要的 tcp 开销。跨机器通信:tcp socket 支持跨机器通信,而 unix domain socket 是同一机器进程之间通信。高并发:实际上,在高并发情况下,两者的性能差距并不明显。但是 tcp socket 能表现出很明显的更高的稳定性。安装PHP# 安装php8.1 apt install php8.1-fpm # 设置开机自启 root@cby:~# systemctl enable php8.1-fpm Synchronizing state of php8.1-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable php8.1-fpm root@cby:~# # 查看服务是否正常 root@cby:~# systemctl status php8.1-fpm.service ● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-12-06 15:57:31 CST; 1min 19s ago Docs: man:php-fpm8.1(8) Process: 22149 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81 (code=exited, s> Main PID: 22146 (php-fpm8.1) Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec" Tasks: 3 (limit: 3943) Memory: 7.1M CPU: 25ms CGroup: /system.slice/php8.1-fpm.service ├─22146 "php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─22147 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" > └─22148 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" > Dec 06 15:57:31 cby systemd[1]: Starting The PHP 8.1 FastCGI Process Manager... Dec 06 15:57:31 cby systemd[1]: Started The PHP 8.1 FastCGI Process Manager. root@cby:~# 安装NGINX# 安装NGINX apt install nginx # 修改NGINX配置 root@cby:~# cat /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name _; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } } root@cby:~# 测试页面# 写入测试页面 root@cby:~# echo "<?php phpinfo(); ?>" >> /var/www/html/php.php # 重启NGINX root@cby:~# systemctl restart nginx # 设置开机自启NGINX root@cby:~# systemctl enable nginx Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable nginx # 查看状态 root@cby:~# systemctl status nginx ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-12-06 16:25:33 CST; 36s ago Docs: man:nginx(8) Process: 30554 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 30555 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Main PID: 30556 (nginx) Tasks: 5 (limit: 3943) Memory: 5.2M CPU: 24ms CGroup: /system.slice/nginx.service ├─30556 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;" ├─30557 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─30559 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─30560 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" └─30561 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Dec 06 16:25:33 cby systemd[1]: Starting A high performance web server and a reverse proxy server... Dec 06 16:25:33 cby systemd[1]: Started A high performance web server and a reverse proxy server. root@cby:~# # 访问测试页面 http://[主机IP]/php.php关于https://www.oiox.cn/https://www.oiox.cn/index.php/start-page.htmlCSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客全网可搜《小陈运维》文章主要发布于微信公众号
2023年12月08日
46 阅读
0 评论
0 点赞
2023-12-08
Ubuntu安装MySQL数据库
Ubuntu安装MySQL数据库介绍MySQL 的定义MySQL 是一种开源关系型数据库管理系统。与其他关系型数据库一样,MySQL 将数据存储在由行和列组成的表中。用户可以使用结构化查询语言(通常称为 SQL)定义、操作、控制和查询数据。由于 MySQL 是开源的,因此它的大量功能是在超过 25 年与用户密切合作的过程中开发出来的。MySQL 软件是开源的MySQL 是开源的,这意味着按照 GNU 通用公共许可条款,该工具可以免费使用。这也意味着,任何人都可以根据自己的使用需求自由修改软件的源代码。这使得 MySQL 分支为其他数据库变体(例如 MariaDB 和 Percona Server for MySQL)。MySQL 也可以通过其他许可用于商业用途。关系型数据库MySQL 所属的数据库类别称为关系型数据库管理系统 (RDBMS)。关系型数据库是信息的集合,它以预定义的关系组织数据,数据存储在一个或多个由列和行构成的表(或称“关系”)中,用户可以轻松查看和理解不同数据结构之间的关系。关系是不同表之间的逻辑连接,根据这些表之间的交互建立。下载下载地址https://dev.mysql.com/downloads/在此页面中,需要选择你要安装的版本类型,我这里是Ubuntu系统所以选择 MySQL APT Repository,若你使用CentOS那么就使用MySQL Yum Repository#下载地址 # https://dev.mysql.com/downloads/ # 选择你要安装的版本类型,我这里是Ubuntu系统所以选择 MySQL APT Repository,若你使用CentOS那么就使用MySQL Yum Repository apt install https://dev.mysql.com/get/mysql-apt-config_0.8.28-1_all.deb # 安装MySQL-Server apt install mysql-community-server # 查看服务是否正常 root@cby:~# systemctl status mysql ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-12-06 15:35:30 CST; 22min ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 9786 (mysqld) Status: "Server is operational" Tasks: 39 (limit: 3943) Memory: 369.3M CPU: 3.989s CGroup: /system.slice/mysql.service └─9786 /usr/sbin/mysqld Dec 06 15:35:29 cby systemd[1]: Starting MySQL Community Server... Dec 06 15:35:30 cby systemd[1]: Started MySQL Community Server. root@cby:~# 开启外部访问# 登录数据库 root@cby:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.35 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> # 查看默认库 mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) # 选择使用mysql库 mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> mysql> # 查询用户表 mysql> select host, user, authentication_string, plugin from user; +-----------+------------------+------------------------------------------------------------------------+-----------------------+ | host | user | authentication_string | plugin | +-----------+------------------+------------------------------------------------------------------------+-----------------------+ | localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | root | $A$005$yWgZ hKW4{ege W/5pMsmD7O.Tq.KL8z9ARsM1TcL74ysSUXrqH0pWKEj5 | caching_sha2_password | +-----------+------------------+------------------------------------------------------------------------+-----------------------+ 4 rows in set (0.00 sec) mysql> # 修改root的授权 mysql> update user set host='%' where user='root'; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> mysql> mysql> Grant all privileges on *.* to 'root'@'%'; Query OK, 0 rows affected (0.01 sec) mysql> # 刷新权限 mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> mysql> mysql> ^DBye root@cby:~# root@cby:~#测试# 使用其他主机进行登录数据库 root@cby:~# mysql -u root -p -h x.oiox.cn Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.35 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> mysql> mysql> ^DBye root@cby:~# root@cby:~# 关于https://www.oiox.cn/https://www.oiox.cn/index.php/start-page.htmlCSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客全网可搜《小陈运维》文章主要发布于微信公众号
2023年12月08日
47 阅读
0 评论
0 点赞
1
2
3
...
36