Monthly Archives: 十二月 2024

Xrea空间wordpress绑定多个域名

一、登录Xrea 空间管理后台:https://cp.xrea.com/account/login/

二、域名A记录到K2空间IP,等待生效之后域名设置绑定。这里会强制A记录检查。

三、接着是站点设置:提供免费的SSL,几分钟-十几分钟生效。多个域名绑定一个站点目录。

四、需要修改wp-config.php

define( 'WP_DEBUG', false );

下面添加如下代码(除你在站点设置的主域名外都需要填写进去)

$domain = array("域名A", "域名B", "域名C");
if(in_array($_SERVER['HTTP_HOST'], $domain))
{
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
}
define( 'WP_CONTENT_URL', '/wp-content');

Tips:

编辑PHP配置文件最好用Visual Studio Code。避免格式出错导致wordpress跳500错误。

若出现500错误进不了wp-admin。解决办法:把wp-config.php备份后将网站目录下原文件删掉,重新运行wordpress安装程序,填写原数据库账户密码表前缀会自动生成一份。期间会提示你已经安装wordpress,数据不会丢失。

Twenty Thirteen主题CSS修改

wordpress3.8的主题能看得过去的 好像比较少

Twenty Thirteen 观感还说得过去,要说很好看吧,那倒是没有。

默认主题不修改,输出效果比较尴尬。

搜索修改了style.css

输出效果还能过得去

style  有兴趣的可以去下载修改。

Argon主题推荐

项目地址:https://github.com/solstice23/argon-theme
WordPress后台上传安装主题
导入设置 搞定~ 自定义选项比较多,容易美化。

bash

