当前位置: 主页 > 采集相关 > 关键词采集

实战:部署wordpress

时间:2023-09-24 02:11:45 关键词采集 我要投稿

教程每周二、四、六更新

WordPress是一款能让您建立出色网站、博客或应用程序的使用php开发的开源软件本节通过部署wordpress网站来体验一下LNMP的魅力WordPress下载地址:https://cn.wordpress.org/download/#download-install。

下载以后后拷贝到Linux中:[root@localhost ~]# mkdir /usr/share/nginx/html/blog[root@localhost ~]# tar -zxvf wordpress-5.9.3-zh_CN.tar.gz

[root@localhost ~]# cp -r wordpress/* /usr/share/nginx/html/blog[root@localhost ~]# vim /etc/nginx/conf.d/default.conf

[root@localhost ~]# cat /etc/nginx/conf.d/default.conf | grep -v "^ #"server {    listen 80;    server_name localhost;

location / {        root /usr/share/nginx/html/blog; # http的root目录设置为/usr/share/nginx/html/blog        index index.php index.html index.htm;

}    error_page 500502503504  /50x.html;    location = /50x.html {        root /usr/share/nginx/html;

}    location ~ \.php$ {            root /usr/share/nginx/html/blog; # http的root目录设置为/usr/share/nginx/html/blog

fastcgi_pass 127.0.0.1:9000;             fastcgi_index index.php;            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

            include fastcgi_params;     }}重启nginx服务:[root@localhost ~]# systemctl restart nginx创建一个数据库:

[root@localhost blog]# mysql -uroot -pTsinghua@123mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 8Server version:5.7

.37 MySQL Community Server (GPL)Copyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation

and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help;or\hfor help. Type

\c to clear the current input statement.mysql> create database wordpress; # 创建一个数据库Query OK, 1 row affected (

0.00 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema |

| mysql || performance_schema || sys || wordpress |# 这个wordpress就是我们创建的数据库+--------------------+5 rows

in setshiping号,求关注!!!和大家一起学习 技术!

推荐阅读《一站式教程之集群架构》:Nginx面试题(总结最全面的面试题!!!)Nginx 面试题 40 问初识LNMPLNMP - FastCGI部署LNMP(1)部署LNMP(2)- 配置nginx部署LNMP(3)- 配置mysql

看完本文有收获?请分享给更多人推荐关注「Cloud研习社」,带你从零开始掌握云计算技术!

猜你喜欢