本文最后更新于 212 天前,其中的信息可能已经有所发展或是发生改变。
只是迁移了一下,从原本的Hexo
到WordPress
关于我的博客
1.这个博客,主要用来记录在参加CTF
时的WriteUp
2.部分学习过程中走过的弯路
3.偶尔记录生活~(大概率懒得写~~
4.风景,照片~(好歹曾经也算是航拍爱好者~~
5.可能还有其它的东西,可能……
建站记录
Install
apt-get update
apt install apache2 mysql-server php-gd php-fpm php-mysql libapache2-mod-php wget mlocate -y
mv /var/www/html/index.html /var/www/html/index~.html
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
tar -xzvf latest-zh_CN.tar.gz
cp wp-config-sample.php wp-config.php
chmod -R 777 ./wp-content
Mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_pwd';
CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'db_pwd';
CREATE DATABASE db_name;
GRANT ALL PRIVILEGES ON db_name.* TO 'db_user'@'localhost' WITH GRANT OPTION;
export sql:
mysqldump -u root -p wordpress > wordpress.sql
import sql:
mysql -u root -p
create database wordpress;
use wordpress;
source /path/wordpress.sql
php.ini
/etc/php/7.4/apache2/php.ini
max_execution_time = 0
post_max_size = 1024M
upload_max_filesize = 1024M
手动安装插件
./wp-content/plugins/*
手动安装主题
./wp-content/themes/*
avatar
在 Gravator 设置
更换 IP
select * from wp_options where option_value like '%old_ip%';
update wp_options set option_value=replace(option_value,'old_ip','new_ip') where option_value LIKE '%old_ip%';
更换图源
update wp_posts set post_content=replace(post_content,'old','new') where post_content LIKE '%old%';
wp-config
不启用 FTP
define('FS_METHOD', 'direct');
footer
<span id="momk"></span>
<script language=javascript>
function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("03-09-2023 21:20:00"); //建站日期
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(daysold-e_daysold)*-24;
hrsold=Math.floor(e_hrsold);
e_minsold=(hrsold-e_hrsold)*-60;
minsold=Math.floor((hrsold-e_hrsold)*-60);
seconds=Math.floor((minsold-e_minsold)*-60);
momk.innerHTML="本站已不稳定运行:"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒" ;
}
show_date_time();
</script>
<style>
#momk{animation:change 10s infinite;font-weight:800; }
@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}
</style>