{"argon_theme_color":"#74787b","argon_theme_color_hex_preview":"#74787b","argon_show_customize_theme_color_picker":true,"argon_enable_immersion_color":"false","argon_darkmode_autoswitch":"false","argon_enable_amoled_dark":"false","argon_card_radius":"4","argon_card_shadow":"default","argon_page_layout":"double","argon_article_list_waterflow":"1","argon_article_list_layout":"1","argon_font":"sans-serif","argon_assets_path":"jsdelivr_fastly","argon_custom_assets_path":"","argon_wp_path":"/","argon_dateformat":"YMD","argon_enable_headroom":"false","argon_toolbar_title":"","argon_toolbar_icon":"https://uinoc.com/wp-content/uploads/2024/12/logo.jpg","argon_toolbar_icon_link":"https://uinoc.com","argon_toolbar_blur":"false","argon_banner_title":"","argon_banner_subtitle":"","argon_banner_size":"fullscreen","argon_page_background_banner_style":"transparent","argon_show_toolbar_mask":true,"argon_banner_background_url":"","argon_banner_background_color_type":"shape-primary","argon_banner_background_hide_shapes":false,"argon_enable_banner_title_typing_effect":"false","argon_banner_typing_effect_interval":"100","argon_page_background_url":"https://www.notion.so/images/page-cover/woodcuts_4.jpg","argon_page_background_dark_url":"","argon_page_background_opacity":"0.9","argon_sidebar_banner_title":"","argon_sidebar_banner_subtitle":"--hitokoto--","argon_sidebar_auther_name":"","argon_sidebar_auther_image":"https://uinoc.com/wp-content/uploads/2024/12/logo.jpg","argon_sidebar_author_description":"求知若饥,虚心若愚 Never be satisfied, and always push yourself. Do (or be willing to keep trying) the things people say cannot be done.","argon_sidebar_announcement":"求知若饥,虚心若愚 Never be satisfied, and always push yourself. Do (or be willing to keep trying) the things people say cannot be done.","argon_fab_show_settings_button":"true","argon_fab_show_darkmode_button":"true","argon_fab_show_gotocomment_button":"true","argon_seo_description":"","argon_seo_keywords":"docker, Linux, notionnext, wordpress","argon_article_meta":"author|time|views|categories","argon_show_readingtime":"true","argon_reading_speed":"300","argon_reading_speed_en":"160","argon_reading_speed_code":"20","argon_show_thumbnail_in_banner_in_content_page":"false","argon_first_image_as_thumbnail_by_default":"false","argon_reference_list_title":"参考","argon_show_sharebtn":"domestic","argon_show_headindex_number":"true","argon_donate_qrcode_url":"","argon_additional_content_after_post":"","argon_related_post":"tag","argon_related_post_sort_orderby":"rand","argon_related_post_sort_order":"DESC","argon_related_post_limit":"5","argon_article_header_style":"article-header-style-default","argon_outdated_info_time_type":"modifiedtime","argon_outdated_info_days":"1095","argon_outdated_info_tip_type":"inpost","argon_outdated_info_tip_content":"本文最后更新于 %date_delta% 天前,其中的信息可能已经有所发展或是发生改变。","argon_archives_timeline_show_month":"true","argon_archives_timeline_url":"https://uinoc.com/history","argon_footer_html":"
Copyright ©2022 版权所有 观语
","argon_enable_code_highlight":"true","argon_code_theme":"agate","argon_code_highlight_hide_linenumber":"false","argon_code_highlight_break_line":"true","argon_code_highlight_transparent_linenumber":"false","argon_math_render":"none","argon_mathjax_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js","argon_mathjax_v2_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML","argon_katex_cdn_url":"//cdn.jsdelivr.net/npm/katex@0.11.1/dist/","argon_enable_lazyload":"true","argon_lazyload_threshold":"800","argon_lazyload_effect":"fadeIn","argon_lazyload_loading_style":"1","argon_enable_fancybox":"true","argon_enable_zoomify":"false","argon_zoomify_duration":"200","argon_zoomify_easing":"cubic-bezier(0.4,0,0,1)","argon_zoomify_scale":"0.9","argon_enable_pangu":"false","argon_custom_html_head":"","argon_custom_html_foot":"","argon_enable_smoothscroll_type":"1","argon_enable_into_article_animation":"false","argon_disable_pjax_animation":"false","argon_comment_pagination_type":"feed","argon_comment_emotion_keyboard":"true","argon_hide_name_email_site_input":"false","argon_comment_need_captcha":"true","argon_get_captcha_by_ajax":"false","argon_comment_allow_markdown":"true","argon_comment_allow_editing":"true","argon_comment_allow_privatemode":"false","argon_comment_allow_mailnotice":"true","argon_comment_mailnotice_checkbox_checked":true,"argon_comment_enable_qq_avatar":"true","argon_comment_avatar_vcenter":"false","argon_who_can_visit_comment_edit_history":"admin","argon_enable_comment_pinning":"true","argon_enable_comment_upvote":"true","argon_comment_ua":"platform,browser","argon_show_comment_parent_info":"true","argon_fold_long_comments":"false","argon_gravatar_cdn":"","argon_text_gravatar":"false","argon_enable_search_filters":"true","argon_search_filters_type":"post,page,shuoshuo","argon_pjax_disabled":"false","argon_hide_categories":"","argon_enable_login_css":"true","argon_home_show_shuoshuo":"false","argon_fold_long_shuoshuo":"false","argon_enable_timezone_fix":"false","argon_hide_shortcode_in_preview":"false","argon_trim_words_count":"175","argon_enable_mobile_scale":"true","argon_disable_googlefont":"false","argon_disable_codeblock_style":"false","argon_update_source":"stop","argon_hide_footer_author":"true"}
Bash

在Serv00上搭建halo博客

参考文章:https://blog.xjfkkk.top/post/halo

在Serv00上搭建Halo博客的步骤包括:开放端口、将域名托管到Serv00、删除public_html中的文件、创建MySQL数据库、安装Halo、创建配置文件、编写启动和重启脚本、赋予脚本权限,并设置定时任务以自动重启服务。

1.开放一个端口并开启应用权限

notion image
notion image

2.将域名托管到serv00并创建Website

域名托管不在这里叙述,可以看这部分,也可以使用CF进行托管

notion image
notion image

创建Website

3.进入文件管理后台删除public_html中的文件

4.创建mysql数据库

记住你创建的数据库,等会需要用

notion image

5.安装halo

进入你的域名目录并创建halo文件

cd /usr/home/你的serv名字/domains/域名/public_html && mkdir halo

进入halo目录并下载halo

cd halo && wget https://dl.halo.run/release/halo-2.20.9.jar -O halo.jar

5.创建.halo文件并创建application.yaml文本

进入文件管理器后台,在Jar包同级目录创建.halo文件,并在其中创建application.yaml文本,将下面代码放入其中

notion image

server:
  port: PORT
  # Response data gzip.
  compression:
    enabled: false
spring:
  #sql:
  #  init.platform: mysql
  r2dbc:
    url: r2dbc:pool:mysql://数据库地址:3306/数据库名
    username: 数据库用户名
    password: 数据库密码
halo:
  # Your admin client path is https://your-domain/{admin-path}
  admin-path: admin
  # memory or level
  cache: level

PORT替换为你放行的端口 将数据库地址:3306/数据库名数据库用户名数据库密码替换为你创建的

6. 在Jar包同级目录新建文件run.sh文本

bash

#!/bin/bash
export HALO_WORK_DIR="/usr/home/serv00账号名/domains/域名/public_html/halo/.halo"
export HALO_EXTERNAL_URL="https://xxxxx.com"
java17 -server -Xms128m -Xmx256m -jar -Duser.timezone=Asia/Shanghai /usr/home/serv00账号名/domains/域名/public_html/halo/halo.jar --spring.config.additional-location=/usr/home/serv00账号名/domains/域名/public_html/halo/.halo/application.yaml

serv00账号名域名https://xxxxx.com替换为自己的

notion image

7.创建restart.sh文本

在jar包同级目录创建restart.sh

#!/bin/bash

# 设置脚本路径
SCRIPT_PATH="/usr/home/serv00账号名/domains/域名/public_html/run.sh"
WORK_DIR="/usr/home/serv00账号名/domains/域名/public_html"
![image|690x340](upload://nAVB314l5Ad8qhlxoZLdXky6iSA.png)

# 检查脚本是否在运行
if ! pgrep -f "$SCRIPT_PATH" > /dev/null
then
    # 如果脚本没有运行,则重新启动它
    cd "$WORK_DIR"
    nohup ./run.sh > /dev/null 2>&1 &
    echo "Restarted run.sh at $(date)" >> "$WORK_DIR/restart_log.txt"
fi

8. 赋权你创建的文本

赋权run.sh

chmod +x /usr/home/serv00用户名/domains/域名/public_html/halo/run.sh

赋权restart.sh

chmod +x /usr/home/serv00用户名/domains/域名/public_html/halo/restart.sh

9.在CF上保活

后记:尝鲜可以,内存已经超限了。

notion image
notion image

参考文章

https://github.com/V-Official-233/halo-PaaS

https://docs.halo.run/getting-started/install/jar-file

一张图看懂用Cloudflare给网站加速,适用于Serv00

一张图看懂给网站加速,适用于Serv00等所有可以绑定域名的空间

教程来自于技术爬爬虾抖音视频截图,详细可以搜索查看相关教程。

CFCDN-1
这里补充文字说明:

设置主域名com为A,CDN TOP域名为B,ORIGIN为C

主域名A和B都托管到Cloudflare

服务器或者空间绑定主域名A, 主域名CNAME 到B

CFCDN-2
B域名DNS设置 CNAME至优选IP域名 仅DNS

优选域名:https://www.wetest.vip/page/cloudflare/cname.html

B域名的DNS设置创建C域名 IP指向服务器 需要打开小黄云
CFCDN-3
在域名B的SSL里添加SAAS服务,需要绑定支付方式。
CFCDN-4
回退源设置成C
CFCDN-5
自定义主机名为主域名A,TXT验证完毕后流程结束。
CFCDN-6
现在捋一下流程:访问A主域名,通过优选IP到达CF的CDN服务器,CF服务器查看请求网址为A直接把A请求回退给C,C域名最终指向网站服务器。

 

Serv00空间安装NotionNext

项目地址:https://github.com/tangly1024/NotionNext

作者博客:https://docs.tangly1024.com/article/deploy-notion-next-on-vps

参考文章:https://blog.xjfkkk.top/post/notionnext

参考文章作者的已经yarn build的链接文件失效,无奈自己安装build

Notion Next:https://uinoc.com/notion/NotionNext.zip

实例:https://blog.network.za.org

安装攻略

1、SSH到S14 切换目录至域名public_html文件夹

在线SSH网页工具

https://webssh.linux-do.rr.nu

git clone https://github.com/zjmkkk/NotionNext && cd NotionNext
wget -O next-build.zip "https://alist.xjfkkk.rr.nu/d/NotionNext/next-build.zip?sign=X35V1hZsX2z7XvsIGvwzMWpnjfqbMIBO1bK92ZdcPaU=:0" && unzip next-build.zip
serv00-1

2、yarn运行

NotionNext 目录内运行

yarn install

serv00-2

3、按照参考文章里的计划任务运行

serv00-3

4、结束。

至于保活,之后文章研究。

Serv00 波兰3G革命性免费空间+免费企业邮箱+免费DNS解析

Serv00已更新至150000

serv00-1

 

提供3GB容量SSD存储空间,不限单个文件大小,不限月流量,支持PHP(可切换版本)、Python、Ruby、Node.js、Java、TCL/TK、Go、Rust、RoR、C++、Django等。Serv00免费空间提供yourname.serv00.net免费二级域名1个,可以绑定自己的域名,最多可创建100个网站,可创建10个MySQL、3个PostgreSQL和3个MongoDB数据库,3个GIT/SVN/HG仓库,支持SSH,可开启3个TCP/UDP端口,FTP、在线方式上传管理文件,可签发部署Let’s Encrypt的SSL证书,每日自动备份(保存7天)。

Serv00免费空间限制系统进程最多15个,PHP解释器最多3个,内存使用最多512MB,PHP执行时间限180秒。

Serv00提供的免费企业域名邮箱可创建无限个邮箱账号,支持POP3、SMTP、IMAP以及WEB收发邮件,支持Catch-ALL,支持SPF、SKIM可避免你发送的邮件被拒或进入垃圾箱。Serv00免费企业邮箱采用Roundcube Webmail程序,邮箱界面有简体中文版,普通附件可达150MB,当然也要对方邮箱支持,否则也发不过去。

Serv00还提供免费域名DNS解析功能,支持为顶级域名、二级域名甚至N级域名进行DNS解析, 可添加A、AAAA、CNAME、MX、NS、SRV、TXT记录,TTL值最小可设为10。

Serv00自称革命性的免费空间,确实不算自吹自擂,一般免费空间真给不了这么全的功能!

注意:虽然Serv00后台显示有效期到2033年,也就是10年有效期,但Serv00在其官方论坛指出有效期和CT8.PL一样都是90天,所以请注意90天内登录一次Serv00主机管理面板或者SSH、SFTP。

Serv00免费空间和CT8.PL免费空间的主要区别

  • Serv00账号额度有150000个,更好申请,CT8账号额只有5000个。
  • Serv00服务器使用的SSD硬盘,CT8服务器使用HDD硬盘。
  • Serv00系统进程限15个,CT8系统进程限20个。
  • Serv00服务器位于波兰华沙Atman数据中心,CT8服务器位于德国Hetzner数据中心。

Serv00官网

Serv00免费空间演示

Serv00免费空间申请