搭建wordpress个人博客

安装 xampp 自动配置包

Change the permissions to the installer

chmod 755 xampp-linux-*-installer.run

Run the installer

sudo ./xampp-linux-*-installer.run

That's all. XAMPP is now installed below the /opt/lampp directory.

To start XAMPP simply call this command:

sudo /opt/lampp/lampp start

To fix most of the security weaknesses simply call the following command:

sudo /opt/lampp/lampp security

It starts a small security check and makes your XAMPP installation secure. For example this protects the XAMPP demo pages by a username ('lampp') and password combination.

How do I enable access to phpMyAdmin from the outside?

In the basic configuration of XAMPP, phpMyAdmin is accessible only from the same host that XAMPP is running on, at http://127.0.0.1 or http://localhost.

IMPORTANT: Enabling external access for phpMyAdmin in production environments is a significant security risk. You are strongly advised to only allow access from localhost. A remote attacker could take advantage of any existing vulnerability for executing code or for modifying your data.

To enable remote access to phpMyAdmin, follow these steps:

Edit the etc/extra/httpd-xampp.conf file in your XAMPP installation directory.
Within this file, find the lines below.

Alias /phpmyadmin "/opt/lampp/phpmyadmin/"

AllowOverride AuthConfig
Require local

Then replace 'Require local' with 'Require all granted'.

Alias /phpmyadmin "/opt/lampp/phpmyadmin/"

AllowOverride AuthConfig
Require all granted

Restart the Apache server using the XAMPP control panel.

sudo /opt/lampp/lampp restart

注意

  • 在 2020.12.15 的今天,如果使用 xampp 8.0 版本自动配置,在修改完密码之后,会出现 proftp 无法启动的问题。所以最好选择 xampp 7.4 版本。
  • 在阿里云中若无法远程访问 xampp 页面 ( http://ip地址/dashboard/ ) ,那么很大可能是因为 80 端口没有开放
  • 如果要可以远程修改 mysql 数据库,切记要开放 3306 端口

安装 wordpress

创建数据库

在 http://IP 地址/phpmyadmin 中使用 root 账号登陆 mysql ,新建数据库,这里取名为 yunblog

配置 wordpress

  • 在 wordpress 官网下载 wordpress ,这里使用的是 5.6 的版本。

  • 下载后解压后,将文件夹移动到 /opt/lampp/htdocs/ 中

    tar -zxvf wordpress-5.6-zh_CN.tar.gz

    sudo mv wordpress /opt/lampp/htdocs/

  • 打开网址 http://IP 地址/wordpress 按照之时进行配置,如下:

设置数据库.PNG
  • 手动配置 wp-config.php 文件(非必要),在点击提交数据库信息之后,如果权限不足,会提示 wp-config.php 创建失败,这是因为权限不足的缘故。我们也不需要折腾,只要在 /opt/lampp/htdocs/wordpress/ 目录下直接创建 wp-config.php 文件,然后将提示的内容复制进去就可以了。
  • 最后一步就按照提示修改网址名称以及管理者的账号密码就可以了。

wordpress 发布文章标题为中文时出现404的解决方法

wordpress 毕竟是国外的东西,对于中文的支持并不算太好,因此在发布文章时,如果标题名为中文,发布之后打开详情时会出现 404 的错误。解决方法如下:

在 wordpress 管理后台,在 设置 – 固定链接 中原本的选项 文章名 改为 朴素

参考网址:

https://www.jianshu.com/p/083c9efaba2f

http://cloud.yundashi168.com/archives/250?spm=a2c4e.10696291.0.0.63c619a4Qzr8cD

https://www.apachefriends.org/faq_linux.html

你可能感兴趣的:(搭建wordpress个人博客)