S

SEO 网站优化及网站推广

SEO 网站优化及网站推广

更一个新

有好几个月没更新了,今天来更一个新。 最近一年有点儿懈怠,也许是年纪大了,精力上有些不济,再加上很多东西都失去了分享的动力,好些东西原来想着写上来的,但是过几天就没有分享的欲望了。 不知道同样写 Blog 的你是否也有同样的困惑。 就本站的流量来看,从三月开始逐月下降,意料之中,不更新内容,还想有流量,想的美。 月初去了三藩市,市面比去年干净了一些。 每年都会去三藩市。 有些照片放到了这里,https://images.g2soft.net/album/San-Francisco.hE7 可以看看。

2025/7/28
articleCard.readMore

网络爬虫,网络蜘蛛的问题

在观察一个 Web 服务器的日志的时候,看到一个现象,有大量的网络爬虫,或者说网络蜘蛛来访问,抓取内容。这个访问数量有些过分。 看这个截图。 排名最前的十位如下: 714,290 (36.96%) 101 (00.07%) 11.8 GiB (39.11%) GPTBot/1.2 47,085 (02.44%) 299 (00.20%) 8 GiB (26.31%) GoogleOther 9,350 (00.48%) 453 (00.30%) 578.1 MiB (01.87%) meta-externalagent/1.1 35,038 (01.81%) 20 (00.01%) 470.2 MiB (01.52%) Ai2Bot-Dolma 39,785 (02.06%) 852 (00.57%) 376.3 MiB (01.21%) AhrefsBot/7.0 32,944 (01.70%) 216 (00.14%) 375.7 MiB (01.21%) MJ12bot/v1.4.8 28,577 (01.48%) 3,695 (02.48%) 313 MiB (01.01%) ClaudeBot/1.0 3,953 (00.20%) 967 (00.65%) 297.4 MiB (00.96%) Bytespider 13,919 (00.72%) 943 (00.63%) 202.8 MiB (00.65%) Googlebot/2.1 22,576 (01.17%) 13 (00.01%) 170.3 MiB (00.55%) Scrapy/2.11.2 排最前面的几位就是 GPTBot, GoogleOther, A12Bot-dolma,之流。都属于人工智能派出来的网络蜘蛛,来各个网站抓取内容,而它们抓取的内容会怎样使用的,会给你的网站带来访客吗? 基本上是不会的,本质上,这些机器人会抓取你的内容,然后进行索引,对其重组织后,来产生人工智能所编写的内容。 这意味着任何用 ChatGPT 之类的智能工具所攥写的内容都是在剽窃你我的内容。 作为内容的创造者,你会愿意无偿提供内容给他们吗? 来看看 OpenAI 的 GPTBot 干了什么吧? 网站的站长允许 GPTBot 来抓取网站内容,就意味着允许 OpenAI: 使用你的内容来训练人工智能模型 使用你的网站信息来生成 AI 内容 增加了额外的服务器负担,影响普通访客访问网站的效果 作为内容的创造者,我对滥用 AI 的能力,无偿使用原创者的作品,十分担忧,也很反对。 目前我采用了 robots.txt 来封锁 GPTBot 和其它的一些人工智能 robot。 如果还有新出来的人工智能机器人,我不介意把他们加上去,在没有合理的使用原创内容方法之前,还是都封掉为好。

2025/3/18
articleCard.readMore

迁移到新的服务器

把 blog 迁移到 VM Lime 上。

2025/3/7
articleCard.readMore

升级到 MovableType 8.4.2

升级到 MovableType 8.4.2, 无需赘述,下载一个 24M 的压缩包,解压缩,上传到安装目录,覆盖旧的文件。 然后登陆到后台,就直接完成升级 了。 虽然没有什么可以特别,还是介绍一下更新信息。 New and improved features Updated Smarty from 4.5.3 to 4.5.5 (MTC-29974) Updated MTBlockEditor to version 1.2.5 Updated MFA (Multi-Factor Authentication) plugin to version 1.0.5 Added support for MySQL caching_sha2_password authentication (MTC-29715) Improved the response time of the admin screen by revising the processing of MT::Permission (MTC-29836) Resolved issues Fixed an issue where line breaks were not converted to elements when pasting multi-line text in TinyMCE6 (MTC-30072) Removed unnecessary files included in the package (MTC-30173) Fixed an issue where inserting images in the old block editor caused an error when the width of thumbnails was specified (MTC-29967) Fixed an issue where the user-specific archives of ContentType were not always fully rebuilt (MTC-29907) Removed the use of the deprecated window.unload event in the Chrome browser (MTC-29851) Fixed timing to call listReady event from Svelte on List view (MTC-29915) Fixed to show confirm dialog after add/remove line on Table ContentField with browser backwording (MTC-29965) Fixed to remove the filter item of username at List view with Svelte (MTC-29928) Fixed to set a parameter to input field with filter_key on List view (MTC-29925) Fixed the setting add / remove rows and lines swapped on Edit ContentType (MTC-29839) Fixed to complete the process of mt-search.cgi with mass request parameters (MTC-29943) Fixed performance issues of processing parameters of Data API (MTC-29962) Fixed performance issues of processing parameters of Comment (MTC-29955) Improve performance of mt-search.cgi with specific parameters (MTC-29961) Fixed performance issues of processing parameters of mt-search.cgi (MTC-29953) Updates JavaScript Libraries Update a-table.js from 1.5.9 to 1.5.10 (MTC-29854) Security fixes and improvements Update TinyMCE 6 from 6.8.4 to 6.8.5 in the TinyMCE6 plugin (MTC-29922) Fixed Cross Site Scripting (XSS) of object embedding in MT Blockeditor using TinyMCE6 Plugin (CVE-2025-24841, MTC-29997) Fixed Cross Site Scripting (XSS) on the page of Edit a Custom Block in MT Blockeditor (CVE-2025-22888, MTC-29937) Fixed Cross Site Scripting (XSS) on Edit user page (CVE-2025-25054, MTC-30057)

2025/2/21
articleCard.readMore

升级到 MovableType 8.4.0

