ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

day11.3

2022-06-08 14:03:42  阅读:158  来源: 互联网

标签:etc day11.3 nginx wordpress web02 MariaDB root


day13.3

目录

部署WordPress

# 编辑nginx配置文件
[root@web02 nginx]# vim /etc/nginx/conf.d/biog.conf 

server{
        listen 80;
        server_name blog.wc.com;

        location /{
                root /wc1/wordpress;
                index index.php index.html;
        }

        location ~ \.php$ {
                root /wc1/wordpress;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;

        }
}

# 2.检查nginx语法
[root@web02 nginx]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# 3.重启nginx配置文件
[root@web02 nginx]# systemctl reload nginx

# 4.创建站点目录并授权
[root@web02 nginx]# mkdir /wc1/wordpress
[root@web02 nginx]# chown -R www.www /wc1/wordpress

# 5.测试nginx连接nginx(编写php info代码)
[root@web01 ~]# vim /blog/info.php
<?php
phpinfo();
?>

# 6.windows域名解析
打开路径:C:\Windows\System32\drivers\etc 编辑hosts文件
10.0.0.7 blog.zls.com

# 7.打开浏览器访问:blog.wc.com

# 8.下载WordPress代码
WordPress官网:https://wordpress.org/
[root@web01 wc1]# wget https://cn.wordpress.org/latest-zh_CN.tar.gz

# 9.解压代码
[root@web02 wc1]# tar xf latest.tar.gz

# 10.修改nginx配置文件
[root@web02 nginx]# vim /etc/nginx/conf.d/biog.conf 

server{
        listen 80;
        server_name blog.wc.com;

        location /{
                root /wc1/wordpress;
                index index.php index.html;
        }

        location ~ \.php$ {
                root /wc1/wordpress;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;

        }
}

# 11.检查nginx语法
[root@web02 nginx]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# 12.重启nginx配置文件
[root@web02 nginx]# systemctl reload nginx

# 13.打开浏览器,访问:blog.wc.com


安装数据库

# 数据库是c/s结构
# 端口:3306

# 1.安装mariadb
[root@web02 ~]#  yum install -y mariadb-server

# 2.启动数据库并加入开机自启
[root@web02 ~]# systemctl start mariadb
[root@web02 ~]# systemctl enable mariadb

# 3.登录数据库
[root@web02 ~]# mysql

# 4.查看所有库
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
| wordpress          |
+--------------------+
5 rows in set (0.00 sec)

# 5.切换数据库
MariaDB [(none)]> use mysql

# 6.查看该库中的所有表
MariaDB [mysql]> show tables
    -> ;

# 7.创建数据库
MariaDB [mysql]> create database 库名字;
MariaDB [mysql]> create database wordpress;

# 8.创建用户
MariaDB [(none)]> grant all on 所有库.所有表 to 用户名@'主机IP' identified by '密码';
MariaDB [(none)]> grant all on *.* to wp@'localhost' identified by '123';

# 9.查看用户
MariaDB [mysql]> select user,host from mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1       |
|      | localhost |
| root | localhost |
| wp   | localhost |
|      | web02     |
| root | web02     |
+------+-----------+
7 rows in set (0.00 sec)

# 10.退出数据库
MariaDB [(none)]> exit
MariaDB [(none)]> quit
MariaDB [(none)]> \q

数据库名字:wordpress
连接用户名:wp
连接密码:123
连接ip:losthost


标签:etc,day11.3,nginx,wordpress,web02,MariaDB,root
来源: https://www.cnblogs.com/wangchengww/p/16355423.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有