2019-01-31笔记—LNMP应用(安装网站程序)

wordpress安装

worrdpress下载地址:https://cn.wordpress.org/download/

[root@linux2019 ~]# cd /data/wwwroot/blog.aibenwoniu.xyz/
[root@linux2019 blog.aibenwoniu.xyz]# wget https://cn.wordpress.org/wordpress-5.0.2-zh_CN.tar.gz
[root@linux2019 blog.aibenwoniu.xyz]# tar zxvf wordpress-5.0.2-zh_CN.tar.gz 
[root@linux2019 blog.aibenwoniu.xyz]# mv wordpress/* ./
[root@linux2019 blog.aibenwoniu.xyz]# rm -rf wordpress
wordpress-5.0.2-zh_CN.tar.gz 

访问 http://blog.aibenwoniu.xyz,进行网页安装程序

在这里插入图片描述

在这里插入图片描述

为博客创建数据库和数据库用户

MariaDB [(none)]> create database blog;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> grant all on blog.* to 'blog@127.0.0.1' identified by 'yourpassword';
Query OK, 0 rows affected (0.002 sec)
#退出重新登陆blog用户
[root@linux2019 blog.aibenwoniu.xyz]# mysql -ublog -p -h127.0.0.1
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 76
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| blog               |
| information_schema |
+--------------------+
2 rows in set (0.001 sec)

MariaDB [(none)]> use blog;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [blog]> 
MariaDB [blog]> show tables;    #workpress安装完成后数据库会生产相应的表,没安装程序之前是空的
+-----------------------+
| Tables_in_blog        |
+-----------------------+
| wp_commentmeta        |
| wp_comments           |
| wp_links              |
| wp_options            |
| wp_postmeta           |
| wp_posts              |
| wp_term_relationships |
| wp_term_taxonomy      |
| wp_termmeta           |
| wp_terms              |
| wp_usermeta           |
| wp_users              |
+-----------------------+
12 rows in set (0.001 sec)

安装报错:
在安装wordpress过程中,需要设定网站程序目录的权限,属主设定为php-fpm服务的那个用户

[root@linux2019 blog.aibenwoniu.xyz]# chown -R php-fpm  /data/wwwroot/blog.aibenwoniu.xyz

[root@linux2019 blog.aibenwoniu.xyz]# ll -trhl
总用量 196K
-rw-r--r--  1 php-fpm    1006  418 9月  25 2013 index.php
-rw-r--r--  1 php-fpm    1006  364 12月 19 2015 wp-blog-header.php
-rw-r--r--  1 php-fpm    1006 3.0K 9月   1 2016 xmlrpc.php
-rw-r--r--  1 php-fpm    1006 2.4K 11月 21 2016 wp-links-opml.php
-rw-r--r--  1 php-fpm    1006 7.9K 1月  11 2017 wp-mail.php
-rw-r--r--  1 php-fpm    1006 3.6K 8月  20 2017 wp-cron.php
-rw-r--r--  1 php-fpm    1006 3.3K 8月  22 2017 wp-load.php
-rw-r--r--  1 php-fpm    1006 4.6K 10月 24 2017 wp-trackback.php
-rw-r--r--  1 php-fpm    1006  30K 4月  30 2018 wp-signup.php
-rw-r--r--  1 php-fpm    1006 1.9K 5月   3 2018 wp-comments-post.php
-rw-r--r--  1 php-fpm    1006  18K 10月 23 15:04 wp-settings.php
-rw-r--r--  1 php-fpm    1006  37K 12月 13 08:28 wp-login.php
-rw-r--r--  1 php-fpm    1006 6.8K 12月 13 09:30 wp-activate.php
drwxr-xr-x 19 php-fpm    1006 8.0K 12月 21 10:00 wp-includes
drwxr-xr-x  9 php-fpm    1006 4.0K 12月 21 10:00 wp-admin
-rw-r--r--  1 php-fpm    1006 2.7K 12月 21 10:00 wp-config-sample.php    #该文件为wordpress程序安装完成后新生成的配置文件
-rw-rw-rw-  1 php-fpm php-fpm 3.0K 1月  25 10:49 wp-config.php
-rw-r--r--  1 php-fpm    1006 6.9K 1月  25 10:58 readme.html
-rw-r--r--  1 php-fpm    1006  20K 1月  25 10:58 license.txt
drwxr-xr-x  7 php-fpm    1006   99 1月  25 11:02 wp-content

注意:生产环境中博客目录文件只需要针对需要有写权限的文件、目录赋予写的权限

discus安装

下载:git clone https://gitee.com/ComsenzDiscuz/DiscuzX.git

[root@linux2019 ~]# cd DiscuzX/
[root@linux2019 DiscuzX]#  cp -r upload/ /data/wwwroot/bbs.aibenwoniu.xyz
[root@linux2019 DiscuzX]#  cd /etc/nginx/conf.d/
[root@linux2019 conf.d]# cp blog.aibenwoniu.xyz.conf bbs.aibenwoniu.xyz.conf
[root@linux2019 conf.d]# vi bbs.aibenwoniu.xyz.conf #修改新的网站虚拟主机配置文件
[root@linux2019 conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@linux2019 conf.d]# nginx -s reload
[root@linux2019 conf.d]# vi /etc/hosts  #添加域名解析

网页开始安装

  • 目录权限修改
[root@linux2019 bbs.aibenwoniu.xyz]# chown -R php-fpm config data uc_client/data uc_server/data
  • 数据库配置
[root@linux2019 ~]# mysql -uroot -proot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 79
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database bbs;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> grant all on bbs.* to 'bbs'@'127.0.0.1' identified by 'bbs?DXG123';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> exit
Bye
[root@linux2019 ~]# mysql -ubbs -p -h127.0.0.1
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 81
Server version: 10.3.11-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| bbs                |
| information_schema |
+--------------------+
2 rows in set (0.001 sec)

MariaDB [(none)]> exit
Bye
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值