本站用的就是古典 Blog 软件,MovableType。 升级之前是 8.0.4版本,最近 SixApart 发布了 MovableType 8.4.0, 8.0.5 等等。 今天找时间,升级了本站。 升级就是先做备份,备份了数据库,备份了整个网站。 然后从官方网站下载了最新的个人免费版本。 上传到服务器上,解压缩,然后覆盖原来的安装目录。 在自己的浏览器上,登录MovableType 后台,提示更新。 点击开始升级。 挺顺利。 然后我习惯是重建了网站,看看使用有没有问题。 也是顺利完成。 看来从 MovableType 8.0.4 到 8.4.0 算是一个大的版本升级。 列一下,主要的变化。 首先是 从8.0.4 到 8.4.0,中间包括了 8.1,8.2,8.3 的重大改变。 The JavaScript Library in admin pages now be changed from Riot.js to Svelte. Set the Configuration Directive UseRiot to 0 to change to Svelte (MTC-28944, MTC-29006, MTC-29919) Smarty has been updated from 4.3.4 to 4.5.3 (MTC-29663) The MTBlockEditor plugin has been updated from 1.2.2 to 1.2.4 MTBlockEditor: Table blocks now display borders when editing (MTC-29749) MTBlockEditor: When LWP::Protocol::https is not installed, an appropriate error message is displayed when using the oEmbed block (MTC-29698) MTBlockEditor: When specifying resources with relative paths in custom scripts, the resources on the public site are now loaded (MTC-29772) Added an option to prevent public file information (FileInfo) from being imported when importing a site. If the "Omit import" checkbox for public file information is enabled, it will not be imported (MTC-29773) Added the Configuration Directive MTScript and MTStylesheet, which are used when loading JavaScript and stylesheets in mt-static from the admin screen (MTC-25985) Added the ability to output the value of any website by specifying the id attribute for the WebsiteURL and WebsitePath tags (MTC-29257) Added the Configuration Directive SuperuserRespectsDataAPIDisableSite to force system administrators to set DataAPIDisableSite (MTC-29694) Added the height attribute to the IMG element in the HTML output from the image block in the content type block editor (MTC-29728) When a site import is finished, whether it was successful or not, the fact that it has finished is now logged (MTC-29770 Explicitly added charset="utf-8" to places where external scripts are called (MTC-28113) Improved the method for detecting supported image types in the system check (MTC-29738) 看得懂,看不懂的,都看一眼,至少有些印象。

2024/11/13
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(6)

在介绍了如何安装 Ubuntu 24.04 LTS, Webmin, Nginx, MariaDB, PHP8.1-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS上后,有些补充内容。 比如 acme.sh 现在安装的 SSL 证书,默认已经是 ecc 证书了,就是 ecc-256 (prime256v1, "ECDSA P-256")。 然而还有一些需要说明的情况就放在了下面。 外传 网络防火墙 实际使用上,现在我已经很少再用 TCP Wrap 来作安全防护,而是使用了 nftables 防火墙,配合 fail2ban 来组合配合。 Ubuntu 24.04.1 已经默认安装了 nftables 了,如果没有的话,就是用下面的来安装。 sudo apt install nftables 而 Ubuntu 24.04 默认是安装使用了 UFW,作为 nftables 的前端。这里我不打算使用。就需要卸掉。 sudo systemctl disable --now ufw sudo apt remove ufw 当然还需要启用 nftables。 sudo systemctl enable --now nftables sudo apt install fail2ban 有几个常见命令 sudo systemctl enable fail2ban sudo systemctl start fail2ban sudo fail2ban-client version 返回 1.0.2,这是版本号。还有两个命令可以看 fail2ban 的状态,Ban了那些服务,哪些 IP 地址。 davidyin@walnut:~$ sudo fail2ban-client status Status |- Number of jail: 1 `- Jail list: sshd davidyin@walnut:~$ sudo fail2ban-client status sshd Status for the jail: sshd |- Filter | |- Currently failed: 1 | |- Total failed: 10 | `- File list: /var/log/auth.log `- Actions |- Currently banned: 1 |- Total banned: 1 `- Banned IP list: 183.81.169.238 fail2ban 的配置文件,最好是修改 /etc/fail2ban/jail.local 这个是本机文件,以后升级系统,升级 fail2ban 也不会改变该文件。 有些参数需要设置在 jail.local 里面。比如下面,在 ignoreip 这里填入自己的 ip 地址,这样就不会不小心把自己给关在外面了。 另外还有 收件地址等等。 [sshd] enabled = true filter = sshd backend = polling action = %(action_mwl)s ignoreip    = 127.0.0.1 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 bantime = 24h findtime = 10m maxretry = 5 mta = sendmail destemail = email@address sendername = Fail2Ban 在 Webmin 管理界面,也有 Fail2Ban 的管理模块,使用也是很方便的。 大概启用 fail2ban 三个小时之后,看一眼封掉多少 IP。 在大约二十个小时之后,大约被封禁掉78个 IP 地址。大多是那些从各个机房过来扫描的。 在开机大约七天后,再次查看了 Fail2Ban 的记录,在 SSH服务上,各种登录尝试失败后的情况,被封禁的 IP 数量达到 831 次。当前还有 95 个 IP 地址。 网络拥塞算法 这个对于网络传输很重要。好的这是 Google 搞出来的东西,BBR。 sudo nano /etc/sysctl.conf 在文件最后加上下面两行 net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr 再执行下面命令使之生效: sudo sysctl -p 有两条命令可以用来查看情况,下面第一条是看有哪些可用的拥塞算法,第二条是看当前生效的是哪一种拥塞算法。 davidyin@walnut:~$ sudo sysctl net.ipv4.tcp_available_congestion_control net.ipv4.tcp_available_congestion_control = reno cubic bbr davidyin@walnut:~$ sudo sysctl -n net.ipv4.tcp_congestion_control bbr 对于使用 php 重度用户,其实还需要开启 jit。 php 8.3 JIT 编辑 /etc/php/8.3/fpm/conf.d/10-opcache.ini 修改内容,增加下面这三项主要的修改。 opcache.enable_cli=1 opcache.jit_buffer_size=64M opcache.jit=tracing 修改完成后,重启 php8.3-fpm 服务,用我常用的一些 php 性能测试 script,比较修改前后的测试结果。可以大体得出一个结论,速度快了。 用 bench.php 测试,平均时间从 0.395s 提高到了 0.101秒。 用 bubble.php 测试,时间从 0.0703 提高到 0.0257. 用 X Prober v8.19 内置的 Server Benchmark 测试,387,479 提高到了 425,905。 这种性能提高不是看数字,而是能实际感受得到的。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi 六部分 外传,优化网络和 PHP

2024/10/9
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(5)

安装 Ubuntu 24.04 LTS, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS上。 之前介绍了如何在 DigitalOcean 创建新 VPS。并且完成基本的 Ubuntu 24.04.1 LTS的系统。然后介绍了如何安装 Webmin 主机控制面板,时区设置和 SSH 的安全设置。再之后说明一下如何用之前的新添加的用户来安装 Nginx Web 服务器和 MairaDB 数据库服务器。以及安装完 php 语言和 SSL 证书的申请。 现在要来介绍一下如何配置 nginx了。 第五部分 修改 Nginx 配置文件,以满足证书的使用之前,先执行一个命令,来生成一个4096位的 dhparam 文件。 cd ~/ssl openssl dhparam -out dhparam.pem 4096 需要等待一段时间,这个命令会执行比较长时间。 配置 https 主机 先来确认各个部分的版本信息,下面要用到。 davidyin@walnut:~/ssl$ nginx -v nginx version: nginx/1.24.0 (Ubuntu) davidyin@walnut:~/ssl$ openssl version OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024) 配置参数的来源根据 Mozilla SSL Configuration Generator 这个生成器来产生。 我会建议采取 Modern 方式的配置。 主机配置文件做相应的修改, http 网站重定向到 https。 采用 http2,还有就是 HSTS 与载入配置,最后完整的 u24.webexample.win 的配置文件,可以到 gist 查看,仅供参考。 到 SSL Labs 检测 SSL的配置,评分得到 A。 安装 Perl-Fastcgi 下面是对我而言很重要的语言支持,因为我有用 MovableType blog 系统,SEO网站优化 就是用它搭建的。而它是由 perl 语言支持的。 libfcgi-perl 可能已经有了,但下面还是再执行一遍安装,以防缺失。 sudo apt install libfcgi-perl sudo apt install spawn-fcgi fcgiwrap 然后执行下面的命令,来启动服务。 sudo service fcgiwrap restart 最后在 Nginx 的配置文件中添加下面这块。 location ~ \.pl|cgi$ { fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.pl; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 保存配置文件并重启 Nginx 服务。 接下来要测试,是否可以让 perl 文件运行。 新添加一个文件到 /home/davidyin/u24.webexample.win/index.pl 内容如下: index_pl.txt 在服务器上的文件后缀名必须是 pl,然后给与可执行权限。 chmod 755 index.pl 在浏览器中输入 https://u24.webexample.win/index.pl 如果看到下面的输出内容,那就对了。 看到上面的信息,就可以证明 Perl 可以正常地在网站执行。 到目前为止,已经配置好一个 DigitalOcean 的 VPS,安装好了 Ubuntu 24.04 Lts,Webmin 管理控制面板,以及 Nginx web 服务器,MariaDB 数据库服务器,php8.3-fpm 服务,Perl-Fastcgi 服务,免费的 SSL 证书。配置好了一个测试网站。 之后,需要安装那些由 php 编写的网站程序, Perl 编写的网站程序,都可以安装了。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi 六部分 外传,优化网络和 PHP

2024/10/8
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(4)

安装 Ubuntu 24.04 LTS, Webmin, Nginx, MariaDB, PHP8.1-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS上。 DavidYin 介绍了如何在 DigitalOcean 创建新 VPS。并且完成基本的 Ubuntu 24.04 LTS的系统。然后介绍如何安装 Webmin 主机控制面板,时区设置和 SSH 的安全设置。再之后说明一下如何用之前的新添加的用户来安装 Nginx Web 服务器和 MairaDB 数据库服务器。 现在就是很重要的语言支持部分了。因为我用的最多的就是 php 以及 perl 语言。所以这两部分就是重点了。 第四部分 安装 php8.3-fpm Ubuntu 24.04 LTS 仓库所包含的是 php8.3.6,目前 php 官方支持的版本是 8.1,8.2,8.3 这三个系列。所以直接使用 Ubuntu 的就已经是很新的版本了。 sudo apt install php8.3 php8.3-fpm php8.3-cli php8.3-common php8.3-mbstring php8.3-gd php8.3-intl php8.3-xml php8.3-mysql php8.3-zip php8.3-curl 安装完成后,执行 php -v 命令,可以看到版本信息。 davidyin@walnut:~$ php -v PHP 8.3.6 (cli) (built: Sep 30 2024 15:17:17) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.6, Copyright (c) Zend Technologies with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies davidyin@walnut:~$ 再看一下 php8.3-fpm 是否已经运行。 设置虚拟主机 说明:下面这些都是用来举例说明所用的,在实际使用中请用真实的数据。 IP: 143.110.227.68 Domain: u24.webexample.win username: davidyin 接下来我要设置一个 vhost,就是一个虚拟主机,我用的域名是 u24.webexample.win,此为举例而已。 到域名服务商的网站,专门设置域名记录的地方,把 u24.webexample.win 的 A 记录指向此 VPS 的 IP 地址,生效可能需要十分钟或更久,为快捷,可以在所操作的Windows hosts 文件添加纪录使之在本地立即可用。 新建一个主机配置文件,u24.conf,如下。 sudo nano /etc/nginx/conf.d/u24.conf 这里我会定义 log 文件的格式,以及它的储存位置。 log_format main '$remote_addr - $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; server { listen 80; server_name u24.webexample.win; access_log /var/log/nginx/host.access.log main; root /home/davidyin/u24.webexample.win; index index.php index.html index.htm; location / { try_files $uri $uri/ = 404; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ {         include snippets/fastcgi-php.conf;       fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;     } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } } 保存退出,然后执行 sudo nginx -t 命令看看,是否配置文件正确。若正确,就重启 Nginx 服务,使配置生效。 sudo service nginx restart 在/home/davidyin/u24.webexample.win/下新建一个文件 info.php 输入如下内容: <?php phpinfo(); 回到桌面浏览器中,输入网址 http://u24.webexample.win/info.php,如果看到下面这些内容,就表示 php 安装正确, nginx 也运行正确。 我一般会把 www-data 用户添加到 当前用户的组内,比如我这里用的 davidyin 用户就在同名的 davidyin 组内。 有时候会出现奇怪的问题,找不到文件啊,没有权限啊。这是最好的解决方法,就是重启服务器。有时候是配置未生效。 如果出现问题,或者是页面错误,可以查看这两个日志文件。 /var/log/nginx/host.access.log /var/log/nginx/error.log 至此,php8.3 已经安装完毕,并且虚拟主机也可以使用 php 的语言了。 SSL 证书的签发 如果是商用,或者愿意购买一年期的证书,DavidYin建议到 Gogetssl 购买,这里价格最优,无限重签,不限服务器。目前的证书可以购买5年的,但是实际签发的证书都是一年的,每年重新签发一次,直到购买的年份用完为止。买多年的会便宜一点。 Sectigo Essential SSL 一年的证书,$15.84;两年证书,$27.72;五年证书 $63.36。 Sectigo PositiveSSL 一年的证书,$7.70;两年证书,$13.48;五年证书 $30.80。 GoGetSSL Domain SSL 一年的证书,$4.50;两年证书,$7.88;五年证书 $18.00。 还有 Thawte, DigiCert,GeoTrust,RepidSSL 的证书可以选择。 目前我用下来还是 GoGetSSL 自己的 DV 证书最便宜。 Gogetssl 证书的好处是你买了一个证书给域名 A 用,如果这个域名不用了,还可以签发给域名 B 使用剩下的时间。 免费证书这里我采用 Zerossl 的 SSL 证书。使用了 Neilpang 的 ACME.SH 来安装。每月自动续签。 先安装工具。 curl https://get.acme.sh | sh -s email=seo@g2soft.net 接下来,重新登入SSH,相当于重新载入 BASH 环境,因为上面的安装已经把路径配置到 Bash 中了,并且自动创建了一个 bash 的别名,方便使用,直接输入 acme.sh 命令就可以了。另外还自动创建了一个 cronjob,每天零点自动检测所有的证书,如果快过期,就会自动更新。 验证域名的方式有两种,DNS 和 http,这次我用了 http 方式来验证。 davidyin@walnut:~$ acme.sh --issue -d u24.webexample.win --webroot /home/davidyin/u24.webexample.win [Mon Oct 7 16:37:46 PDT 2024] Using CA: https://acme.zerossl.com/v2/DV90 [Mon Oct 7 16:37:46 PDT 2024] Single domain='u24.webexample.win' [Mon Oct 7 16:37:48 PDT 2024] Getting webroot for domain='u24.webexample.win' [Mon Oct 7 16:37:48 PDT 2024] Verifying: u24.webexample.win [Mon Oct 7 16:37:49 PDT 2024] Processing. The CA is processing your order, please wait. (1/30) [Mon Oct 7 16:37:52 PDT 2024] Success [Mon Oct 7 16:37:52 PDT 2024] Verification finished, beginning signing. [Mon Oct 7 16:37:52 PDT 2024] Let's finalize the order. [Mon Oct 7 16:37:52 PDT 2024] Le_OrderFinalize='https://acme.zerossl.com/v2/DV90/order/-0HtI52SzVp9B1iWfXvHrw/finalize' [Mon Oct 7 16:37:53 PDT 2024] Order status is 'processing', let's sleep and retry. [Mon Oct 7 16:37:53 PDT 2024] Sleeping for 15 seconds then retrying [Mon Oct 7 16:38:09 PDT 2024] Polling order status: https://acme.zerossl.com/v2/DV90/order/-0HtI52SzVp9B1iWfXvHrw [Mon Oct 7 16:38:09 PDT 2024] Downloading cert. [Mon Oct 7 16:38:09 PDT 2024] Le_LinkCert='https://acme.zerossl.com/v2/DV90/cert/65Q_RSKwu-urE1DZVXE7FA' [Mon Oct 7 16:38:10 PDT 2024] Cert success. -----BEGIN CERTIFICATE----- MIIEBzCCA4ygAwIBAgIRANWHTHkkfhcpadmh96AqH5IwCgYIKoZIzj0EAwMwSzEL MAkGA1UEBhMCQVQxEDAOBgNVBAoTB1plcm9TU0wxKjAoBgNVBAMTIVplcm9TU0wg 中间省略 2u8271N/ejTHa2yuKuF4KiMP+BywmEifAjEAm/U9GoOqf7u/4yiVAAp6Neo5Nt5Q Xm/X1Y3+KB0c636aAkftFce8fXep9o5RXpB2 -----END CERTIFICATE----- [Mon Oct 7 16:38:10 PDT 2024] Your cert is in: /home/davidyin/.acme.sh/u24.webexample.win_ecc/u24.webexample.win.cer [Mon Oct 7 16:38:10 PDT 2024] Your cert key is in: /home/davidyin/.acme.sh/u24.webexample.win_ecc/u24.webexample.win.key [Mon Oct 7 16:38:10 PDT 2024] The intermediate CA cert is in: /home/davidyin/.acme.sh/u24.webexample.win_ecc/ca.cer [Mon Oct 7 16:38:10 PDT 2024] And the full-chain cert is in: /home/davidyin/.acme.sh/u24.webexample.win_ecc/fullchain.cer 验证正确,就会自动签发证书,证书会临时先存放在一个工作目录,现在我要指定一个目录存放: /home/davidyin/ssl/。 之后就是安装证书到该目录。 acme.sh --install-cert -d u24.webexample.win \ --key-file /home/davidyin/ssl/key \ --fullchain-file /home/davidyin/ssl/cert \ --reloadcmd "service nginx force-reload" 就这样,证书也签发好了,也安装到指定位置,接下来会介绍如何在 nginx 的配置文件中,设置证书路径,设置 https,设置重定向,还有 perl-fastcgi等等。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi 六部分 外传,优化网络和 PHP

2024/10/8
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(3)

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 在第一部分,DavidYin 介绍了如何在 DigitalOcean 创建新 VPS。并且完成基本的 Ubuntu 24.04 LTS的系统。 第二部分介绍如何安装 Webmin 主机控制面板,SSH 的安全设置,时区设置和添加新用户 。 下面 DavidYin 要说明一下如何用之前的新添加的用户来安装 Nginx Web 服务器和 MairaDB 数据库服务器。 第三部分 安装 Nginx Web 服务器 Ubuntu 24.04 LTS server 版目前的 Nginx 还是 Legacy 版本,可以直接安装,当前的最新版本是 1.24.0。 输入命令安装。 sudo apt install nginx 安装完成后,可以看一下安装后的版本以及编译信息 davidyin@walnut:~$ nginx -V nginx version: nginx/1.24.0 (Ubuntu) built with OpenSSL 3.0.13 30 Jan 2024 TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/nginx-DlMnQR/nginx-1.24.0=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/nginx-DlMnQR/nginx-1.24.0=/usr/src/nginx-1.24.0-2ubuntu7.1 -fPIC -Wdate-time -D_FORTIFY_SOURCE=3' --with-ld-opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic --with-http_perl_module=dynamic --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic 在浏览器中输入 IP 地址,就可以看到默认 Nginx 网页了。 安装 MariaDB 数据库服务器 它其实就是一个 MySQL 服务器,目前 Ubuntu 24.04 LTS 软件仓库中包含的默认 MariaDB 版本是 10.11.8,此版本是 MariaDB 官方所维护的多个稳定版本之一,在我粗浅的看来,10.4以上的这些个都是稳定版本。 所以也是直接安装就可以了。 输入安装命令。 sudo apt install mariadb-server 安装完成后,就需要修改 MySQL 默认的 root 用户的密码。默认是空密码。 sudo mysql_secure_installation 命令执行过程中的设置如下: 注意两点,一个是要设置MysQL 服务器的 root 密码,默认是没有密码的。其它的我都选的默认值。很多次看到某些网站被黑,说的都是数据库没有密码保护之类的疏忽。 davidyin@walnut:~$ sudo mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] Enabled successfully! Reloading privilege tables.. ... Success! You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 然后回到 Webmin 控制面板的地方,左侧: Refresh Modules,在经过一点点时间后, Webmin 系统自动就发现了我已经安装了 MySQL Databse Server。 在这里,可以用来添加新的数据库,新的Mysql 用户等等,都是为了以后添加网站,比如 Wordpress 之类的时候使用的。 至此两个服务器的安装已经完成,接下来就要介绍 php8.3-fpm 以及 Perl-fastcgi 的安装了。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi

2024/10/8
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(2)

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 在第一部分,DavidYin 介绍了如何在 DigitalOcean 创建新 VPS,选择基本的 Ubuntu 24.04 LTS的系统。 下面是介绍如何安装 Webmin 这个主机控制面板和 SSH 的安全设置。这非常重要,安全性的事情,如何小心都不为过。 第二部分 最初的安全更新 首先,我使用的是 Putty,这是一个 SSH 工具,先用 putty 登录 VPS,IP 地址可以登录到 DigitalOcean 后台看到,用户名就是 root,密码是自己设置的那个密码。 登录到 VPS 之后,一登录,就可看到显示着有 164个更新需要马上进行,其中有50个事安全更新。 执行 apt update,查询软件库的更新信息。 root@walnut:~# apt update Hit:1 http://mirrors.digitalocean.com/ubuntu noble InRelease Hit:2 http://mirrors.digitalocean.com/ubuntu noble-updates InRelease Hit:3 http://mirrors.digitalocean.com/ubuntu noble-backports InRelease Hit:4 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease Hit:5 http://security.ubuntu.com/ubuntu noble-security InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 160 packages can be upgraded. Run 'apt list --upgradable' to see them. 看到还是 160 个软件包可更新,于是执行更新命令。 root@walnut:~# apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following NEW packages will be installed: linux-headers-6.8.0-45 linux-headers-6.8.0-45-generic linux-image-6.8.0-45-generic linux-modules-6.8.0-45-generic linux-tools-6.8.0-45 linux-tools-6.8.0-45-generic The following upgrades have been deferred due to phasing: python3-distupgrade ubuntu-release-upgrader-core The following packages will be upgraded: apparmor apport apport-core-dump-handler base-files bind9-dnsutils bind9-host bind9-libs bsdextrautils bsdutils busybox-initramfs busybox-static cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf cryptsetup cryptsetup-bin cryptsetup-initramfs curl dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session dmeventd dmsetup dpkg dracut-install e2fsprogs e2fsprogs-l10n eject fdisk fwupd initramfs-tools initramfs-tools-bin initramfs-tools-core krb5-locales landscape-common libapparmor1 libblkid1 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc6 libc6-dev libcom-err2 libcryptsetup12 libcurl3t64-gnutls libcurl4t64 libdbus-1-3 libdeflate0 libdevmapper-event1.02.1 libdevmapper1.02.1 libexpat1 libext2fs2t64 libfdisk1 libfwupd2 libgnutls30t64 libgssapi-krb5-2 libhogweed6t64 libicu74 libk5crypto3 libkrb5-3 libkrb5support0 liblvm2cmd2.03 liblz4-1 liblzma5 libmount1 libnetplan1 libnettle8t64 libnss-systemd libopeniscsiusr libp11-kit0 libpam-systemd libproc2-0 libpython3-stdlib libpython3.12-minimal libpython3.12-stdlib libpython3.12t64 libsasl2-2 libsasl2-modules libsasl2-modules-db libseccomp2 libsmartcols1 libss2 libssl3t64 libsystemd-shared libsystemd0 libtiff6 libudev1 libuuid1 libzstd1 linux-headers-generic linux-headers-virtual linux-image-virtual linux-libc-dev linux-tools-common linux-virtual locales logsave lvm2 lxd-agent-loader mdadm motd-news-config mount needrestart netplan-generator netplan.io open-iscsi open-vm-tools openssh-client openssh-server openssh-sftp-server openssl overlayroot procps python-apt-common python3 python3-apport python3-apt python3-minimal python3-netplan python3-pkg-resources python3-problem-report python3-setuptools python3-twisted python3-update-manager python3.12 python3.12-minimal snapd systemd systemd-dev systemd-hwe-hwdb systemd-resolved systemd-sysv systemd-timesyncd thin-provisioning-tools tmux ubuntu-kernel-accessories ubuntu-minimal ubuntu-pro-client ubuntu-pro-client-l10n ubuntu-server ubuntu-standard udev update-manager-core util-linux uuid-runtime vim vim-common vim-runtime vim-tiny xkb-data xxd xz-utils zlib1g zstd 158 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. 43 standard LTS security updates Need to get 190 MB of archives. After this operation, 187 MB of additional disk space will be used. Do you want to continue? [Y/n] 选择 Y 继续,完成安装,中间会问你,SSHD配置文件是否要更改,我选择的是第二个选项,保持原来的版本。然后再次重启系统,对了重启命令是 shutdown now -r。 安装 Webmin 控制面板,SSH 安全设置 为什么要安装 Webmin? 主要就是我习惯使用,用了很多年了。一直在用 Webmin 管理面板,可以很方便的更新系统,安装 perl 包,添加 MySQL 数据库;第二,在出现错误的时候,查看 log 日志,还有很多很多其它功能。 安装 Webmin 参考 webmin 官方的安装 Webmin的方法。 先下载源库的文件。 curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh 然后执行下面命令来添加此库到系统: sh setup-repos.sh 添加完成后会有提示你使用下面的命令来安装 Webmin 和其所需的其它软件。 apt-get install webmin --install-recommends 安装完成之后,在桌面浏览器(比如 chrome)中输入下面的网址来访问安装好的 Webmin 控制面板。 https://143.110.227.68:10000 然后会出现"Your connection is not private"的警告信息,点击 Advanced 按钮,点击 "Proceed to 143.110.227.68 (unsafe)",就可以继续载入登录页面了。 看到登录页面,输入之前的 root 和对应的密码。 Webmin 默认安装的用户界面是响应式,之前我一直用的是经典样式,现在我也已经习惯使用响应式了。 登入之后,又看到有提示,两个软件包需要更新。一路点击更新之。 看看当前我所创建的这个 VPS 的参数: Operating system     Ubuntu Linux 24.04.1 Webmin version     2.202 Kernel and CPU     Linux 6.8.0-45-generic on x86_64 Processor information     DO-Premium-AMD, 1 cores Running processes     101 CPU load averages     0.06 (1 min) 0.11 (5 mins) 0.09 (15 mins) SSH安全设置 为了 SSH 的安全,我会在 TCP wrappers 处添加两条规则,只允许来自指定的 IP 地址的电脑以 SSH 的方式连上服务器。 左侧,Networking 》TCP Wrappers。 在 Allow 规则处,允许 ALL Services, Remote Hosts 的地方输入服务器 IP 和我所指定的IP,(就是我自己的 IP 地址)在 Deny 规则处,Services 填写 sshd ,Remote Hosts 选 All。 这样设置完成后,来自指定 IP 地址的 SSH 访问不会受影响,除此之外的 IP,若访问 SSH 服务的话,就会直接被拒绝。比如下面的记录可以看到,服务器才刚刚创立十分钟,就有莫名奇妙的 IP 试图以 root 身份连上 SSH,用不同的端口,尝试密码,当然出错返回,但都会消耗 VPS 资源,大多是自动扫描的工具,设置 TCP Wrapper 之后,就直接 refused 了,连密码尝试的机会都不会给。 查看日志记录: 左侧 System 》 System Logs RS 》File /var/log/auth.log Yes auth,authpriv.* 》点击 View,可以看到这么多尝试登录失败的。 添加新用户 Ubuntu 系统平时不建议以 root 用户直接登录操作,而是应该用普通用户,如果需要执行 root 用户的权限,那就采用 sudo 方式。下面就是在 Webmin 的管理面板中进行添加新用户。 在左侧,选择 System 》 Users and Groups, 然后选择 Create a new user,比如用户名输入 davidyin,选择 Normal password 输入自己设定的密码,当然更安全的是使用 SSH public key的方式来登入, Shell 这块我会选择 /bin/bash ,然后在 primary group 的地方,默认是选择已存在的用户组 users。在 Second group 的地方我会把 sudo 组加入,这样以后就只用登入这个用户来操作,即使执行更高权限的操作,也只需要 sudo 就可以了。 为什么没有安装 FTP 服务器? 很多年前,我有用 proftpd 作为 VPS 上的 FTP 服务器,但是后来觉得既然可以直接使用 SFTP,就是 SSH File Transfer Protocol,简而言之,就是利用 SSH 来传输文件的方式,为什么还要安装 FTP服务器呢?第一,ssh 更加安全;第二,服务器上可以少安装一样服务,节约内存,并且少一个可能的安全漏洞。 设置时区 设置时区就可以自动把系统时间同步到我所在的本地时间。 左侧,Hardware 》 System Time, 选择 Change Timezone 标签,在时区修改的下拉菜单,改为 America/Vancouver (Pacific -BC (most areas)),点击保存。现在 VPS 显示的时间就是我所在的温哥华地区了。 但是时钟走着走着就会不准的,需要定时校正,所以左侧,Hardware 》 System Time, 选择 Time Server sync 标签,设置看下图。 就是设置每天都会有一次校正。 这里我发现没有过去设置一直需要的 Timeserver 地址,于是回到 SSH 窗口,执行下面命令安装必要软件包。 apt install ntpdate sntp 然后回到 Hardware 》 System Time, 选择 Time Server sync 标签,可以看到多了一个输入框,原来是 0.pool.ntp.org,修改为 ca.pool.ntp.org。然后点击 Sync and Apply 按钮,完成修改更新。 至此, Ubuntu 24.04.1 LTS,Webmin控制面板,以及时区设置,SSH的安全设置都完成了。接下来是介绍如何安装 Nginx Web 服务器,MariaDB数据库服务器,php等等。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi 六部分 外传,优化网络和 PHP

2024/10/8
articleCard.readMore

安装 Ubuntu 24.04 (LTS), Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS(1)

Ubuntu 24.04.1 LTS 在八月三十日已经发布了,一般到这个版本就想当的稳定了,所以今天就来介绍如何安装 Ubuntu 22.04 (LTS), Webmin, Nginx, MariaDB, PHP-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS。 回顾一下,过去几年,我所写的相关的教程。 在2015年,我发布了 安装Nginx, MySQL, PHP-FPM, Perl-Fastcgi到Ubuntu 14.04 LTS 在2017年,我发布了 安装 Ubuntu 16.04, Webmin, Nginx, MariaDB, PHP7.1-FPM,Perl-Fastcgi 到 Vultr.com 的 VPS 在 2018年, 则是发布了 安装 Ubuntu 18.04, Webmin, Nginx, MariaDB, PHP7.2-FPM,Perl-Fastcgi 到 Linode 的 VPS 在2020年,发布了 安装 Ubuntu 20.04, Webmin, Nginx, MariaDB, PHP7.4-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 在 2022年, 发布了 安装 Ubuntu 22.04 (LTS), Webmin, Nginx, MariaDB, PHP8.1-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 本站曾经就是放在了 DigitalOcean ,所以 DavidYin 来介绍一下新的 VPS 服务器安装过程,包含的软件如下: Ubuntu 24.04.1 LTS Webmin 2.202 Mariadb 10.11.8 Nginx 1.24.0 php8.3-FPM Perl Fastcgi SSL HTTP2 ZeroSSL 免责:整个安装过程,只是个人经验,不含任何保证,采用者自己对服务器的安全以及数据负责。 第一部分 DigitalOcean VPS 的选择与安装 登录 DigitalOcean 的后台,然后在 Projecs 选择一个 Project,没有的话,就新建一个。Project 是用来组织资源的,比如多个 vps,还有各种其它的服务。点击右上角的 Create,打开下拉菜单,选择第一个 Droplets。Droplets就是 DigitalOcean 的 VPS 的昵称。这家服务商名称叫做数字海洋,那么每个 VPS 就像是海洋中的一滴水珠。就是这么个意思。然后就出现新建 VPS 的选项了。 首先,选择地区,也是机房位置,比如我这里选择了 旧金山的 3 号机房。(选择机房的原则就是距离你自己近一点) 然后是选择 VPC Network,我选择了默认值,这个网络设置的用处是可以在同一个 VPC 网络内,你使用的服务以私有 IP 地址进行通讯,不会暴露到公网上。 镜像选择部分,点击 Ubuntu,在版本选择下拉菜单,选择 Ubuntu 24.04 (LTS) x64 版本。可以注意到在OS的边上,还有一个 Marketplace(246) 和自定义镜像,其中 Marketplace 就是很多第三方做好的镜像,可以直接使用。 而自定义镜像则是你自己上传的。 接着是 Plan,就选择基本计划, Basic, CPU 呢有三种不同的类型,一般都是选择 Premium CPU(Intel 和 AMD 都可以,看你自己的喜好。之后就是在不同配置中选择最小的那个,暂时就可以了,包括了 1CPU, 1GB RAM, 25GB 的 NVMe SSD 储存,和 1000GB 的流量。如果以后需要扩容,可以直接升级计划,无需重装的。这里我选择了 AMD 的。 接下来是一些杂项,比如 Additional Storage,额外的储存空间,比如套餐内的25GB不够的话,可以选。是否启用自动备份功能,这两个启用,需要额外付费。 在认证方面,默认是要使用 SSH Key来认证的,为了简单起见,我选择了密码,然后在下面输入自己选择的 root 密码。之后会有加强安全的方式。 下面还有一些 DigitalOcean 的推荐选项,记得点击 Advanced Options,打开另外两个,我会选择启用 IPv6。 最后一部分就是问你要生成多少个同样配置的 VPS,当然选择 1了,然后我给了一个主机名称,walnut,核桃的意思。DigitalOcean 可以用 tags 来管理 VPS的,而我没有用,就用了 Project 来组织,这里我选择了我之前预设好的 SEO Blog 这个计划,点击 Create Droplet 按钮。 我掐着秒表看了一下,点击创建按钮后,大约25秒就完成了。到了这个 Project 界面,可以看到一个 VPS 名字叫做 walnut已经在这里了。也可以看到 IP 地址。 点击这个 Walnut 名称,可以进入该 VPS 的详细页面。 这里的 IPv4地址 143.110.227.68,只是用来示例,当你看到本文时,可能已经销毁了。后面的介绍还是用此 IP 地址举例,请不要尝试访问。 好了,有了这些信息,就可以连接 VPS了,我用的是 Putty工具。用之前自己设定的 root 密码就可以。登入成功后,先重启一次。 目前这个VPS 就是一个 DigitalOcean 的干净 Server 系统,只有 SSH 服务安装在上面。 接下来,DavidYin 会分四篇来分别介绍,如何在 Ubuntu 24.04 LTS 服务器系统上安装 Webmin 控制面板,Nginx Web 服务器,MariaDB 数据库服务器,php8.3-FPM,以及 Perl-Fastcgi 和配置 SSL证书等内容。 安装 Ubuntu 24.04, Webmin, Nginx, MariaDB, PHP8.3-FPM,Perl-Fastcgi 到 DigitalOcean 的 VPS 第一部分 安装 DigitalOcean VPS 裸系统 第二部分 安装 Webmin 控制面板,SSH 安全设置 第三部分 安装 Nginx Web 服务器,安装 MariaDB 服务器 第四部分 安装 php8.3-fpm,设置主机,签发免费 SSL 证书 第五部分 配置 https 主机,安装 perl-fastcgi 六部分 外传,优化网络和 PHP

2024/10/8
articleCard.readMore

审计你的网页的各项指标

此文就是整理过去几年至今,对网站做审计的方式和相关的内容。 所谓审计,就是 Audit,我们有时候也称之为审定。简单的说,就是通过手工检查,或者使用工具来对网站以及网页做个体检,看看有哪些地方做的好的,哪些地方不够的,哪些地方做错了。当然主要的目标就是搜索引擎的排名优化,其次就是用户体验。 在一开始的时候,我们先来把我们认为重要的审计的点都列出来,然后介绍如何使用工具,以及一些比较好用的工具。 准备工作 Google Analytics GA4 追踪代码安装 Google Search Console 设置 基础审计项目 检查网站是否是移动友好 Mobile-Friendly 确定 Google 收录了你的网站 提高网站的载入速度 检查并修复那些收录有问题的页面 查看来自搜索引擎的自然流量 改善网页的关键词排名 分析反向链接,外链的情况 修复断链 竞争对手网站的分析 用户界面的优化 网站结构的扁平化 Meta 以及结构数据的展示 Title 标签内容 Keywords 标签内容 Favicon 图标设置 OG 和社交媒体元数据 结构化数据 Sitemap 提交 进阶审计项目 移动设备友好优化 标准化验证,HTML5等 Web 服务器的优化 高级审计项目 从内部链接获取更多的流量 从 404 页面获取更多的流量

2023/12/31
articleCard.readMore

最近在学习研究的几个东西

书籍 最近其实看了好几本书,主要都是关于 CI/CD 的,因为我用的是 Gitlab CE 自建的服务器,这些 CI/CD 也是考虑如何在这个上面实现的。 《Automating DevOps with Gitlab CI/CD Pipelines》 《Cleancode in PHP》 这是看了有关 PHP 开发的一些标准做法,也许可以让开发的过程更加简单一些,代码也能更标准化一些,书中也写了如何通过 CI 来完成这些语法检查,代码样式标准化,以及静态分析的工作。 还有看了基本有关 Docker 的书,学习了如何使用 Docker ,毕竟 Gitlab CI/CD 的很多时候,会用到 Docker 作为 Executor。 关于宗教的书也看了一些,大致是有关圣经,三大宗教的起源和渊源。有关上海历史建筑的书也看了一本。 CDN 有关 CDN 的,这些天测试使用了一家新的服务,BunnyCDN,看上去价格也不错,最低$0.01/GB,POPs 也有100多个,设置很方便,在我实际使用的过程中,可能我使用的 VPS 性能比较好,带宽也好,用了 CND 和不用 CDN 差别很小,都在误差之内。也许对于那些性能不够好,或者带宽小的站长会有比较大的改善。 Email server 使用自建 Email 服务器也有一段时间,最近在研究的是如何设置好 Email 相关的 DNS 记录,以及设置 DMARC记录后,如何收取报告,在页面中展示出来。 目前看到的就只有Microsoft 和 Gmail 会有报告发给指定邮箱。下面是一个我使用的 DMARC 报告截图。

2023/11/21
articleCard.readMore

十月更新

DigitalOcean 新出的 Premium General Purpose Droplets 据他们内部的测试,这种类型比普通的 VPS 快26% 到27%。网速快五倍,Nvme储存的读写速度都有很大的提高,价格也贵一点点。 Google Adsense 自动穿插广告 您可以选择向用户展示穿插广告的频率。通过选择穿插广告的频率,您可以控制用户要过多长时间才会再次看到穿插广告。 每当用户离开或返回页面时,系统都会展示穿插广告。如果自上次向用户展示穿插广告以后,经过了所设置的频率,系统就会再向用户显示一次穿插广告。通过调整频率,您可以控制用户在您的网站上看到穿插广告的频率。 默认的穿插广告频率设为 10 分钟。您可以自行选择频率(1 分钟到 1 小时),具体取决于您想向用户展示的穿插广告数量。例如,如果您希望通过穿插广告获得尽可能多的收入,您可以选择最低频率设置(1 分钟)。如果您希望用户看到较少的广告,则可以设置较高的频率(例如,10 分钟或更长时间)。 SixApart 发布了 MovableType R5501 版 有不少的变化,包括了安全补丁。 https://movabletype.org/news/2023/10/mt-79020-released.html 估计已经在对升级到 v8 做准备了。 MovableType 8.0.2 发布了 这是在10月31日晚上,我看到的消息,刚刚也下载了完整安装包,不过尚未升级测试。 这里有官方的介绍。 看上去,MovableType 的发布节奏和支持策略都有了一些变化,需要关注。 至于个人版会变成什么样子,待我看了再说。

2023/11/1
articleCard.readMore

九月新的变化

最近都在看一些杂七杂八的内容,也看到了很多不一样的变化,比如下面这些。 排名不分先后,只是随便记录。 Cloudflare 正式推出 ECH(Encrypted Client Hello) ECH 对于隐私保护的最后一块拼版 主要的效能就是启用后,用户访问的实际域名都是被加密的了,中间人是看不到用户到底在访问哪个网站的了。 树莓派 5 即将发行 我是有几块树莓派的,虽然用处不多,但还是在关心着。最近的消息就是 Raspberry Pi 5 十月就要上市了,看看技术指标。 Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU, with cryptography extensions, 512KB per-core L2 caches and a 2MB shared L3 cache VideoCore VII GPU, supporting OpenGL ES 3.1, Vulkan 1.2 Dual 4Kp60 HDMI® display output with HDR support 4Kp60 HEVC decoder LPDDR4X-4267 SDRAM (4GB and 8GB SKUs available at launch) Dual-band 802.11ac Wi-Fi® Bluetooth 5.0 / Bluetooth Low Energy (BLE) microSD card slot, with support for high-speed SDR104 mode 2 × USB 3.0 ports, supporting simultaneous 5Gbps operation 2 × USB 2.0 ports Gigabit Ethernet, with PoE+ support (requires separate PoE+ HAT) 2 × 4-lane MIPI camera/display transceivers PCIe 2.0 x1 interface for fast peripherals (requires separate M.2 HAT or other adapter) 5V/5A DC power via USB-C, with Power Delivery support Raspberry Pi standard 40-pin header Real-time clock (RTC), powered from external battery Power button 这些够用了吗? Tomshardware 网站已经出了评测,也有很多的图片。 ChatGPT 对网站内容的抓取 Zac 老师的文章,谈到了各大 AI 厂商,推出的一个简单解决方案,给那些不愿意提供网站内容给 AI 的网站。 基本上就是在 Robots.txt 里面添加规则,当 AI 蜘蛛处理。 AI 语音合成的问题 最近看到几个例子,用 AI 合成自己的语音,会让人误以为真,语气语调非常逼真。 大家要小心,电话骗子会多一个手段了。就怕流氓会武术,谁都挡不住。 刺客信条:幻景 刺客信条系列游戏,我是一个都没有落下,这次的最新作品,早几个月就在 Xbox 上预订了,上个礼拜,Xbox 已经下载了游戏,只是还要等到发售日期才能开始玩,也就是 10月 5日。 最近几天 X 上面都是它的广告。 自己还在学习一些对我来说还是比较新的东西,比如docker,K8, Dmarc 等等。

2023/10/1
articleCard.readMore