持续更新,  计算机,  资源

WordPress博客搭建

视频

教程

https://help.aliyun.com/document_detail/405635.htm? 换源
https://help.aliyun.com/document_detail/173042.htm? 环境
https://help.aliyun.com/document_detail/184111.html Word-Press
按上面两个教程,第一个教程安装LNMP,第二个教程安装MySQL、WordPress

升级PHP

升级centos到centos stream 这样才能使用remi repository
dnf -y install centos-release-stream
dnf -y swap centos-{linux,stream}-repos
dnf -y distro-sync

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf module list php

dnf module enable php:remi-7.4

dnf install php php-cli php-common

命令

systemctl restart nginx
systemctl restart php-fpm


update wp_options set option_value = "http://120.27.197.248/" where option_name = "siteurl" or option_name = "home";

要执行这个,否则会需要ftp
chown -R nginx /usr/share/nginx/html/wordpress
上传图片还需要chmod -R 755 wp-content,让文件夹可写

更新wordpress的时候只需要下载新的WordPress包即可https://cn.wordpress.org/download/releases/
搭建 https://help.aliyun.com/document_detail/60152.html
问题排查 https://blog.csdn.net/weixin_34128501/article/details/92724684</p>

https证书

免费证书
https://help.aliyun.com/document_detail/98574.html
配置
https://help.aliyun.com/document_detail/98728.html

如果图片加载不出来,到设置里把图片链接换掉。如果是主题背景图片加载不出来,到自定义里重新上传下图片。

FTP配置规则

https://help.aliyun.com/document_detail/60152.html

https://ecs.console.aliyun.com/#/securityGroupDetail/region/cn-hangzhou/groupId/sg-bp107z8x77mm0s5a466m/detail/intranetIngress

解除上传大小限制

vi /etc/nginx/nginx.conf 在http里加一行 client_max_body_size 1000m;
php.ini文件 /etc/php.ini
upload_max_filesize = 32M
post_max_size = 64M
memory_limit = 128M

备份

/usr/share/nginx/html/wordpress/wp-content/updraft
利用另一台实例测试备份功能

备份软件有一个就可以了

主题底部

改样式:在主题的自定义css里面加 想改哪块就自己在网页上抓取 改颜色、位置都可以

在footer.php里修改
printf( esc_html__( '%1$s','京ICP备2021015005号-3' ), '<a href="' . esc_url( 'http://beian.miit.gov.cn/' ) . '">京ICP备2021015005号-3</a><br>' );
					printf( esc_html__( '%1$s','京ICP备2021015005号-1' ), '<a href="' . esc_url( 'http://beian.miit.gov.cn/' ) . '">京ICP备2021015005号-1</a>' );

修改404页面

/etc/nginx]$vi nginx.conf

error_page 404 /?page_id=306; //改成自己想要的页面

systemctl restart nginx

插件

bbpress 社区论坛

FooGallery 好看的图库

API

只要你搭建好WordPress,并且Permalink的形式不是数字,就有API

https://qlili.com/wp-json/wp/v2/posts

最后更新于 2023年8月3日 by qlili

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
1
0
Would love your thoughts, please comment.x
()
x